what-the-bank/sources/com/scb/phone/view/custom/easycash/CustomCollateralSelector.java

258 lines
9.2 KiB
Java

package com.scb.phone.view.custom.easycash;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.viewpager.widget.ViewPager;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import com.scb.phone.view.adapter.easycash.CollateralSelectorAdapter;
import com.scb.phone.view.custom.common.NoSwipeViewPager;
import me.relex.circleindicator.CircleIndicator;
import o.AbstractC14961gcz;
import o.C14957gcv;
import o.InterfaceC14890gbN;
import o.WYJ;
import o.fXO;
import o.nMh;
/* loaded from: classes5.dex */
public final class CustomCollateralSelector extends LinearLayout {
private final InterfaceC14890gbN<Integer> a;
private int b;
private final InterfaceC14890gbN<fXO> e;
@BindView
public CircleIndicator mCircleIndicator;
@BindView
public NoSwipeViewPager nsvpViewPager;
/* loaded from: classes5.dex */
public interface IeS {
void b(int i);
}
/* loaded from: classes5.dex */
public interface Sts {
void e(int i);
}
private /* synthetic */ CustomCollateralSelector(Context context, AttributeSet attributeSet, int i, byte b) {
this(context, (i & 2) != 0 ? null : attributeSet, 0);
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public CustomCollateralSelector(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
C14957gcv.e(context, "");
this.b = R.drawable.bg_white_rounded;
this.a = new jbe(this);
this.e = new HBt(this);
Object systemService = context.getSystemService("layout_inflater");
C14957gcv.d(systemService, "");
((LayoutInflater) systemService).inflate(R.layout.2131558959, (ViewGroup) this, true);
ButterKnife.c(this);
}
/* loaded from: classes5.dex */
public static final class RVV implements ViewPager.ojQ {
private Sts a;
private CustomCollateralSelector c;
@Override // androidx.viewpager.widget.ViewPager.ojQ
public final void onPageScrollStateChanged(int i) {
}
@Override // androidx.viewpager.widget.ViewPager.ojQ
public final void onPageScrolled(int i, float f, int i2) {
}
public RVV(CustomCollateralSelector customCollateralSelector, Sts sts) {
this.c = customCollateralSelector;
this.a = sts;
}
@Override // androidx.viewpager.widget.ViewPager.ojQ
public final void onPageSelected(int i) {
this.c.setSelectedCollateralStyle(i);
this.a.e(i);
}
}
public final void setSelectedCollateral(int i) {
NoSwipeViewPager noSwipeViewPager = this.nsvpViewPager;
NoSwipeViewPager noSwipeViewPager2 = null;
if (noSwipeViewPager == null) {
C14957gcv.a("");
noSwipeViewPager = null;
}
if (noSwipeViewPager.getAdapter() instanceof CollateralSelectorAdapter) {
NoSwipeViewPager noSwipeViewPager3 = this.nsvpViewPager;
if (noSwipeViewPager3 == null) {
C14957gcv.a("");
noSwipeViewPager3 = null;
}
WYJ adapter = noSwipeViewPager3.getAdapter();
C14957gcv.d(adapter, "");
((CollateralSelectorAdapter) adapter).a = i;
}
NoSwipeViewPager noSwipeViewPager4 = this.nsvpViewPager;
if (noSwipeViewPager4 != null) {
noSwipeViewPager2 = noSwipeViewPager4;
} else {
C14957gcv.a("");
}
noSwipeViewPager2.setCurrentItem(i);
setSelectedCollateralStyle(i);
}
/* loaded from: classes5.dex */
static final class jbe extends AbstractC14961gcz implements InterfaceC14890gbN<Integer> {
private CustomCollateralSelector a;
@Override // o.InterfaceC14890gbN
public final /* synthetic */ Integer invoke() {
NoSwipeViewPager noSwipeViewPager = this.a.nsvpViewPager;
if (noSwipeViewPager == null) {
C14957gcv.a("");
noSwipeViewPager = null;
}
return Integer.valueOf(noSwipeViewPager.getCurrentItem());
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
jbe(CustomCollateralSelector customCollateralSelector) {
super(0);
this.a = customCollateralSelector;
}
}
/* loaded from: classes5.dex */
static final class HBt extends AbstractC14961gcz implements InterfaceC14890gbN<fXO> {
private CustomCollateralSelector e;
@Override // o.InterfaceC14890gbN
public final /* synthetic */ fXO invoke() {
NoSwipeViewPager noSwipeViewPager = this.e.nsvpViewPager;
if (noSwipeViewPager == null) {
C14957gcv.a("");
noSwipeViewPager = null;
}
if (!(noSwipeViewPager.getAdapter() instanceof CollateralSelectorAdapter)) {
return null;
}
NoSwipeViewPager noSwipeViewPager2 = this.e.nsvpViewPager;
if (noSwipeViewPager2 == null) {
C14957gcv.a("");
noSwipeViewPager2 = null;
}
WYJ adapter = noSwipeViewPager2.getAdapter();
C14957gcv.d(adapter, "");
CollateralSelectorAdapter collateralSelectorAdapter = (CollateralSelectorAdapter) adapter;
NoSwipeViewPager noSwipeViewPager3 = this.e.nsvpViewPager;
if (noSwipeViewPager3 == null) {
C14957gcv.a("");
noSwipeViewPager3 = null;
}
int currentItem = noSwipeViewPager3.getCurrentItem();
if (currentItem < collateralSelectorAdapter.getCount()) {
return collateralSelectorAdapter.e.get(currentItem);
}
return null;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
HBt(CustomCollateralSelector customCollateralSelector) {
super(0);
this.e = customCollateralSelector;
}
}
public final void setSelectedCollateralStyle(int i) {
int[] iArr = {i - 1, i, i + 1};
for (int i2 = 0; i2 < 3; i2++) {
int i3 = iArr[i2];
NoSwipeViewPager noSwipeViewPager = this.nsvpViewPager;
NoSwipeViewPager noSwipeViewPager2 = null;
if (noSwipeViewPager == null) {
C14957gcv.a("");
noSwipeViewPager = null;
}
View findViewWithTag = noSwipeViewPager.findViewWithTag("TAG_COLLATERAL_SELECTOR_ADAPTER_BACKGROUND".concat(String.valueOf(i3)));
NoSwipeViewPager noSwipeViewPager3 = this.nsvpViewPager;
if (noSwipeViewPager3 != null) {
noSwipeViewPager2 = noSwipeViewPager3;
} else {
C14957gcv.a("");
}
TextView textView = (TextView) noSwipeViewPager2.findViewWithTag("TAG_COLLATERAL_SELECTOR_ADAPTER_TEXT".concat(String.valueOf(i3)));
if (findViewWithTag != null) {
findViewWithTag.setBackground(nMh.getDrawable(getContext(), i == i3 ? R.drawable.rounded_purple_view_pager : this.b));
}
if (textView != null) {
textView.setTextColor(nMh.getColor(getContext(), i == i3 ? R.color.f2982131099805 : R.color.f3092131099816));
}
}
}
/* loaded from: classes5.dex */
public static final class LWm {
private LWm() {
}
public /* synthetic */ LWm(byte b) {
this();
}
}
public static /* synthetic */ void b(CustomCollateralSelector customCollateralSelector, Sts sts, IeS ieS, int i) {
C14957gcv.e(customCollateralSelector, "");
C14957gcv.e(sts, "");
C14957gcv.e(ieS, "");
NoSwipeViewPager noSwipeViewPager = customCollateralSelector.nsvpViewPager;
if (noSwipeViewPager == null) {
C14957gcv.a("");
noSwipeViewPager = null;
}
noSwipeViewPager.setCurrentItem(i, true);
sts.e(i);
ieS.b(i);
}
public final void setNsvpViewPager(NoSwipeViewPager noSwipeViewPager) {
C14957gcv.e(noSwipeViewPager, "");
this.nsvpViewPager = noSwipeViewPager;
}
public final void setMCircleIndicator(CircleIndicator circleIndicator) {
C14957gcv.e(circleIndicator, "");
this.mCircleIndicator = circleIndicator;
}
public final void setBackgroundDrawable(int i) {
this.b = i;
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public CustomCollateralSelector(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 4, (byte) 0);
C14957gcv.e(context, "");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public CustomCollateralSelector(Context context) {
this(context, null, 6, (byte) 0);
C14957gcv.e(context, "");
}
static {
new LWm((byte) 0);
}
}