182 lines
6.7 KiB
Java
182 lines
6.7 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.C14866gag;
|
||
|
import o.C14957gcv;
|
||
|
import o.InterfaceC14894gbR;
|
||
|
import o.WYJ;
|
||
|
import o.nMh;
|
||
|
|
||
|
/* loaded from: classes5.dex */
|
||
|
public final class CustomCollateralCarSelector extends LinearLayout {
|
||
|
private int b;
|
||
|
|
||
|
@BindView
|
||
|
public CircleIndicator mCircleIndicator;
|
||
|
|
||
|
@BindView
|
||
|
public NoSwipeViewPager mViewPager;
|
||
|
|
||
|
private /* synthetic */ CustomCollateralCarSelector(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 CustomCollateralCarSelector(Context context, AttributeSet attributeSet, int i) {
|
||
|
super(context, attributeSet, i);
|
||
|
C14957gcv.e(context, "");
|
||
|
this.b = R.drawable.bg_white_rounded;
|
||
|
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 Sts implements ViewPager.ojQ {
|
||
|
private CustomCollateralCarSelector b;
|
||
|
private InterfaceC14894gbR<Integer, C14866gag> e;
|
||
|
|
||
|
@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) {
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
public Sts(CustomCollateralCarSelector customCollateralCarSelector, InterfaceC14894gbR<? super Integer, C14866gag> interfaceC14894gbR) {
|
||
|
this.b = customCollateralCarSelector;
|
||
|
this.e = interfaceC14894gbR;
|
||
|
}
|
||
|
|
||
|
@Override // androidx.viewpager.widget.ViewPager.ojQ
|
||
|
public final void onPageSelected(int i) {
|
||
|
this.b.setSelectedCollateralStyle(i);
|
||
|
this.e.invoke(Integer.valueOf(i));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public final void setSelectedCollateral(int i) {
|
||
|
NoSwipeViewPager noSwipeViewPager = this.mViewPager;
|
||
|
NoSwipeViewPager noSwipeViewPager2 = null;
|
||
|
if (noSwipeViewPager == null) {
|
||
|
C14957gcv.a("");
|
||
|
noSwipeViewPager = null;
|
||
|
}
|
||
|
if (noSwipeViewPager.getAdapter() instanceof CollateralSelectorAdapter) {
|
||
|
NoSwipeViewPager noSwipeViewPager3 = this.mViewPager;
|
||
|
if (noSwipeViewPager3 == null) {
|
||
|
C14957gcv.a("");
|
||
|
noSwipeViewPager3 = null;
|
||
|
}
|
||
|
WYJ adapter = noSwipeViewPager3.getAdapter();
|
||
|
C14957gcv.d(adapter, "");
|
||
|
((CollateralSelectorAdapter) adapter).a = i;
|
||
|
}
|
||
|
NoSwipeViewPager noSwipeViewPager4 = this.mViewPager;
|
||
|
if (noSwipeViewPager4 != null) {
|
||
|
noSwipeViewPager2 = noSwipeViewPager4;
|
||
|
} else {
|
||
|
C14957gcv.a("");
|
||
|
}
|
||
|
noSwipeViewPager2.setCurrentItem(i);
|
||
|
setSelectedCollateralStyle(i);
|
||
|
}
|
||
|
|
||
|
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.mViewPager;
|
||
|
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.mViewPager;
|
||
|
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 RVV {
|
||
|
private RVV() {
|
||
|
}
|
||
|
|
||
|
public /* synthetic */ RVV(byte b) {
|
||
|
this();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public static /* synthetic */ void b(CustomCollateralCarSelector customCollateralCarSelector, InterfaceC14894gbR interfaceC14894gbR, InterfaceC14894gbR interfaceC14894gbR2, int i) {
|
||
|
C14957gcv.e(customCollateralCarSelector, "");
|
||
|
C14957gcv.e(interfaceC14894gbR, "");
|
||
|
C14957gcv.e(interfaceC14894gbR2, "");
|
||
|
NoSwipeViewPager noSwipeViewPager = customCollateralCarSelector.mViewPager;
|
||
|
if (noSwipeViewPager == null) {
|
||
|
C14957gcv.a("");
|
||
|
noSwipeViewPager = null;
|
||
|
}
|
||
|
noSwipeViewPager.setCurrentItem(i, true);
|
||
|
interfaceC14894gbR.invoke(Integer.valueOf(i));
|
||
|
interfaceC14894gbR2.invoke(Integer.valueOf(i));
|
||
|
}
|
||
|
|
||
|
public final void setMViewPager(NoSwipeViewPager noSwipeViewPager) {
|
||
|
C14957gcv.e(noSwipeViewPager, "");
|
||
|
this.mViewPager = 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 CustomCollateralCarSelector(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 CustomCollateralCarSelector(Context context) {
|
||
|
this(context, null, 6, (byte) 0);
|
||
|
C14957gcv.e(context, "");
|
||
|
}
|
||
|
|
||
|
static {
|
||
|
new RVV((byte) 0);
|
||
|
}
|
||
|
}
|