what-the-bank/sources/com/scb/phone/view/fragment/TermsConditionsFragment.java

248 lines
7.3 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import androidx.fragment.app.Fragment;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.scb.phone.R;
import com.scb.phone.view.custom.webview.SCBWebView;
import o.C0690Mh;
import o.C16903sI;
import o.C2352acw;
import o.C2353acx;
import o.InterfaceC13391fZD;
import o.InterfaceC9009dbd;
import o.JP;
import o.ZI;
import o.fJH;
import o.guQ;
/* loaded from: classes5.dex */
public class TermsConditionsFragment extends Hilt_TermsConditionsFragment implements InterfaceC9009dbd {
@BindView
Button buttonAccept;
@BindView
Button buttonDecline;
@BindView
LinearLayout buttonsLayout;
private fJH d;
@InterfaceC13391fZD
public C2353acx presenter;
@BindView
SCBWebView webView;
public static Fragment d(JP jp) {
Bundle bundle = new Bundle();
bundle.putParcelable("EASYCASH_TERMS_CONDITIONS", jp);
TermsConditionsFragment termsConditionsFragment = new TermsConditionsFragment();
termsConditionsFragment.setArguments(bundle);
return termsConditionsFragment;
}
@Override // androidx.fragment.app.Fragment
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
this.presenter.e((C2353acx) this);
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
super.onCreateView(layoutInflater, viewGroup, bundle);
View inflate = layoutInflater.inflate(R.layout.2131559430, viewGroup, false);
ButterKnife.c(this, inflate);
if (getArguments() != null && getArguments().getParcelable("EASYCASH_TERMS_CONDITIONS") != null) {
final JP jp = (JP) getArguments().getParcelable("EASYCASH_TERMS_CONDITIONS");
C2353acx c2353acx = this.presenter;
if (jp == null || jp.e == null) {
C2352acw c2352acw = new C2352acw();
if (c2353acx.f != 0) {
c2352acw.e(c2353acx.f);
}
} else {
if (jp.f != null) {
c2353acx.d = jp.f;
}
ZI.IeS ieS = new ZI.IeS(jp) { // from class: o.act
private JP b;
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9009dbd) obj).c(this.b.b);
}
{
this.b = jp;
}
};
if (c2353acx.f != 0) {
ieS.e(c2353acx.f);
}
ZI.IeS ieS2 = new ZI.IeS(jp) { // from class: o.acz
private JP b;
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9009dbd) obj).b(this.b);
}
{
this.b = jp;
}
};
if (c2353acx.f != 0) {
ieS2.e(c2353acx.f);
}
if (jp.b && jp.d) {
ZI.IeS ieS3 = new ZI.IeS(jp) { // from class: o.acB
private JP b;
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9009dbd) obj).c(this.b);
}
{
this.b = jp;
}
};
if (c2353acx.f != 0) {
ieS3.e(c2353acx.f);
}
}
}
}
return inflate;
}
@Override // o.InterfaceC9009dbd
public final void b() {
C2353acx c2353acx = this.presenter;
C0690Mh.IeS ieS = C0690Mh.IeS.NAVIGATE_BACK;
C16903sI c16903sI = c2353acx.j;
c2353acx.d(c16903sI.c((String) null, c16903sI.e(R.string.error_generic_resource), ieS));
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.scb.phone.view.fragment.Hilt_TermsConditionsFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof fJH) {
this.d = (fJH) context;
} else {
guQ.e("LoanTermsCond").a(new ClassCastException("context isn't instanceof TermsConditionsCallback"), "onAttach: ", new Object[0]);
}
}
@Override // o.InterfaceC9009dbd
public final void c() {
fJH fjh = this.d;
if (fjh != null) {
fjh.h();
}
}
@Override // o.InterfaceC9009dbd
public final void a() {
fJH fjh = this.d;
if (fjh != null) {
fjh.g();
}
}
@Override // o.InterfaceC9009dbd
public final void c(boolean z) {
this.buttonsLayout.setVisibility(z ? 0 : 8);
}
@OnClick
public void acceptTermsConditions() {
final C2353acx c2353acx = this.presenter;
if (c2353acx.d != null) {
ZI.IeS ieS = new ZI.IeS(c2353acx) { // from class: o.acv
private C2353acx c;
@Override // o.ZI.IeS
public final void e(Object obj) {
C2353acx.c(this.c, (InterfaceC9009dbd) obj);
}
{
this.c = c2353acx;
}
};
if (c2353acx.f != 0) {
ieS.e(c2353acx.f);
return;
}
return;
}
C2352acw c2352acw = new C2352acw();
if (c2353acx.f != 0) {
c2352acw.e(c2353acx.f);
}
}
@OnClick
public void declineTermsConditions() {
final C2353acx c2353acx = this.presenter;
if (c2353acx.d != null) {
ZI.IeS ieS = new ZI.IeS(c2353acx) { // from class: o.acu
private C2353acx b;
@Override // o.ZI.IeS
public final void e(Object obj) {
C2353acx.b(this.b, (InterfaceC9009dbd) obj);
}
{
this.b = c2353acx;
}
};
if (c2353acx.f != 0) {
ieS.e(c2353acx.f);
return;
}
return;
}
C2352acw c2352acw = new C2352acw();
if (c2353acx.f != 0) {
c2352acw.e(c2353acx.f);
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroyView() {
super.onDestroyView();
this.presenter.w_();
}
@Override // o.InterfaceC9009dbd
public final void c(JP jp) {
this.buttonAccept.setText(jp.c);
this.buttonDecline.setText(jp.a);
}
@Override // o.InterfaceC9009dbd
public final void b(JP jp) {
String str = jp.e;
this.webView.setWebViewBackgroundColor(R.color.f14012131100909);
this.webView.b(str, d());
}
protected String d() {
return "css/consent_style.css";
}
}