正在查看: Credmex v3.12.2 应用的 AutoRepayActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Credmex v3.12.2 应用的 AutoRepayActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.credmex.activity;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.util.Base64;
import android.view.View;
import android.widget.TextView;
import androidx.activity.result.ActivityResult;
import androidx.activity.result.ActivityResultCallback;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import butterknife.OnClick;
import com.bigkoo.pickerview.TimePickerView;
import com.bumptech.glide.request.RequestOptions;
import com.credmex.adapters.AutoRepayAdapter;
import com.credmex.adapters.AutoRepayAgreementAdapter;
import com.credmex.commom.ViewBindingActivity;
import com.credmex.databinding.ActivityAutoRepayBinding;
import com.credmex.helper.TrackBindCardChannelHelper;
import com.credmex.models.BankCardInfo;
import com.credmex.models.CashBooleanResponse;
import com.credmex.models.Credential;
import com.credmex.models.response.AutoRepayAgreementResponse;
import com.credmex.models.response.AutoRepayResponse;
import com.credmex.models.response.BankCardAdditionalInfoResponse;
import com.credmex.net.CredMexObserver;
import com.credmex.net.IApiRoutes;
import com.credmex.viewModel.AutoRepayActivityViewModel;
import com.credmex.widght.dialog.CommonDialog;
import com.credmex.widght.dialog.DialogButtonListener;
import com.credmex.widght.dialog.bottomDialog.AutoRepayBindCardConfirmDialog;
import com.credmex.widght.dialog.bottomDialog.LoanConfirmSelectBankcardBottomDialog;
import com.credmex.widght.dialog.bottomDialog.SupportBankBottomDialog;
import com.open.mx.ui.model.LabelBean;
import com.open.mx.ui.utils.PickViewHelper;
import com.open.mx.ui.views.timepick.TimePickerViewNewStyle;
import com.open.mx.ui.weights.SinglePickDialog.SinglePickAdapter;
import com.open.mx.ui.weights.SinglePickDialog.SinglePickDialog;
import com.open.mx.ui.weights.dialog.CommonBottomSheetDialog;
import com.open.mx.ui.weights.dialog.FullScreenDialog;
import com.open.mxbaselib.util.EncryptionUtil;
import com.veda.android.bananalibrary.infrastructure.BaseActivity;
import com.veda.android.imageloaderlib.IImageLoaderOptions;
import com.veda.android.imageloaderlib.Imager;
import com.veda.supertoolkit.activity.MxActivity;
import com.veda.supertoolkit.customtools.CollectionUtils;
import com.veda.supertoolkit.customtools.Logger;
import com.veda.supertoolkit.formattools.DateFormatUtil;
import com.veda.supertoolkit.lifecycle.LifecycleEvent;
import com.veda.supertoolkit.resourcetools.SharedPreferenceUtils;
import com.veda.supertoolkit.utils.ViewUtil;
import com.veda.supertoolkit.widgets.BaseUtils;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.sentry.ITransaction;
import io.sentry.Sentry;
import io.sentry.SpanStatus;
import io.sentry.android.core.SentryLogcatAdapter;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import mx.openpay.android.Openpay;
import mx.openpay.android.OperationCallBack;
import mx.openpay.android.OperationResult;
import mx.openpay.android.exceptions.OpenpayServiceException;
import mx.openpay.android.exceptions.ServiceUnavailableException;
import mx.openpay.android.model.Token;
public class AutoRepayActivity extends ViewBindingActivity {
public static final String IS_FROM_REPAY = "IS_FROM_REPAY";
private ActivityAutoRepayBinding D;
private AutoRepayActivityViewModel E;
private ActivityResultLauncher<Intent> F;
private AutoRepayAdapter G;
private AutoRepayAdapter H;
private AutoRepayAgreementAdapter I;
private LoanConfirmSelectBankcardBottomDialog J;
private AutoRepayBindCardConfirmDialog K;
private SupportBankBottomDialog R;
public void A0() {
Intent intent = new Intent((Context) this, (Class<?>) BindNewBankcardActivity.class);
intent.putExtra(BindNewBankcardActivity.CHANNEL, "REPAY");
this.F.launch(intent);
}
private void B0() {
this.F = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback() {
public final void onActivityResult(Object obj) {
AutoRepayActivity.this.E0((ActivityResult) obj);
}
});
}
public void C0(@NonNull final AutoRepayAgreementResponse autoRepayAgreementResponse) {
showLoadingDialog();
this.E.d();
AutoRepayAgreementResponse.ExtraInfo extraInfo = autoRepayAgreementResponse.body.extraInfo;
if (extraInfo == null || TextUtils.isEmpty(extraInfo.cardNumber) || TextUtils.isEmpty(extraInfo.openpayMerchantId) || TextUtils.isEmpty(extraInfo.openpayPublicKey)) {
showErrorToast(2131821077);
return;
}
String a = EncryptionUtil.a(getPackageName(), extraInfo.openpayMerchantId, "");
String a2 = EncryptionUtil.a(getPackageName(), extraInfo.openpayPublicKey, "");
String a3 = EncryptionUtil.a(getPackageName(), extraInfo.cardNumber, "");
final ITransaction D = Sentry.D("initOpenPay", "sdk.openpay");
try {
Openpay openpay = new Openpay(a, a2, Boolean.TRUE);
this.E.L(openpay.getDeviceCollectorDefaultImpl().setup(this));
openpay.createToken(this.E.s(a3), new OperationCallBack<Token>() {
public void onCommunicationError(ServiceUnavailableException serviceUnavailableException) {
SentryLogcatAdapter.d("openpay helene", "helene OperationCallBack : onCommunicationError" + ((BaseActivity) AutoRepayActivity.this).gson.t(serviceUnavailableException));
D.a("error_type", "ServiceUnavailableException");
D.a("error_reason", ((BaseActivity) AutoRepayActivity.this).gson.t(serviceUnavailableException));
D.n(SpanStatus.UNKNOWN_ERROR);
AutoRepayActivity.this.showErrorToast(2131821077);
AutoRepayActivity.this.dismissLoadingDialog();
}
public void onError(OpenpayServiceException openpayServiceException) {
SentryLogcatAdapter.d("openpay helene", "helene OperationCallBack : OpenpayServiceException :" + ((BaseActivity) AutoRepayActivity.this).gson.t(openpayServiceException));
D.a("error_type", "OpenpayServiceException");
D.a("error_code", openpayServiceException.errorCode + "");
D.a("error_reason", ((BaseActivity) AutoRepayActivity.this).gson.t(openpayServiceException));
D.n(SpanStatus.UNKNOWN_ERROR);
AutoRepayActivity.this.showErrorToast(2131821077);
AutoRepayActivity.this.dismissLoadingDialog();
}
public void onSuccess(OperationResult<Token> operationResult) {
String id = ((Token) operationResult.getResult()).getId();
SentryLogcatAdapter.d("openpay helene", "helene OperationCallBack : onSuccess " + id);
AutoRepayActivity.this.E.M(id);
AutoRepayActivity.this.Z0(autoRepayAgreementResponse.body.channel);
D.n(SpanStatus.OK);
AutoRepayActivity.this.dismissLoadingDialog();
}
});
} catch (Exception e) {
L0(D, e, null);
e.printStackTrace();
}
}
private void D0() {
((BaseActivity) this).f.setBackgroundColor(0);
((BaseActivity) this).a.setImageResource(2131231041);
}
public void E0(ActivityResult activityResult) {
Intent data;
if (activityResult.getResultCode() == 2001 && (data = activityResult.getData()) != null) {
W0((BankCardInfo) data.getSerializableExtra(BindNewBankcardActivity.BIND_CARD_INFO));
}
}
public static void F0(AutoRepayResponse.AutoRepayConfig autoRepayConfig, MxActivity mxActivity, FullScreenDialog fullScreenDialog, View view, TimePickerViewNewStyle timePickerViewNewStyle) {
timePickerViewNewStyle.x(false);
Calendar calendar = Calendar.getInstance();
int i2 = calendar.get(1);
calendar.add(1, 20);
timePickerViewNewStyle.z(i2, calendar.get(1));
Date time = calendar.getTime();
if (TextUtils.isEmpty(autoRepayConfig.value)) {
timePickerViewNewStyle.B(time);
} else {
timePickerViewNewStyle.B(DateFormatUtil.b(autoRepayConfig.value, DateFormatUtil.a));
}
timePickerViewNewStyle.C(autoRepayConfig.title);
}
public void G0(AutoRepayResponse.AutoRepayConfig autoRepayConfig, boolean z, View view, LabelBean labelBean) {
this.E.G(autoRepayConfig.key, labelBean, z);
if (view instanceof TextView) {
((TextView) view).setText(labelBean.label);
}
this.D.c.setEnabled(z0());
}
public static RequestOptions H0(RequestOptions requestOptions) {
return requestOptions.fallback(2131230972).placeholder(2131230972).error(2131230972).fitCenter();
}
public void J0(final String str) {
AutoRepayBindCardConfirmDialog autoRepayBindCardConfirmDialog = this.K;
if (autoRepayBindCardConfirmDialog == null) {
this.K = new AutoRepayBindCardConfirmDialog(this, this.E.p(), this.E.y(), new AutoRepayBindCardConfirmDialog.OnConfirmListener() {
@Override
public final void a() {
AutoRepayActivity.this.I0(str);
}
});
} else {
autoRepayBindCardConfirmDialog.l(this.E.p());
}
this.K.show();
}
public void K0(Dialog dialog) {
dialog.dismiss();
X0();
}
private void L0(@NonNull ITransaction iTransaction, Exception exc, String str) {
dismissLoadingDialog();
showErrorToast(2131821077);
if (exc != null) {
Logger.c().b("helene getOpenPayToken Exception " + ((BaseActivity) this).gson.t(exc));
iTransaction.a("error_type", "ServiceError");
iTransaction.a("error_reason", ((BaseActivity) this).gson.t(exc));
} else if (!TextUtils.isEmpty(str)) {
iTransaction.a("error_type", "BusinessError");
try {
Logger.c().b("helene getOpenPayToken Request failed:" + str);
iTransaction.a("error_reason", str);
} catch (Exception e) {
e.printStackTrace();
}
}
iTransaction.n(SpanStatus.UNKNOWN_ERROR);
}
public void M0(Credential credential) {
if (credential.isAvailable()) {
CommonBottomSheetDialog commonBottomSheetDialog = this.J;
if (commonBottomSheetDialog != null && commonBottomSheetDialog.isShowing()) {
this.J.dismiss();
}
this.E.N(credential);
S0();
P0();
this.D.c.setEnabled(z0());
}
}
public void N0(final View view, final AutoRepayResponse.AutoRepayConfig autoRepayConfig, final boolean z) {
PickViewHelper.m(this, "R.id.tv_date", new PickViewHelper.TimeSelectionCallBack() {
public void b(View view2, Date date) {
AutoRepayActivity.this.onItemSelector(view, autoRepayConfig, date, z);
}
public void onCancel() {
}
}, new FullScreenDialog.IFullScreenDialogInitCallBack() {
public final void a(MxActivity mxActivity, FullScreenDialog fullScreenDialog, View view2, Object obj) {
AutoRepayActivity.F0(AutoRepayResponse.AutoRepayConfig.this, mxActivity, fullScreenDialog, view2, (TimePickerViewNewStyle) obj);
}
}, TimePickerView.Type.e).show();
}
public void O0(final View view, final AutoRepayResponse.AutoRepayConfig autoRepayConfig, final boolean z) {
new SinglePickDialog(this).l(autoRepayConfig.title).k(autoRepayConfig.options).m(autoRepayConfig.key).i(new SinglePickAdapter.SinglePickListener() {
public final void a(LabelBean labelBean) {
AutoRepayActivity.this.G0(autoRepayConfig, z, view, labelBean);
}
}).j(this.E.A(autoRepayConfig.key)).show();
}
private void P0() {
if (this.H == null) {
AutoRepayAdapter autoRepayAdapter = new AutoRepayAdapter(this, this.E.B(), true);
this.H = autoRepayAdapter;
autoRepayAdapter.d(new AutoRepayAdapter.AutoRepayListener() {
@Override
public void a(View view, AutoRepayResponse.AutoRepayConfig autoRepayConfig, boolean z) {
AutoRepayActivity.this.O0(view, autoRepayConfig, z);
}
@Override
public void b(View view, AutoRepayResponse.AutoRepayConfig autoRepayConfig, Editable editable, boolean z) {
AutoRepayActivity.this.E.H(autoRepayConfig.key, editable.toString().trim(), z);
AutoRepayActivity.this.D.c.setEnabled(AutoRepayActivity.this.z0());
}
@Override
public void c(View view, AutoRepayResponse.AutoRepayConfig autoRepayConfig, boolean z) {
AutoRepayActivity.this.N0(view, autoRepayConfig, z);
}
});
this.D.f45l.setFocusable(false);
this.D.f45l.setNestedScrollingEnabled(false);
this.D.f45l.setLayoutManager(new LinearLayoutManager(this));
this.D.f45l.setHasFixedSize(true);
this.D.f45l.setItemAnimator(new DefaultItemAnimator());
this.D.f45l.setAdapter(this.H);
}
this.H.a(this.E.B(), this.E.f());
}
private void Q0() {
if (this.I == null) {
this.I = new AutoRepayAgreementAdapter();
this.D.f46m.setFocusable(false);
this.D.f46m.setNestedScrollingEnabled(false);
this.D.f46m.setLayoutManager(new LinearLayoutManager(this));
this.D.f46m.setHasFixedSize(true);
this.D.f46m.setItemAnimator(new DefaultItemAnimator());
this.D.f46m.setAdapter(this.I);
}
this.I.a(this.E.i());
}
private void R0() {
if (this.G == null) {
AutoRepayAdapter autoRepayAdapter = new AutoRepayAdapter(this, this.E.B(), false);
this.G = autoRepayAdapter;
autoRepayAdapter.d(new AutoRepayAdapter.AutoRepayListener() {
@Override
public void a(View view, AutoRepayResponse.AutoRepayConfig autoRepayConfig, boolean z) {
AutoRepayActivity.this.O0(view, autoRepayConfig, z);
}
@Override
public void b(View view, AutoRepayResponse.AutoRepayConfig autoRepayConfig, Editable editable, boolean z) {
AutoRepayActivity.this.E.H(autoRepayConfig.key, editable.toString().trim(), z);
AutoRepayActivity.this.D.c.setEnabled(AutoRepayActivity.this.z0());
}
@Override
public void c(View view, AutoRepayResponse.AutoRepayConfig autoRepayConfig, boolean z) {
AutoRepayActivity.this.N0(view, autoRepayConfig, z);
}
});
this.D.f47n.setFocusable(false);
this.D.f47n.setNestedScrollingEnabled(false);
this.D.f47n.setLayoutManager(new LinearLayoutManager(this));
this.D.f47n.setHasFixedSize(true);
this.D.f47n.setItemAnimator(new DefaultItemAnimator());
this.D.f47n.setAdapter(this.G);
}
this.G.a(this.E.B(), this.E.m());
}
private void S0() {
Credential z = this.E.z();
if (z == null) {
this.D.b.f.setVisibility(this.E.F() ? 0 : 8);
return;
}
Imager.a().e(this, z.bankLogoUrl, this.D.b.b, new IImageLoaderOptions() {
public final Object a(Object obj) {
RequestOptions H0;
H0 = AutoRepayActivity.H0((RequestOptions) obj);
return H0;
}
});
this.D.b.b.setAlpha(z.isAvailable() ? 1.0f : 0.5f);
this.D.b.f.setVisibility(this.E.F() ? 0 : 8);
this.D.b.d.setText(getString(2131820615, z.accountNumber));
this.D.b.d.setTextColor(getResources().getColor(z.isAvailable() ? 2131099723 : 2131099726));
this.D.b.e.setText(z.disableReason);
this.D.b.e.setVisibility(TextUtils.isEmpty(z.disableReason) ? 8 : 0);
ViewUtil.e(this.D.b.g, CollectionUtils.a(this.E.f()) ? (int) getContext().getResources().getDimension(2131165504) : 0);
}
public void I0(String str) {
showLoadingDialog();
HashMap hashMap = new HashMap();
hashMap.put("channel", str);
hashMap.put("agreementId", this.E.h());
hashMap.put("deviceSessionId", this.E.w());
hashMap.put("tokenId", this.E.x());
AutoRepayActivityViewModel autoRepayActivityViewModel = this.E;
hashMap.putAll(autoRepayActivityViewModel.t(autoRepayActivityViewModel.e()));
((IApiRoutes) this.apiHelper.a()).f(hashMap).a(new CredMexObserver<CashBooleanResponse>(this) {
public void onSuccess(CashBooleanResponse cashBooleanResponse) {
AutoRepayActivity.this.dismissLoadingDialog();
if (AutoRepayActivity.this.K != null) {
AutoRepayActivity.this.K.dismiss();
}
AutoRepayActivity.this.V0();
}
});
}
private void U0() {
showLoadingDialog();
((IApiRoutes) this.apiHelper.a()).R(this.E.l()).a(new CredMexObserver<AutoRepayAgreementResponse>(this) {
public void onSuccess(AutoRepayAgreementResponse autoRepayAgreementResponse) {
AutoRepayActivity.this.dismissLoadingDialog();
AutoRepayActivity.this.E.I(autoRepayAgreementResponse.body);
if (TextUtils.equals(autoRepayAgreementResponse.body.channel, AutoRepayAgreementResponse.AutoPayChannel.OPENPAY)) {
AutoRepayActivity.this.C0(autoRepayAgreementResponse);
} else {
AutoRepayActivity.this.Z0(autoRepayAgreementResponse.body.channel);
}
}
});
}
public void V0() {
showLoadingDialog();
((IApiRoutes) this.apiHelper.a()).k0().t(AndroidSchedulers.a()).a(new CredMexObserver<AutoRepayResponse>(this) {
@Override
public void onError(Throwable th, AutoRepayResponse autoRepayResponse) {
super.onError(th, (Throwable) autoRepayResponse);
AutoRepayActivity.this.b1();
AutoRepayActivity.this.reportFullyDisplayed();
}
public void onSuccess(@NonNull AutoRepayResponse autoRepayResponse) {
AutoRepayActivity.this.dismissLoadingDialog();
AutoRepayActivity.this.E.J(autoRepayResponse.body);
AutoRepayActivity.this.f1();
AutoRepayActivity.this.a1();
AutoRepayActivity.this.reportFullyDisplayed();
}
});
}
private void W0(final BankCardInfo bankCardInfo) {
if (bankCardInfo == null) {
return;
}
showLoadingDialog();
((IApiRoutes) this.apiHelper.a()).L(bankCardInfo.paymentMethod, bankCardInfo.credentialId).t(AndroidSchedulers.a()).a(new CredMexObserver<BankCardAdditionalInfoResponse>(this) {
@Override
public void onError(Throwable th, BankCardAdditionalInfoResponse bankCardAdditionalInfoResponse) {
super.onError(th, (Throwable) bankCardAdditionalInfoResponse);
AutoRepayActivity.this.x0(bankCardInfo, null);
}
public void onSuccess(@NonNull BankCardAdditionalInfoResponse bankCardAdditionalInfoResponse) {
AutoRepayActivity.this.dismissLoadingDialog();
AutoRepayActivity.this.x0(bankCardInfo, bankCardAdditionalInfoResponse.body.fields);
}
});
}
private void X0() {
showLoadingDialog();
((IApiRoutes) this.apiHelper.a()).K().a(new CredMexObserver<CashBooleanResponse>(this) {
public void onSuccess(CashBooleanResponse cashBooleanResponse) {
AutoRepayActivity.this.dismissLoadingDialog();
AutoRepayActivity.this.V0();
}
});
}
private void Y0() {
CommonDialog.CommonDialogBuilder.c(this).q("dialog_auto_repay_agreement").m(2131820685, new b()).d(1).p(this.E.j()).j(this.E.g()).a().show();
}
public void Z0(final String str) {
runOnUiThread(new Runnable() {
@Override
public final void run() {
AutoRepayActivity.this.J0(str);
}
});
}
public void a1() {
this.D.e.c.setVisibility(8);
this.D.f44k.setVisibility(0);
this.D.f49p.setText(this.E.j());
Q0();
R0();
S0();
P0();
y0();
this.D.c.setEnabled(z0());
}
public void b1() {
this.D.e.c.setVisibility(0);
this.D.f44k.setVisibility(8);
this.D.c.setVisibility(8);
this.D.f42i.setVisibility(8);
}
private void c1() {
List<Credential> n2 = this.E.n();
LoanConfirmSelectBankcardBottomDialog loanConfirmSelectBankcardBottomDialog = this.J;
if (loanConfirmSelectBankcardBottomDialog != null) {
loanConfirmSelectBankcardBottomDialog.dismiss();
}
LoanConfirmSelectBankcardBottomDialog m2 = new LoanConfirmSelectBankcardBottomDialog(this, n2, this.E.z()).n(new LoanConfirmSelectBankcardBottomDialog.OnBankcardSelectedListener() {
@Override
public final void a(Credential credential) {
AutoRepayActivity.this.M0(credential);
}
}).m(new LoanConfirmSelectBankcardBottomDialog.OnAddBankcardClickListener() {
@Override
public final void a() {
AutoRepayActivity.this.A0();
}
});
this.J = m2;
m2.show();
TrackBindCardChannelHelper.b(this, "REPAY");
}
private void d1() {
SupportBankBottomDialog supportBankBottomDialog = this.R;
if (supportBankBottomDialog == null) {
this.R = new SupportBankBottomDialog(this, this.E.C());
} else {
supportBankBottomDialog.h(this.E.C());
}
this.R.show();
}
private void e1() {
CommonDialog.CommonDialogBuilder.c(this).q("dialog_auto_repay_unbind").m(2131820739, new DialogButtonListener() {
@Override
public final void a(Dialog dialog) {
AutoRepayActivity.this.K0(dialog);
}
}).k(2131820641, new b()).d(2).p(this.E.E()).j(this.E.D()).a().show();
}
public void f1() {
if (this.userSession.d() == null) {
return;
}
String str = Base64.encodeToString(this.userSession.d().getMobileNumber().getBytes(), 0) + "auto_repay_have_show_agreement";
if (SharedPreferenceUtils.b(this, str, false)) {
return;
}
Y0();
SharedPreferenceUtils.h(this, str, true);
}
public static void startAutoRepayActivity(Activity activity, @Nullable String str) {
Intent intent = new Intent(activity, (Class<?>) AutoRepayActivity.class);
intent.putExtra(IS_FROM_REPAY, !TextUtils.isEmpty(str));
activity.startActivity(intent);
}
public void x0(BankCardInfo bankCardInfo, ArrayList<AutoRepayResponse.AutoRepayConfig> arrayList) {
this.E.a(bankCardInfo, arrayList);
S0();
P0();
this.D.c.setEnabled(z0());
}
private void y0() {
char c;
String B = this.E.B();
int hashCode = B.hashCode();
if (hashCode == -1787415978) {
if (B.equals(AutoRepayResponse.AutoRepayStatus.UNBIND)) {
c = 2;
}
c = 65535;
} else if (hashCode != 609761893) {
if (hashCode == 1959332252 && B.equals(AutoRepayResponse.AutoRepayStatus.BINDED)) {
c = 0;
}
c = 65535;
} else {
if (B.equals(AutoRepayResponse.AutoRepayStatus.BINDING)) {
c = 1;
}
c = 65535;
}
if (c == 0) {
this.D.c.setVisibility(8);
this.D.f42i.setVisibility(0);
this.D.d.setVisibility(0);
this.D.f43j.setVisibility(8);
this.D.f51r.setText(this.E.r());
this.D.f50q.setText(this.E.q());
return;
}
if (c != 1) {
this.D.c.setVisibility(0);
this.D.f42i.setVisibility(8);
this.D.d.setVisibility(8);
this.D.f43j.setVisibility(8);
return;
}
this.D.c.setVisibility(8);
this.D.f42i.setVisibility(8);
this.D.d.setVisibility(8);
this.D.f43j.setVisibility(0);
this.D.f53t.setText(this.E.r());
this.D.f52s.setText(this.E.q());
}
@Override
protected void D() {
super.D();
V0();
}
@Override
protected void G(@NonNull Bundle bundle) {
super.G(bundle);
this.E.K(bundle.getBoolean(IS_FROM_REPAY, false));
}
@Override
protected void K() {
super.K();
B0();
D0();
}
@Override
protected void X(@NonNull Bundle bundle) {
super.X(bundle);
bundle.putBoolean(IS_FROM_REPAY, this.E.v());
}
@Override
public View getContentView() {
ActivityAutoRepayBinding c = ActivityAutoRepayBinding.c(getLayoutInflater());
this.D = c;
return c.getRoot();
}
public void onBackPressed() {
if (this.E.v()) {
jumpToMainPage();
} else {
super/*androidx.activity.ComponentActivity*/.onBackPressed();
}
}
@Override
protected void onCreate(Bundle bundle) {
this.E = (AutoRepayActivityViewModel) new ViewModelProvider(this).get(AutoRepayActivityViewModel.class);
super.onCreate(bundle);
}
@Override
public void onDestroy() {
LoanConfirmSelectBankcardBottomDialog loanConfirmSelectBankcardBottomDialog = this.J;
if (loanConfirmSelectBankcardBottomDialog != null) {
loanConfirmSelectBankcardBottomDialog.dismiss();
}
AutoRepayBindCardConfirmDialog autoRepayBindCardConfirmDialog = this.K;
if (autoRepayBindCardConfirmDialog != null) {
autoRepayBindCardConfirmDialog.dismiss();
}
SupportBankBottomDialog supportBankBottomDialog = this.R;
if (supportBankBottomDialog != null) {
supportBankBottomDialog.dismiss();
}
super.onDestroy();
}
public void onItemSelector(View view, AutoRepayResponse.AutoRepayConfig autoRepayConfig, Date date, boolean z) {
if (date == null) {
return;
}
String c = DateFormatUtil.c(date, DateFormatUtil.a);
this.E.H(autoRepayConfig.key, c, z);
if (view instanceof TextView) {
((TextView) view).setText(c);
}
this.D.c.setEnabled(z0());
}
@OnClick({2131362413, 2131361967, 2131361933, 2131361956, 2131361951, 2131362449, 2131363212, 2131362442})
public void onViewClicked(View view) {
if (BaseUtils.b()) {
}
switch (view.getId()) {
case 2131361933:
U0();
break;
case 2131361951:
e1();
break;
case 2131361956:
this.E.O(AutoRepayResponse.AutoRepayStatus.UNBIND);
a1();
break;
case 2131361967:
V0();
break;
case 2131362413:
B();
break;
case 2131362442:
Y0();
break;
case 2131362449:
if (TextUtils.equals(AutoRepayResponse.AutoRepayStatus.UNBIND, this.E.B())) {
c1();
break;
}
break;
case 2131363212:
d1();
break;
}
}
@Override
@SuppressLint({"CheckResult"})
public Disposable runOnCreated(@NonNull Runnable runnable) {
return com.veda.supertoolkit.lifecycle.i.a(this, runnable);
}
@Override
@SuppressLint({"CheckResult"})
public Disposable runOnDestroy(@NonNull Runnable runnable) {
return com.veda.supertoolkit.lifecycle.i.b(this, runnable);
}
@Override
@SuppressLint({"CheckResult"})
public Disposable runOnEvent(@NonNull LifecycleEvent lifecycleEvent, @Nullable Runnable runnable) {
return com.veda.supertoolkit.lifecycle.i.c(this, lifecycleEvent, runnable);
}
protected boolean z0() {
return this.E.b() && this.E.c();
}
}