正在查看: Easycash v3.75.13 应用的 WithdrawActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Easycash v3.75.13 应用的 WithdrawActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.fintopia.lender.module.withdraw;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import butterknife.BindView;
import butterknife.OnClick;
import com.fintopia.lender.R;
import com.fintopia.lender.module.baseui.LenderCommonActivity;
import com.fintopia.lender.module.events.EventWithdrawSuccess;
import com.fintopia.lender.module.launch.AppGeneralConfigUtils;
import com.fintopia.lender.module.launch.model.LenderConfigKey;
import com.fintopia.lender.module.network.ILenderApiRoutes;
import com.fintopia.lender.module.security.SecureUtil;
import com.fintopia.lender.module.topup.TopUpActivity;
import com.fintopia.lender.module.verification.SmsVerificationFragment;
import com.fintopia.lender.module.withdraw.model.QuestionnaireEventType;
import com.fintopia.lender.module.withdraw.viewholder.WithdrawSuccessDialogViewHolder;
import com.fintopia.lender.widget.FullScreenDialog;
import com.fintopia.livenessdetection.facev2.activity.LiveRecognitionActivity;
import com.lingyue.idnbaselib.framework.lifecycle.LifecycleEvent;
import com.lingyue.idnbaselib.framework.lifecycle.m;
import com.lingyue.idnbaselib.model.IdnBaseResult;
import com.lingyue.idnbaselib.model.IdnObserver;
import com.lingyue.idnbaselib.model.QuestionnaireInfo;
import com.lingyue.idnbaselib.model.QuestionnaireResponse;
import com.lingyue.idnbaselib.model.response.BooleanResponse;
import com.lingyue.idnbaselib.utils.EcFormatUtil;
import com.lingyue.idnbaselib.utils.ThirdPartEventUtils;
import com.lingyue.idnbaselib.widget.editTextBridge.MoneyAmountEditText;
import com.lingyue.idnbaselib.widget.keyboard.MoneyKeyboard;
import com.lingyue.supertoolkit.widgets.BaseUtils;
import com.sensorsdata.analytics.android.autotrack.aop.SensorsDataAutoTrackHelper;
import com.sensorsdata.analytics.android.sdk.SensorsDataInstrumented;
import com.veda.android.bananalibrary.infrastructure.BaseActivity;
import com.yangqianguan.statistics.AutoTrackHelper;
import com.yangqianguan.statistics.annotation.NonDataTrack;
import io.reactivex.disposables.Disposable;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.MessageFormat;
import org.greenrobot.eventbus.EventBus;
public class WithdrawActivity extends LenderCommonActivity {
private MoneyKeyboard A;
public BigDecimal balance;
@BindView(4718)
Button btnWithdraw;
@BindView(4887)
MoneyAmountEditText etMoney;
@BindView(4932)
FrameLayout flVerification;
@BindView(5629)
TextView tvCurrentBalance;
@BindView(5742)
TextView tvMoneyTip;
@BindView(5936)
TextView tvWithdrawAll;
@BindView(5937)
TextView tvWithdrawBottomTip;
private String f210u;
private BigDecimal f211v;
private BigDecimal f212w;
public String withdrawMoney;
private int f213x;
private SmsVerificationFragment y;
private FullScreenDialog z;
public void S() {
EventBus.c().k(new EventWithdrawSuccess());
this.z.dismiss();
finish();
}
@SuppressLint({"ClickableViewAccessibility"})
private void T() {
this.A = new MoneyKeyboard(this);
this.etMoney.setAfterTextChangedListener(new MoneyAmountEditText.AfterTextChangedListener() {
public final void a(BigDecimal bigDecimal) {
WithdrawActivity.this.Y(bigDecimal);
}
});
}
private void U() {
if (this.y == null) {
SmsVerificationFragment m02 = SmsVerificationFragment.m0(this.f210u);
this.y = m02;
m02.D0(new SmsVerificationFragment.SmsVerificationFragmentCallBack() {
@Override
public void onCheckVerification(String str) {
WithdrawActivity withdrawActivity = WithdrawActivity.this;
withdrawActivity.b0(withdrawActivity.withdrawMoney, str);
}
@Override
public void onClose() {
WithdrawActivity.this.hideSmsVerificationDialogFragment();
}
});
getSupportFragmentManager().beginTransaction().add(R.id.fl_verification, this.y).commitAllowingStateLoss();
}
}
private void V() {
if (this.balance.compareTo(this.f211v) >= 0) {
BigDecimal bigDecimal = this.f212w;
if (bigDecimal == null || this.balance.compareTo(bigDecimal) <= 0) {
this.tvWithdrawAll.setVisibility(0);
}
}
}
public void W(QuestionnaireInfo questionnaireInfo) {
jumpToWebPage(Uri.parse(((BaseActivity) this).appGlobal.a.a().toString()).buildUpon().path("/webview/questionnaire").appendQueryParameter("questionnaireId", String.valueOf(questionnaireInfo.questionnaireId)).appendQueryParameter("submitId", String.valueOf(questionnaireInfo.id)).build().toString());
}
public void X(Activity activity, FullScreenDialog fullScreenDialog, View view, String str) {
new WithdrawSuccessDialogViewHolder(view).btnOk.setOnClickListener(new View.OnClickListener() {
@Override
@NonDataTrack
@SensorsDataInstrumented
public void onClick(View view2) {
if (AppGeneralConfigUtils.o().f(LenderConfigKey.financingWithdrawQuestionnaireSwitch, Boolean.FALSE).booleanValue()) {
WithdrawActivity.this.a0();
} else {
WithdrawActivity.this.S();
}
AutoTrackHelper.trackViewOnClick(view2, "dialog_withdraw");
SensorsDataAutoTrackHelper.trackViewOnClick(view2);
}
});
}
public void Y(BigDecimal bigDecimal) {
String str = "";
boolean z = false;
if (!this.etMoney.h()) {
if (bigDecimal.compareTo(this.balance) > 0) {
str = getString(R.string.lender_withdraw_amount_over_balance_tip);
} else if (bigDecimal.compareTo(this.f211v) < 0) {
str = MessageFormat.format(getString(R.string.lender_withdraw_amount_less_tip), this.f211v);
} else {
BigDecimal bigDecimal2 = this.f212w;
if (bigDecimal2 != null && bigDecimal.compareTo(bigDecimal2) > 0) {
str = MessageFormat.format(getString(R.string.lender_withdraw_amount_exceeds_tip), this.f212w);
} else if (this.balance.subtract(bigDecimal).compareTo(BigDecimal.ZERO) > 0 && this.balance.subtract(bigDecimal).compareTo(this.f211v) < 0) {
str = MessageFormat.format(getString(R.string.lender_withdraw_amount_remain_less_tip), this.f211v);
} else if (this.userSession.b().k > 0) {
z = true;
} else {
str = getString(R.string.lender_exceeded_withdraw_time);
}
}
}
Z(z, str);
}
private void Z(boolean z, String str) {
this.btnWithdraw.setEnabled(z);
this.tvMoneyTip.setText(str);
if (this.tvWithdrawAll.getVisibility() == 8) {
this.tvMoneyTip.setVisibility(z ? 4 : 0);
} else {
this.tvMoneyTip.setVisibility(z ? 8 : 0);
}
}
public void a0() {
showLoadingDialog();
((ILenderApiRoutes) this.apiHelper.a()).c0(QuestionnaireEventType.FINANCING_WITHDRAW.name()).a(new IdnObserver<QuestionnaireResponse>(this) {
public void onError(Throwable th, QuestionnaireResponse questionnaireResponse) {
super.onError(th, questionnaireResponse);
WithdrawActivity.this.dismissLoadingDialog();
WithdrawActivity.this.S();
}
public void onSuccess(QuestionnaireResponse questionnaireResponse) {
WithdrawActivity.this.dismissLoadingDialog();
QuestionnaireInfo questionnaireInfo = questionnaireResponse.body.userQuestionnaire;
if (questionnaireInfo != null) {
WithdrawActivity.this.W(questionnaireInfo);
}
WithdrawActivity.this.S();
}
protected boolean superShowErrorToast() {
return false;
}
});
}
public void b0(String str, String str2) {
showLoadingDialog();
((ILenderApiRoutes) this.apiHelper.a()).L(str, str2).a(new IdnObserver<BooleanResponse>(this) {
public void onError(Throwable th, BooleanResponse booleanResponse) {
super.onError(th, booleanResponse);
WithdrawActivity.this.dismissLoadingDialog();
if (SecureUtil.a(((IdnBaseResult) booleanResponse).status.code)) {
WithdrawActivity.this.removeSmsVerificationDialogFragment();
} else if (WithdrawActivity.this.y != null) {
WithdrawActivity.this.y.A0();
}
}
public void onSuccess(BooleanResponse booleanResponse) {
WithdrawActivity.this.dismissLoadingDialog();
WithdrawActivity.this.hideSmsVerificationDialogFragment();
WithdrawActivity.this.c0();
}
});
}
public void c0() {
FullScreenDialog a = new FullScreenDialog.Builder(this).d(R.layout.lender_dialog_withdraw_result).b(new FullScreenDialog.IFullScreenDialogInitCallBack() {
@Override
public final void a(Activity activity, FullScreenDialog fullScreenDialog, View view, Object obj) {
WithdrawActivity.this.X(activity, fullScreenDialog, view, (String) obj);
}
}).a();
this.z = a;
a.setOnKeyListener(new DialogInterface.OnKeyListener() {
@Override
public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
if (i != 4) {
return false;
}
EventBus.c().k(new EventWithdrawSuccess());
dialogInterface.dismiss();
WithdrawActivity.this.finish();
return true;
}
});
this.z.show();
}
public static void startWithdrawActivity(Activity activity) {
activity.startActivity(new Intent(activity, (Class<?>) WithdrawActivity.class));
}
@Override
protected void A() {
super.A();
this.tvCurrentBalance.setText(EcFormatUtil.i(this.balance));
this.tvWithdrawBottomTip.setText(MessageFormat.format(getString(R.string.lender_withdraw_bottom_tip), Integer.valueOf(this.f213x)));
V();
Z(false, "");
T();
}
@Override
protected void G(@NonNull Bundle bundle) {
super.G(bundle);
bundle.putString(TopUpActivity.PARAM_MOBILE, this.f210u);
}
@OnClick({4718})
public void clickWithdraw() {
if (BaseUtils.l()) {
return;
}
ThirdPartEventUtils.y(this, "lender_withdraw_btn_withdraw");
if (this.etMoney.h()) {
BaseUtils.s(this, getString(R.string.lender_please_fill_in_the_amount));
} else if (this.etMoney.getMoneyNoFormatBigDecimal().compareTo(BigDecimal.ZERO) > 0) {
this.withdrawMoney = this.etMoney.getMoneyNoFormatBigDecimal().toString();
showSmsVerificationDialogFragment();
}
}
@Override
public boolean dispatchTouchEvent(MotionEvent motionEvent) {
this.A.j(motionEvent);
return super.dispatchTouchEvent(motionEvent);
}
@Override
public int getLayoutID() {
return R.layout.lender_activity_withdraw;
}
public void hideSmsVerificationDialogFragment() {
if (this.y != null) {
this.flVerification.setVisibility(8);
getSupportFragmentManager().beginTransaction().hide(this.y).commitAllowingStateLoss();
}
}
@Override
protected void init() {
super.init();
this.f210u = this.userSession.b().b;
if (this.userSession.b().e == null) {
this.balance = BigDecimal.ZERO;
} else {
this.balance = this.userSession.b().e.setScale(0, RoundingMode.FLOOR);
}
this.f211v = AppGeneralConfigUtils.o().e(LenderConfigKey.withdrawMinAmount, new BigDecimal(LiveRecognitionActivity.BEFORE_SHOW_VOLUME_TIP_WAITING_TIME));
this.f212w = AppGeneralConfigUtils.o().e(LenderConfigKey.withdrawMaxAmount, new BigDecimal(200000000));
this.f213x = AppGeneralConfigUtils.o().i(LenderConfigKey.withdrawTimesLimit, 3).intValue();
}
public void onBackPressed() {
if (this.A.s()) {
return;
}
super/*androidx.activity.ComponentActivity*/.onBackPressed();
}
@Override
protected void onResume() {
super.onResume();
this.A.h(this.etMoney, new int[]{R.id.tv_withdraw_all});
this.etMoney.requestFocus();
}
public void removeSmsVerificationDialogFragment() {
SmsVerificationFragment smsVerificationFragment = this.y;
if (smsVerificationFragment == null || !smsVerificationFragment.isAdded()) {
return;
}
this.flVerification.setVisibility(8);
getSupportFragmentManager().beginTransaction().remove(this.y).commitAllowingStateLoss();
this.y = null;
}
@Override
public Disposable runOnActiveEvent(Runnable runnable) {
return m.a(this, runnable);
}
@Override
@SuppressLint({"CheckResult"})
public Disposable runOnCreated(@NonNull Runnable runnable) {
return m.b(this, runnable);
}
@Override
@SuppressLint({"CheckResult"})
public Disposable runOnDestroy(@NonNull Runnable runnable) {
return m.c(this, runnable);
}
@Override
@SuppressLint({"CheckResult"})
public Disposable runOnEvent(@NonNull LifecycleEvent lifecycleEvent, @Nullable Runnable runnable) {
return m.d(this, lifecycleEvent, runnable);
}
@Override
public Disposable runOnEvents(@NonNull LifecycleEvent[] lifecycleEventArr, @Nullable Runnable runnable) {
return m.e(this, lifecycleEventArr, runnable);
}
public void showSmsVerificationDialogFragment() {
U();
this.flVerification.setVisibility(0);
getSupportFragmentManager().beginTransaction().show(this.y).commitAllowingStateLoss();
}
@OnClick({5936})
public void withdrawAll() {
if (BaseUtils.l()) {
return;
}
ThirdPartEventUtils.y(this, "lender_balance_btn_withdrawall");
BigDecimal bigDecimal = this.balance;
if (bigDecimal != null) {
this.etMoney.setText(EcFormatUtil.l(bigDecimal));
MoneyAmountEditText moneyAmountEditText = this.etMoney;
moneyAmountEditText.setSelection(moneyAmountEditText.getText().length());
}
}
@Override
protected void y(@NonNull Bundle bundle) {
super.y(bundle);
this.f210u = bundle.getString(TopUpActivity.PARAM_MOBILE);
}
}