package com.scb.phone.view.fragment.easycash; import android.content.Context; import android.content.Intent; import android.graphics.Point; import android.os.Bundle; import android.text.TextUtils; import android.view.Display; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import android.widget.LinearLayout; import android.widget.TextView; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import com.scb.phone.R; import com.scb.phone.view.custom.common.DefaultButton; import com.scb.phone.view.fragment.easycash.TakePhotoFragment; import java.util.Objects; import o.AbstractC13175fSw; import o.C12891fKc; import o.C1924aSU; import o.InterfaceC13391fZD; import o.InterfaceC8947daU; import o.ZI; import o.aSK; import o.fSJ; import o.fSQ; /* loaded from: classes5.dex */ public class TakePhotoFragment extends Hilt_TakePhotoFragment implements InterfaceC8947daU { private fSJ d; @BindView TextView infoNoPhoto; private RVV j; @BindView LinearLayout linearAttached; @BindView LinearLayout linearAttaching; @BindView LinearLayout linearNoAttached; @BindView DefaultButton retakeButton; @InterfaceC13391fZD public aSK takePhotoPresenter; /* loaded from: classes5.dex */ public interface RVV { void e(String str); } @Override // androidx.fragment.app.Fragment public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { View inflate = layoutInflater.inflate(R.layout.2131559948, viewGroup, false); ButterKnife.c(this, inflate); this.takePhotoPresenter.e((aSK) this); aSK ask = this.takePhotoPresenter; ZI.IeS ieS = new ZI.IeS() { // from class: o.aSR @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8947daU) obj).d(true, false, false, false); } }; if (ask.f != 0) { ieS.e(ask.f); } return inflate; } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onDestroy() { super.onDestroy(); this.takePhotoPresenter.w_(); fSJ fsj = this.d; if (fsj != null) { fsj.dispose(); } } @Override // o.InterfaceC8947daU public final void d(boolean z, boolean z2, boolean z3, boolean z4) { this.infoNoPhoto.setVisibility(z ? 0 : 8); this.linearAttaching.setVisibility(z2 ? 0 : 8); this.linearAttached.setVisibility(z3 ? 0 : 8); this.linearNoAttached.setVisibility(z4 ? 0 : 8); } @Override // o.InterfaceC8947daU public final void b() { super.H(); } @Override // o.InterfaceC8947daU public final void c(boolean z) { if (z) { this.retakeButton.setText(getString(R.string.easycash_referral_product_retake_photo)); } else { this.retakeButton.setText(getString(R.string.easycash_referral_product_take_photo)); } } @Override // o.InterfaceC8947daU public final void a(String str) { RVV rvv = this.j; if (rvv != null) { rvv.e(str); } } @Override // o.InterfaceC8947daU public final void a(String str, int i) { AbstractC13175fSw e = C12891fKc.e(str, i); final aSK ask = this.takePhotoPresenter; Objects.requireNonNull(ask); fSQ fsq = new fSQ(ask) { // from class: o.eUk private aSK b; @Override // o.fSQ public final void c(Object obj) { TakePhotoFragment.c(this.b, (String) obj); } { this.b = ask; } }; final aSK ask2 = this.takePhotoPresenter; Objects.requireNonNull(ask2); this.d = e.b(fsq, new fSQ(ask2) { // from class: o.eUl private aSK a; @Override // o.fSQ public final void c(Object obj) { TakePhotoFragment.c(this.a); } { this.a = ask2; } }); } @Override // com.scb.phone.view.fragment.easycash.BaseTakePhotoFragment, com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onActivityResult(int i, int i2, Intent intent) { super.onActivityResult(i, i2, intent); aSK ask = this.takePhotoPresenter; ZI.IeS ieS = new ZI.IeS() { // from class: o.aSP @Override // o.ZI.IeS public final void e(Object obj) { aSK.c((InterfaceC8947daU) obj); } }; if (ask.f != 0) { ieS.e(ask.f); } if (i == 10003) { if (i2 == -1 && getContext() != null) { d(); return; } if (i2 != 0) { aSK ask2 = this.takePhotoPresenter; ask2.a = false; C1924aSU c1924aSU = new C1924aSU(); if (ask2.f != 0) { c1924aSU.e(ask2.f); return; } return; } aSK ask3 = this.takePhotoPresenter; ZI.IeS ieS2 = new ZI.IeS() { // from class: o.aSL @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8947daU) obj).aq_(); } }; if (ask3.f != 0) { ieS2.e(ask3.f); } if (ask3.a) { ZI.IeS ieS3 = new ZI.IeS() { // from class: o.aSN @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8947daU) obj).d(false, false, true, false); } }; if (ask3.f != 0) { ieS3.e(ask3.f); return; } return; } ZI.IeS ieS4 = new ZI.IeS() { // from class: o.aSO @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8947daU) obj).d(true, false, false, false); } }; if (ask3.f != 0) { ieS4.e(ask3.f); } } } /* JADX WARN: Multi-variable type inference failed */ @Override // com.scb.phone.view.fragment.easycash.Hilt_TakePhotoFragment, com.scb.phone.view.fragment.etb.BreadcrumbFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment public void onAttach(Context context) { super.onAttach(context); if (context instanceof RVV) { this.j = (RVV) context; } else if (getParentFragment() instanceof RVV) { this.j = (RVV) getParentFragment(); } } @Override // com.scb.phone.view.fragment.easycash.BaseTakePhotoFragment, com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onActivityCreated(Bundle bundle) { super.onActivityCreated(bundle); if (bundle != null) { d(); } } private void d() { if (!TextUtils.isEmpty(((BaseTakePhotoFragment) this).c)) { WindowManager windowManager = (WindowManager) getContext().getSystemService("window"); if (windowManager != null) { Display defaultDisplay = windowManager.getDefaultDisplay(); Point point = new Point(); defaultDisplay.getSize(point); int i = point.x; int i2 = point.y; aSK ask = this.takePhotoPresenter; final String str = ((BaseTakePhotoFragment) this).c; final int min = Math.min(i, i2); ZI.IeS ieS = new ZI.IeS(str, min) { // from class: o.aSM private String a; private int c; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8947daU) obj).a(this.a, this.c); } { this.a = str; this.c = min; } }; if (ask.f != 0) { ieS.e(ask.f); return; } return; } return; } aSK ask2 = this.takePhotoPresenter; ask2.a = false; C1924aSU c1924aSU = new C1924aSU(); if (ask2.f != 0) { c1924aSU.e(ask2.f); } } public static /* synthetic */ void c(aSK ask) { ask.a = false; ZI.IeS ieS = new ZI.IeS() { // from class: o.aSJ @Override // o.ZI.IeS public final void e(Object obj) { aSK.e((InterfaceC8947daU) obj); } }; if (ask.f != 0) { ieS.e(ask.f); } } public static /* synthetic */ void c(aSK ask, final String str) { ask.a = true; ZI.IeS ieS = new ZI.IeS(str) { // from class: o.aST private String b; @Override // o.ZI.IeS public final void e(Object obj) { aSK.b(this.b, (InterfaceC8947daU) obj); } { this.b = str; } }; if (ask.f != 0) { ieS.e(ask.f); } } @OnClick public void onRetakePhotoClick() { aSK ask = this.takePhotoPresenter; ZI.IeS ieS = new ZI.IeS() { // from class: o.aSV @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC8947daU) obj).b(); } }; if (ask.f != 0) { ieS.e(ask.f); } } }