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

144 lines
5.1 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
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 com.scb.phone.R;
import com.scb.phone.view.custom.common.NoSwipeViewPager;
import me.relex.circleindicator.CircleIndicator;
import o.C12198etg;
import o.C14957gcv;
import o.NDM;
import o.WYJ;
import o.eCI;
import o.nMh;
import o.qeC;
/* loaded from: classes5.dex */
public final class CustomCarSelector extends LinearLayout {
private int a;
public NDM e;
private /* synthetic */ CustomCarSelector(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 CustomCarSelector(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
C14957gcv.e(context, "");
this.a = R.drawable.bg_white_rounded;
CustomCarSelector customCarSelector = this;
View inflate = LayoutInflater.from(context).inflate(R.layout.2131558934, (ViewGroup) customCarSelector, false);
customCarSelector.addView(inflate);
int i2 = R.id.car_select_indicator;
CircleIndicator circleIndicator = (CircleIndicator) qeC.e(inflate, R.id.car_select_indicator);
if (circleIndicator != null) {
i2 = R.id.car_select_view_pager;
NoSwipeViewPager noSwipeViewPager = (NoSwipeViewPager) qeC.e(inflate, R.id.car_select_view_pager);
if (noSwipeViewPager != null) {
LinearLayout linearLayout = (LinearLayout) inflate;
NDM ndm = new NDM(linearLayout, circleIndicator, noSwipeViewPager, linearLayout);
C14957gcv.c(ndm, "");
this.e = ndm;
return;
}
}
throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i2)));
}
/* loaded from: classes5.dex */
public static final class IeS implements ViewPager.ojQ {
private eCI a;
private CustomCarSelector 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 IeS(CustomCarSelector customCarSelector, eCI eci) {
this.c = customCarSelector;
this.a = eci;
}
@Override // androidx.viewpager.widget.ViewPager.ojQ
public final void onPageSelected(int i) {
this.c.setSelectedCarStyle(i);
this.a.d(i);
}
}
public final void setSelectedCar(int i) {
NDM ndm = this.e;
WYJ adapter = ndm.e.getAdapter();
C12198etg c12198etg = adapter instanceof C12198etg ? (C12198etg) adapter : null;
if (c12198etg != null) {
c12198etg.b = i;
}
ndm.e.setCurrentItem(i);
setSelectedCarStyle(i);
}
public final void setSelectedCarStyle(int i) {
int[] iArr = {i - 1, i, i + 1};
NDM ndm = this.e;
for (int i2 = 0; i2 < 3; i2++) {
int i3 = iArr[i2];
View findViewWithTag = ndm.e.findViewWithTag("TAG_ACCOUNT_SELECTOR_ADAPTER_BACKGROUND".concat(String.valueOf(i3)));
if (findViewWithTag != null) {
findViewWithTag.setBackground(nMh.getDrawable(findViewWithTag.getContext(), i == i3 ? R.drawable.rounded_purple_view_pager : this.a));
}
TextView textView = (TextView) ndm.e.findViewWithTag("TAG_CAR_SELECTOR_ADAPTER_TITLE_TEXT".concat(String.valueOf(i3)));
if (textView != null) {
textView.setTextColor(nMh.getColor(textView.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(CustomCarSelector customCarSelector, eCI eci, int i) {
C14957gcv.e(customCarSelector, "");
C14957gcv.e(eci, "");
customCarSelector.e.e.setCurrentItem(i, true);
eci.d(i);
}
public final void setBackgroundDrawable(int i) {
this.a = i;
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public CustomCarSelector(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 CustomCarSelector(Context context) {
this(context, null, 6, (byte) 0);
C14957gcv.e(context, "");
}
static {
new LWm((byte) 0);
}
}