what-the-bank/sources/com/scb/phone/view/custom/common/CustomAcceptDeclineButtons....

188 lines
5.6 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.custom.common;
import android.content.Context;
import android.content.res.Resources;
import android.text.method.LinkMovementMethod;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.scb.phone.R;
import o.C14866gag;
import o.C14957gcv;
import o.InterfaceC14890gbN;
import o.InterfaceC14894gbR;
import o.fKB;
/* loaded from: classes5.dex */
public final class CustomAcceptDeclineButtons extends LinearLayout {
private InterfaceC14894gbR<? super Boolean, C14866gag> b;
@BindView
public Button btAccept;
@BindView
public Button btDecline;
@BindView
public TextView tvLabel;
private /* synthetic */ CustomAcceptDeclineButtons(Context context, byte b) {
this(context, 0, 0);
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public CustomAcceptDeclineButtons(Context context, int i, int i2) {
super(context);
C14957gcv.e(context, "");
e(i, i2);
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public CustomAcceptDeclineButtons(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
C14957gcv.e(context, "");
C14957gcv.e(attributeSet, "");
e(0, 0);
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public CustomAcceptDeclineButtons(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
C14957gcv.e(context, "");
C14957gcv.e(attributeSet, "");
e(0, 0);
}
private final void e(int i, int i2) {
LayoutInflater.from(getContext()).inflate(R.layout.2131558890, (ViewGroup) this, true);
ButterKnife.c(this);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
layoutParams.setMargins(i, i2, i, i2);
setLayoutParams(layoutParams);
setOrientation(1);
}
public final void setHeaderText(String str, String str2, InterfaceC14890gbN<C14866gag> interfaceC14890gbN) {
C14957gcv.e(str, "");
C14957gcv.e(str2, "");
C14957gcv.e(interfaceC14890gbN, "");
TextView textView = this.tvLabel;
TextView textView2 = null;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
fKB fkb = fKB.d;
Resources resources = getResources();
C14957gcv.c(resources, "");
textView.setText(fKB.azW_(resources, str2, str, null, true, 0, interfaceC14890gbN, 104));
TextView textView3 = this.tvLabel;
if (textView3 != null) {
textView2 = textView3;
} else {
C14957gcv.a("");
}
textView2.setMovementMethod(LinkMovementMethod.getInstance());
}
public final void a(boolean z) {
Button button = this.btAccept;
Button button2 = null;
if (button == null) {
C14957gcv.a("");
button = null;
}
button.setSelected(z);
Button button3 = this.btDecline;
if (button3 != null) {
button2 = button3;
} else {
C14957gcv.a("");
}
button2.setSelected(!z);
InterfaceC14894gbR<? super Boolean, C14866gag> interfaceC14894gbR = this.b;
if (interfaceC14894gbR != null) {
interfaceC14894gbR.invoke(Boolean.valueOf(z));
}
}
@OnClick
public final void onAcceptClicked() {
a(true);
}
@OnClick
public final void onDeclineClicked() {
a(false);
}
public static /* synthetic */ void setText$default(CustomAcceptDeclineButtons customAcceptDeclineButtons, String str, String str2, String str3, int i, Object obj) {
if ((i & 1) != 0) {
str = null;
}
if ((i & 2) != 0) {
str2 = null;
}
if ((i & 4) != 0) {
str3 = null;
}
customAcceptDeclineButtons.setText(str, str2, str3);
}
public final void setText(String str, String str2, String str3) {
Button button = this.btAccept;
TextView textView = null;
if (button == null) {
C14957gcv.a("");
button = null;
}
button.setText(str);
Button button2 = this.btDecline;
if (button2 == null) {
C14957gcv.a("");
button2 = null;
}
button2.setText(str2);
if (str3 != null) {
TextView textView2 = this.tvLabel;
if (textView2 != null) {
textView = textView2;
} else {
C14957gcv.a("");
}
textView.setText(str3);
}
}
public final void setTvLabel(TextView textView) {
C14957gcv.e(textView, "");
this.tvLabel = textView;
}
public final void setOnButtonClickListener(InterfaceC14894gbR<? super Boolean, C14866gag> interfaceC14894gbR) {
this.b = interfaceC14894gbR;
}
public final void setBtDecline(Button button) {
C14957gcv.e(button, "");
this.btDecline = button;
}
public final void setBtAccept(Button button) {
C14957gcv.e(button, "");
this.btAccept = button;
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public CustomAcceptDeclineButtons(Context context) {
this(context, (byte) 0);
C14957gcv.e(context, "");
}
}