what-the-bank/sources/com/scb/phone/view/adapter/ccrredemption/ecoupon/MyECouponViewHolder.java

152 lines
4.7 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.adapter.ccrredemption.ecoupon;
import android.os.CountDownTimer;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import com.scb.phone.view.adapter.ccrredemption.ecoupon.MyECouponViewHolder;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;
import o.C14957gcv;
import o.InterfaceC12072erM;
import o.nMh;
/* loaded from: classes5.dex */
public final class MyECouponViewHolder extends RecyclerView.zJl {
public final View a;
public final boolean b;
private final InterfaceC12072erM c;
public CountDownTimer d;
private final SimpleDateFormat e;
@BindView
public ImageView ivIcon;
@BindView
public ImageView ivNotificationIcon;
@BindView
public TextView tvExpire;
@BindView
public TextView tvTitle;
@BindView
public View vwSeparatorFull;
@BindView
public View vwSeparatorMarginLeft;
public static final /* synthetic */ void c(final MyECouponViewHolder myECouponViewHolder) {
myECouponViewHolder.a.post(new Runnable(myECouponViewHolder) { // from class: o.erN
private MyECouponViewHolder d;
@Override // java.lang.Runnable
public final void run() {
MyECouponViewHolder.d(this.d);
}
{
this.d = myECouponViewHolder;
}
});
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public MyECouponViewHolder(View view, boolean z, InterfaceC12072erM interfaceC12072erM) {
super(view);
C14957gcv.e(view, "");
C14957gcv.e(interfaceC12072erM, "");
this.a = view;
this.b = z;
this.c = interfaceC12072erM;
this.e = new SimpleDateFormat("mm:ss", Locale.getDefault());
ButterKnife.c(this, view);
}
/* loaded from: classes5.dex */
public static final class HBt {
private HBt() {
}
public /* synthetic */ HBt(byte b) {
this();
}
}
/* loaded from: classes5.dex */
public static final class RVV extends CountDownTimer {
private MyECouponViewHolder d;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public RVV(long j, MyECouponViewHolder myECouponViewHolder) {
super(j, 1000L);
this.d = myECouponViewHolder;
}
@Override // android.os.CountDownTimer
public final void onTick(long j) {
MyECouponViewHolder myECouponViewHolder = this.d;
String format = myECouponViewHolder.e.format(Long.valueOf(j));
C14957gcv.c((Object) format, "");
MyECouponViewHolder.e(myECouponViewHolder, format);
}
@Override // android.os.CountDownTimer
public final void onFinish() {
MyECouponViewHolder.c(this.d);
}
}
public static SimpleDateFormat b() {
return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.getDefault());
}
public static String e() {
String format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.getDefault()).format(Calendar.getInstance().getTime());
C14957gcv.c((Object) format, "");
return format;
}
public static /* synthetic */ void d(MyECouponViewHolder myECouponViewHolder) {
C14957gcv.e(myECouponViewHolder, "");
CountDownTimer countDownTimer = myECouponViewHolder.d;
if (countDownTimer != null) {
countDownTimer.cancel();
}
myECouponViewHolder.d = null;
myECouponViewHolder.c.a(myECouponViewHolder.getLayoutPosition());
}
public static final /* synthetic */ void e(MyECouponViewHolder myECouponViewHolder, String str) {
TextView textView = myECouponViewHolder.tvExpire;
TextView textView2 = null;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
TextView textView3 = myECouponViewHolder.tvExpire;
if (textView3 == null) {
C14957gcv.a("");
textView3 = null;
}
textView.setTextColor(nMh.getColor(textView3.getContext(), R.color.f13662131100874));
TextView textView4 = myECouponViewHolder.tvExpire;
if (textView4 != null) {
textView2 = textView4;
} else {
C14957gcv.a("");
}
textView2.setText(myECouponViewHolder.a.getResources().getString(R.string.my_e_coupon_expire_min, str));
}
static {
new HBt((byte) 0);
}
}