210 lines
6.1 KiB
Java
210 lines
6.1 KiB
Java
package o;
|
|
|
|
import android.content.Context;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
import androidx.viewpager.widget.ViewPager;
|
|
import java.util.List;
|
|
import kotlin.NoWhenBranchMatchedException;
|
|
|
|
/* renamed from: o.eqx, reason: case insensitive filesystem */
|
|
/* loaded from: classes5.dex */
|
|
public abstract class AbstractC12056eqx<T> extends WYJ {
|
|
public List<? extends T> a;
|
|
public boolean b;
|
|
public ViewPager c;
|
|
public final Context d;
|
|
public final RVV e;
|
|
private final HBt<T> g;
|
|
private LayoutInflater j;
|
|
|
|
/* renamed from: o.eqx$HBt */
|
|
/* loaded from: classes5.dex */
|
|
public interface HBt<U> {
|
|
void d();
|
|
|
|
void e(U u);
|
|
}
|
|
|
|
/* renamed from: o.eqx$IeS */
|
|
/* loaded from: classes5.dex */
|
|
public enum IeS {
|
|
LOADING,
|
|
REFRESH,
|
|
ITEM,
|
|
NO_ITEMS
|
|
}
|
|
|
|
public abstract View d(int i);
|
|
|
|
public AbstractC12056eqx(Context context, HBt<T> hBt) {
|
|
C14957gcv.e(context, "");
|
|
C14957gcv.e(hBt, "");
|
|
this.d = context;
|
|
this.g = hBt;
|
|
this.e = new RVV(this);
|
|
Object systemService = context.getSystemService("layout_inflater");
|
|
C14957gcv.d(systemService, "");
|
|
this.j = (LayoutInflater) systemService;
|
|
}
|
|
|
|
/* renamed from: o.eqx$RVV */
|
|
/* loaded from: classes5.dex */
|
|
public static final class RVV implements ViewPager.ojQ {
|
|
private AbstractC12056eqx<T> a;
|
|
|
|
@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) {
|
|
}
|
|
|
|
RVV(AbstractC12056eqx<T> abstractC12056eqx) {
|
|
this.a = abstractC12056eqx;
|
|
}
|
|
|
|
@Override // androidx.viewpager.widget.ViewPager.ojQ
|
|
public final void onPageSelected(int i) {
|
|
List<? extends T> list = this.a.a;
|
|
if (list == null || list.isEmpty()) {
|
|
return;
|
|
}
|
|
AbstractC12056eqx<T> abstractC12056eqx = this.a;
|
|
List<? extends T> list2 = abstractC12056eqx.a;
|
|
T t = list2 != null ? list2.get(i) : null;
|
|
C14957gcv.e(t);
|
|
abstractC12056eqx.c(t);
|
|
}
|
|
}
|
|
|
|
@Override // o.WYJ
|
|
public int getCount() {
|
|
List<? extends T> list = this.a;
|
|
if (list != null) {
|
|
C14957gcv.e(list);
|
|
if (!list.isEmpty()) {
|
|
List<? extends T> list2 = this.a;
|
|
C14957gcv.e(list2);
|
|
return list2.size();
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
@Override // o.WYJ
|
|
public Object instantiateItem(ViewGroup viewGroup, int i) {
|
|
IeS ieS;
|
|
View inflate;
|
|
C14957gcv.e(viewGroup, "");
|
|
List<? extends T> list = this.a;
|
|
if (list == null && this.b) {
|
|
ieS = IeS.LOADING;
|
|
} else if (list == null && !this.b) {
|
|
ieS = IeS.REFRESH;
|
|
} else {
|
|
ieS = (list == null || list.size() != 0) ? IeS.ITEM : IeS.NO_ITEMS;
|
|
}
|
|
int i2 = LWm.a[ieS.ordinal()];
|
|
if (i2 == 1) {
|
|
inflate = this.j.inflate(com.scb.phone.R.layout.2131559262, (ViewGroup) null);
|
|
} else if (i2 == 2) {
|
|
inflate = this.j.inflate(com.scb.phone.R.layout.2131559322, (ViewGroup) null);
|
|
inflate.findViewById(com.scb.phone.R.id.rl_refresh_layout).setOnClickListener(new View.OnClickListener(this) { // from class: o.eqA
|
|
private AbstractC12056eqx b;
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public final void onClick(View view) {
|
|
AbstractC12056eqx.d(this.b);
|
|
}
|
|
|
|
{
|
|
this.b = this;
|
|
}
|
|
});
|
|
} else if (i2 == 3) {
|
|
inflate = this.j.inflate(com.scb.phone.R.layout.2131559012, (ViewGroup) null);
|
|
} else {
|
|
if (i2 != 4) {
|
|
throw new NoWhenBranchMatchedException();
|
|
}
|
|
inflate = d(i);
|
|
}
|
|
viewGroup.addView(inflate, 0);
|
|
C14957gcv.c(inflate, "");
|
|
return inflate;
|
|
}
|
|
|
|
public void c(T t) {
|
|
this.g.e(t);
|
|
}
|
|
|
|
@Override // o.WYJ
|
|
public void destroyItem(ViewGroup viewGroup, int i, Object obj) {
|
|
C14957gcv.e(viewGroup, "");
|
|
C14957gcv.e(obj, "");
|
|
viewGroup.removeView((View) obj);
|
|
}
|
|
|
|
/* renamed from: o.eqx$Sts */
|
|
/* loaded from: classes5.dex */
|
|
public static abstract class Sts<U> extends RecyclerView.zJl {
|
|
private final View b;
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
public Sts(View view) {
|
|
super(view);
|
|
C14957gcv.e(view, "");
|
|
this.b = view;
|
|
}
|
|
}
|
|
|
|
public static /* synthetic */ void d(AbstractC12056eqx abstractC12056eqx) {
|
|
C14957gcv.e(abstractC12056eqx, "");
|
|
abstractC12056eqx.g.d();
|
|
}
|
|
|
|
/* renamed from: o.eqx$LWm */
|
|
/* loaded from: classes5.dex */
|
|
public final /* synthetic */ class LWm {
|
|
public static final int[] a;
|
|
|
|
static {
|
|
int[] iArr = new int[IeS.values().length];
|
|
try {
|
|
iArr[IeS.LOADING.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused) {
|
|
}
|
|
try {
|
|
iArr[IeS.REFRESH.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused2) {
|
|
}
|
|
try {
|
|
iArr[IeS.NO_ITEMS.ordinal()] = 3;
|
|
} catch (NoSuchFieldError unused3) {
|
|
}
|
|
try {
|
|
iArr[IeS.ITEM.ordinal()] = 4;
|
|
} catch (NoSuchFieldError unused4) {
|
|
}
|
|
a = iArr;
|
|
}
|
|
}
|
|
|
|
@Override // o.WYJ
|
|
public boolean isViewFromObject(View view, Object obj) {
|
|
C14957gcv.e(view, "");
|
|
C14957gcv.e(obj, "");
|
|
return view == obj;
|
|
}
|
|
|
|
@Override // o.WYJ
|
|
public int getItemPosition(Object obj) {
|
|
C14957gcv.e(obj, "");
|
|
return -2;
|
|
}
|
|
}
|