what-the-bank/sources/o/C12067erH.java

227 lines
9.9 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package o;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.CountDownTimer;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.scb.phone.view.adapter.ccrredemption.ecoupon.MyECouponViewHolder;
import java.util.ArrayList;
/* renamed from: o.erH, reason: case insensitive filesystem */
/* loaded from: classes5.dex */
public final class C12067erH extends AbstractC12141esc {
public boolean b;
public InterfaceC12069erJ c;
public final ArrayList<C0484Hp> d;
private final InterfaceC12072erM e;
public C12067erH(InterfaceC12072erM interfaceC12072erM) {
C14957gcv.e(interfaceC12072erM, "");
this.e = interfaceC12072erM;
this.d = new ArrayList<>();
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final void onBindViewHolder(RecyclerView.zJl zjl, int i) {
ImageView imageView;
C14957gcv.e(zjl, "");
if (zjl instanceof MyECouponViewHolder) {
MyECouponViewHolder myECouponViewHolder = (MyECouponViewHolder) zjl;
final C0484Hp c0484Hp = this.d.get(i);
C14957gcv.c(c0484Hp, "");
myECouponViewHolder.itemView.setOnClickListener(new View.OnClickListener(this, c0484Hp) { // from class: o.erI
private C12067erH a;
private C0484Hp c;
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
C12067erH.b(this.a, this.c);
}
{
this.a = this;
this.c = c0484Hp;
}
});
C14957gcv.e(c0484Hp, "");
Drawable drawable = nMh.getDrawable(myECouponViewHolder.a.getContext(), com.scb.phone.R.drawable.shape_circle_lighter_gray);
Context context = myECouponViewHolder.a.getContext();
ImageView imageView2 = myECouponViewHolder.ivIcon;
View view = null;
if (imageView2 != null) {
imageView = imageView2;
} else {
C14957gcv.a("");
imageView = null;
}
C12891fKc.azg_(context, drawable, imageView, "https://fasteasy.scbeasy.com:8888/api/ccrewardredemption/".concat(String.valueOf(c0484Hp.h)), myECouponViewHolder.a.getContext().getResources().getDimensionPixelOffset(com.scb.phone.R.dimen.f18812131165647), nMh.getColor(myECouponViewHolder.a.getContext(), com.scb.phone.R.color.f3472131099855));
ImageView imageView3 = myECouponViewHolder.ivNotificationIcon;
if (imageView3 == null) {
C14957gcv.a("");
imageView3 = null;
}
imageView3.setVisibility(8);
TextView textView = myECouponViewHolder.tvTitle;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(c0484Hp.j);
if (myECouponViewHolder.b) {
Integer valueOf = Integer.valueOf(c0484Hp.b);
if (valueOf == null || valueOf.intValue() == 0) {
if (c0484Hp.c > 1.0d) {
String b = C6583cXR.b(c0484Hp.c);
C14957gcv.c((Object) b, "");
TextView textView2 = myECouponViewHolder.tvExpire;
if (textView2 == null) {
C14957gcv.a("");
textView2 = null;
}
TextView textView3 = myECouponViewHolder.tvExpire;
if (textView3 == null) {
C14957gcv.a("");
textView3 = null;
}
textView2.setTextColor(nMh.getColor(textView3.getContext(), com.scb.phone.R.color.f2272131099733));
TextView textView4 = myECouponViewHolder.tvExpire;
if (textView4 == null) {
C14957gcv.a("");
textView4 = null;
}
textView4.setText(myECouponViewHolder.a.getResources().getString(com.scb.phone.R.string.my_e_coupon_expire_day, b));
} else if (!c0484Hp.g) {
TextView textView5 = myECouponViewHolder.tvExpire;
if (textView5 == null) {
C14957gcv.a("");
textView5 = null;
}
TextView textView6 = myECouponViewHolder.tvExpire;
if (textView6 == null) {
C14957gcv.a("");
textView6 = null;
}
textView5.setTextColor(nMh.getColor(textView6.getContext(), com.scb.phone.R.color.f2272131099733));
TextView textView7 = myECouponViewHolder.tvExpire;
if (textView7 == null) {
C14957gcv.a("");
textView7 = null;
}
textView7.setText(myECouponViewHolder.a.getResources().getString(com.scb.phone.R.string.my_e_coupon_expire_today));
}
} else if (myECouponViewHolder.d == null) {
myECouponViewHolder.d = new MyECouponViewHolder.RVV(MyECouponViewHolder.b().parse(c0484Hp.a).getTime() - MyECouponViewHolder.b().parse(MyECouponViewHolder.e()).getTime(), myECouponViewHolder).start();
}
} else if (c0484Hp.i) {
String str = c0484Hp.d;
TextView textView8 = myECouponViewHolder.tvExpire;
if (textView8 == null) {
C14957gcv.a("");
textView8 = null;
}
TextView textView9 = myECouponViewHolder.tvExpire;
if (textView9 == null) {
C14957gcv.a("");
textView9 = null;
}
textView8.setTextColor(nMh.getColor(textView9.getContext(), com.scb.phone.R.color.f13652131100873));
TextView textView10 = myECouponViewHolder.tvExpire;
if (textView10 == null) {
C14957gcv.a("");
textView10 = null;
}
textView10.setText(myECouponViewHolder.a.getResources().getString(com.scb.phone.R.string.my_e_coupon_redeemed, str));
} else if (c0484Hp.g) {
String str2 = c0484Hp.e;
TextView textView11 = myECouponViewHolder.tvExpire;
if (textView11 == null) {
C14957gcv.a("");
textView11 = null;
}
TextView textView12 = myECouponViewHolder.tvExpire;
if (textView12 == null) {
C14957gcv.a("");
textView12 = null;
}
textView11.setTextColor(nMh.getColor(textView12.getContext(), com.scb.phone.R.color.f13652131100873));
TextView textView13 = myECouponViewHolder.tvExpire;
if (textView13 == null) {
C14957gcv.a("");
textView13 = null;
}
textView13.setText(myECouponViewHolder.a.getResources().getString(com.scb.phone.R.string.my_e_coupon_expired, str2));
}
if (i == this.d.size() - 1) {
View view2 = myECouponViewHolder.vwSeparatorMarginLeft;
if (view2 == null) {
C14957gcv.a("");
view2 = null;
}
view2.setVisibility(8);
View view3 = myECouponViewHolder.vwSeparatorFull;
if (view3 != null) {
view = view3;
} else {
C14957gcv.a("");
}
view.setVisibility(0);
return;
}
View view4 = myECouponViewHolder.vwSeparatorMarginLeft;
if (view4 == null) {
C14957gcv.a("");
view4 = null;
}
view4.setVisibility(0);
View view5 = myECouponViewHolder.vwSeparatorFull;
if (view5 != null) {
view = view5;
} else {
C14957gcv.a("");
}
view.setVisibility(8);
}
}
@Override // o.AbstractC12141esc
public final RecyclerView.zJl amY_(ViewGroup viewGroup) {
C14957gcv.e(viewGroup, "");
View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(com.scb.phone.R.layout.2131560020, viewGroup, false);
C14957gcv.c(inflate, "");
return new MyECouponViewHolder(inflate, this.b, this.e);
}
@Override // o.AbstractC12141esc
public final int d() {
return this.d.size();
}
@Override // androidx.recyclerview.widget.RecyclerView.Sts
public final void onViewDetachedFromWindow(RecyclerView.zJl zjl) {
C14957gcv.e(zjl, "");
super.onViewDetachedFromWindow(zjl);
if (zjl instanceof MyECouponViewHolder) {
MyECouponViewHolder myECouponViewHolder = (MyECouponViewHolder) zjl;
CountDownTimer countDownTimer = myECouponViewHolder.d;
if (countDownTimer != null) {
countDownTimer.cancel();
}
myECouponViewHolder.d = null;
}
}
public static /* synthetic */ void b(C12067erH c12067erH, C0484Hp c0484Hp) {
C14957gcv.e(c12067erH, "");
C14957gcv.e(c0484Hp, "");
InterfaceC12069erJ interfaceC12069erJ = c12067erH.c;
if (interfaceC12069erJ != null) {
interfaceC12069erJ.b(c0484Hp);
}
}
}