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

244 lines
10 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.requesttopay;
import android.animation.Animator;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.huawei.hms.support.api.entity.auth.AuthCode;
import com.scb.phone.R;
import com.scb.phone.view.activity.ebillsubscription.EBillSubscriptionActivity;
import com.scb.phone.view.activity.profilemanagement.promptpay.PromptPayTermsAndConditionsLandingActivity;
import com.scb.phone.view.activity.promptpay.PromptPayQRActivity;
import com.scb.phone.view.activity.requesttopay.RequestToPayActivity;
import com.scb.phone.view.custom.common.DefaultButton;
import com.scb.phone.view.fragment.requesttopay.RequirePromptPayFragment;
import o.C10457eEr;
import o.C12891fKc;
import o.C4652beH;
import o.C5968cEl;
import o.C5969cEm;
import o.C7882cwi;
import o.InterfaceC13391fZD;
import o.InterfaceC8929daC;
import o.bSS;
import o.dCK;
import o.fSJ;
import o.fSQ;
import o.glR;
/* loaded from: classes5.dex */
public class RequirePromptPayFragment extends Hilt_RequirePromptPayFragment implements InterfaceC8929daC.Sts, ViewTreeObserver.OnGlobalLayoutListener {
@BindView
DefaultButton buttonPromptPaySettings;
private Animator.AnimatorListener c;
private fSJ d;
@BindView
TextView descriptionTextView;
@InterfaceC13391fZD
public C5968cEl goManagePromptPayPresenter;
private dCK i;
private boolean j;
@BindView
ImageView mOverlayRequestMoneyTutorialImageView;
@BindView
RelativeLayout mRequestMoneyTutotrialContainer;
@BindView
RelativeLayout mRootView;
public static RequirePromptPayFragment e(boolean z, dCK dck) {
RequirePromptPayFragment requirePromptPayFragment = new RequirePromptPayFragment();
Bundle bundle = new Bundle();
bundle.putBoolean("BUNDLE_SHOW_TUTORIAL", z);
bundle.putString("BUNDLE_SOURCE_REQUEST_LANDING_TYPE", dck.b());
requirePromptPayFragment.setArguments(bundle);
return requirePromptPayFragment;
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559877, viewGroup, false);
ButterKnife.c(this, inflate);
IntentFilter intentFilter = new IntentFilter("com.scb.phone/BROADCAST_END_REQUEST_MONEY_TUTORIAL");
intentFilter.addAction("com.scb.phone/BROADCAST_END_EBILL_SUBSCRIPTION_TUTORIAL");
intentFilter.addAction("com.scb.phone/BROADCAST_END_PROMPTPAY_QR_TUTORIAL");
this.d = glR.Ge_(getActivity(), intentFilter).subscribe(new fSQ(this) { // from class: o.fzC
private RequirePromptPayFragment a;
@Override // o.fSQ
public final void c(Object obj) {
RequirePromptPayFragment.c(this.a);
}
{
this.a = this;
}
}, new fSQ() { // from class: o.fzA
@Override // o.fSQ
public final void c(Object obj) {
guQ.a((Throwable) obj);
}
});
this.mRootView.getViewTreeObserver().addOnGlobalLayoutListener(this);
this.goManagePromptPayPresenter.e((C5968cEl) this);
Bundle arguments = getArguments();
if (arguments != null) {
this.j = arguments.getBoolean("BUNDLE_SHOW_TUTORIAL", false);
this.i = dCK.c(arguments.getString("BUNDLE_SOURCE_REQUEST_LANDING_TYPE", dCK.REQUEST_MONEY.b()));
}
if (!this.j) {
this.mOverlayRequestMoneyTutorialImageView.setVisibility(8);
this.mRequestMoneyTutotrialContainer.setVisibility(8);
}
if (AnonymousClass2.c[this.i.ordinal()] == 1) {
this.buttonPromptPaySettings.setText(getString(R.string.manage_scb_promptpay));
this.descriptionTextView.setText(getString(R.string.promptpay_qr_prompt_pay_is_required_detail));
} else {
this.buttonPromptPaySettings.setText(getString(R.string.request_to_pay_settings));
this.descriptionTextView.setText(getString(R.string.request_to_pay_prompt_pay_is_required_detail_new));
}
this.c = new Animator.AnimatorListener(this) { // from class: com.scb.phone.view.fragment.requesttopay.RequirePromptPayFragment.3
private RequirePromptPayFragment c;
@Override // android.animation.Animator.AnimatorListener
public final void onAnimationCancel(Animator animator) {
}
@Override // android.animation.Animator.AnimatorListener
public final void onAnimationRepeat(Animator animator) {
}
@Override // android.animation.Animator.AnimatorListener
public final void onAnimationStart(Animator animator) {
}
{
this.c = this;
}
@Override // android.animation.Animator.AnimatorListener
public final void onAnimationEnd(Animator animator) {
RequirePromptPayFragment.a(this.c);
}
};
return inflate;
}
/* renamed from: com.scb.phone.view.fragment.requesttopay.RequirePromptPayFragment$2, reason: invalid class name */
/* loaded from: classes5.dex */
static /* synthetic */ class AnonymousClass2 {
static final int[] c;
static {
int[] iArr = new int[dCK.values().length];
c = iArr;
try {
iArr[dCK.PROMPTPAY_QR.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
c[dCK.EBILL_SUBSCRIPTION.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
c[dCK.REQUEST_MONEY.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
}
}
@Override // o.InterfaceC8929daC.Sts
public final void d() {
startActivityForResult(PromptPayTermsAndConditionsLandingActivity.alb_(getContext()), AuthCode.StatusCode.AUTH_INFO_NOT_EXIST);
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onActivityResult(int i, int i2, Intent intent) {
PromptPayQRActivity promptPayQRActivity;
C7882cwi c7882cwi;
if (i == 6002) {
if (this.i == dCK.REQUEST_MONEY && (getActivity() instanceof RequestToPayActivity)) {
bSS bss = ((RequestToPayActivity) getActivity()).moneyActionPresenter;
if (bss != null) {
bss.b();
}
} else if (this.i == dCK.EBILL_SUBSCRIPTION && (getActivity() instanceof EBillSubscriptionActivity)) {
EBillSubscriptionActivity eBillSubscriptionActivity = (EBillSubscriptionActivity) getActivity();
C4652beH c4652beH = eBillSubscriptionActivity.eBillSubscriptionPresenter;
if (c4652beH != null) {
c4652beH.b();
eBillSubscriptionActivity.eBillSubscriptionPresenter.a();
}
} else if (this.i == dCK.PROMPTPAY_QR && (getActivity() instanceof PromptPayQRActivity) && (c7882cwi = (promptPayQRActivity = (PromptPayQRActivity) getActivity()).promptPayQRPresenter) != null) {
c7882cwi.d();
promptPayQRActivity.promptPayQRPresenter.a();
}
}
super.onActivityResult(i, i2, intent);
}
/* JADX INFO: Access modifiers changed from: package-private */
@OnClick
public void onTutorialClicked() {
this.mOverlayRequestMoneyTutorialImageView.setVisibility(8);
this.mRequestMoneyTutotrialContainer.setVisibility(8);
C10457eEr.aqd_(this, new Intent("com.scb.phone/BROADCAST_END_REQUEST_MONEY_TUTORIAL"));
}
@Override // android.view.ViewTreeObserver.OnGlobalLayoutListener
public void onGlobalLayout() {
this.mRootView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
if (this.j) {
C12891fKc.azJ_(getContext(), this.mRootView, this.mOverlayRequestMoneyTutorialImageView);
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.mOverlayRequestMoneyTutorialImageView.getLayoutParams();
((ViewGroup.LayoutParams) layoutParams).width = this.mRootView.getWidth();
this.mOverlayRequestMoneyTutorialImageView.setLayoutParams(layoutParams);
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
fSJ fsj = this.d;
if (fsj != null && !fsj.isDisposed()) {
this.d.dispose();
}
super.onDestroy();
}
public static /* synthetic */ void c(RequirePromptPayFragment requirePromptPayFragment) {
requirePromptPayFragment.mOverlayRequestMoneyTutorialImageView.animate().setDuration(300L).alpha(BitmapDescriptorFactory.HUE_RED).setListener(requirePromptPayFragment.c);
requirePromptPayFragment.mRequestMoneyTutotrialContainer.animate().setDuration(300L).alpha(BitmapDescriptorFactory.HUE_RED).setListener(requirePromptPayFragment.c);
}
static /* synthetic */ void a(RequirePromptPayFragment requirePromptPayFragment) {
requirePromptPayFragment.mOverlayRequestMoneyTutorialImageView.setVisibility(8);
requirePromptPayFragment.mRequestMoneyTutotrialContainer.setVisibility(8);
}
/* JADX INFO: Access modifiers changed from: package-private */
@OnClick
public void onPromptPaySettingsClick() {
C5968cEl c5968cEl = this.goManagePromptPayPresenter;
C5969cEm c5969cEm = new C5969cEm();
if (c5968cEl.f != 0) {
c5969cEm.e(c5968cEl.f);
}
}
}