导航菜单

页面标题

页面副标题

Easycash v3.75.13 - PastFixedOrderDetailActivity.java 源代码

正在查看: Easycash v3.75.13 应用的 PastFixedOrderDetailActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.fintopia.lender.module.orders;

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.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import butterknife.BindView;
import butterknife.OnClick;
import com.fintopia.lender.R;
import com.fintopia.lender.module.baseui.LenderCommonActivity;
import com.fintopia.lender.module.maintab.model.ProductsBean;
import com.fintopia.lender.module.network.ILenderApiRoutes;
import com.fintopia.lender.module.orders.models.AutoDebtDetailsResponse;
import com.fintopia.lender.module.orders.models.OrderBean;
import com.fintopia.lender.module.orders.models.OrderStatusType;
import com.fintopia.lender.module.traderecord.model.TransactionType;
import com.fintopia.lender.module.webpage.LenderWebViewActivity;
import com.fintopia.lender.widget.LenderSingleButtonDialog;
import com.fintopia.lender.widget.OrderAfterTaxEarningsView;
import com.fintopia.lender.widget.OrderLendAmountView;
import com.fintopia.lender.widget.OrderRestructureDetailView;
import com.fintopia.lender.widget.OrderTermDetailView;
import com.fintopia.lender.widget.RedeemedAmountView;
import com.lingyue.idnbaselib.framework.lifecycle.LifecycleEvent;
import com.lingyue.idnbaselib.model.IdnObserver;
import com.lingyue.idnbaselib.utils.DevUtil;
import com.lingyue.idnbaselib.utils.EcFormatUtil;
import com.lingyue.idnbaselib.utils.JsonParamsBuilder;
import com.lingyue.idnbaselib.utils.ThirdPartEventUtils;
import com.lingyue.supertoolkit.customtools.CollectionUtils;
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 io.reactivex.disposables.Disposable;

public class PastFixedOrderDetailActivity extends LenderCommonActivity {
    public static final String INTENT_KEY_TRADE_TYPE = "trade_type";

    @BindView(4767)
    ConstraintLayout clLenderTimeRefundTax;

    @BindView(4768)
    ConstraintLayout clLendingMatchTime;

    @BindView(5050)
    ImageView ivProductNameTips;

    @BindView(5131)
    LinearLayout llExpireChoose;

    @BindView(5277)
    OrderLendAmountView olvLendingAmount;

    @BindView(5284)
    OrderAfterTaxEarningsView orderAfterTaxEarning;

    @BindView(5285)
    OrderRestructureDetailView ordvOrderRestructureDetail;

    @BindView(5286)
    OrderTermDetailView otdvOrderTermDetail;

    @BindView(5319)
    RedeemedAmountView redeemedAmountView;

    @BindView(5330)
    RelativeLayout rlBorrowerDetail;

    @BindView(5661)
    TextView tvExpireChoose;

    @BindView(5701)
    TextView tvLenderTimeRefundTax;

    @BindView(5704)
    TextView tvLendingMatchTime;

    @BindView(5709)
    TextView tvLendingTime;

    @BindView(5793)
    TextView tvPaybackTime;

    @BindView(5809)
    TextView tvProductName;

    @BindView(5810)
    TextView tvProductReturn;

    private OrderBean f119u;

    private TransactionType f120v;

    private void Q() {
        if (this.f119u.productConfig.isDebtProduct()) {
            this.rlBorrowerDetail.setVisibility(0);
        } else {
            this.rlBorrowerDetail.setVisibility(8);
        }
    }

    private void R() {
        OrderBean orderBean = this.f119u;
        if (orderBean.status == OrderStatusType.INIT) {
            this.otdvOrderTermDetail.setVisibility(8);
        } else {
            this.otdvOrderTermDetail.b(orderBean);
            this.otdvOrderTermDetail.setVisibility(0);
        }
    }

    private void S() {
        TransactionType transactionType = this.f120v;
        if (transactionType == null || transactionType == TransactionType.INVEST) {
            setTitle(getString(R.string.lender_order_detail));
        } else if (transactionType == TransactionType.REDEEM) {
            setTitle(getString(R.string.lender_redemption_details));
        }
    }

    @SensorsDataInstrumented
    public static void T(DialogInterface dialogInterface, int i) {
        dialogInterface.dismiss();
        SensorsDataAutoTrackHelper.trackDialog(dialogInterface, i);
        AutoTrackHelper.trackViewOnClick(dialogInterface, i);
    }

    @SensorsDataInstrumented
    public static void U(DialogInterface dialogInterface, int i) {
        dialogInterface.dismiss();
        SensorsDataAutoTrackHelper.trackDialog(dialogInterface, i);
        AutoTrackHelper.trackViewOnClick(dialogInterface, i);
    }

    @SensorsDataInstrumented
    public void V(AutoDebtDetailsResponse autoDebtDetailsResponse, View view) {
        if (BaseUtils.l()) {
            SensorsDataAutoTrackHelper.trackViewOnClick(view);
            AutoTrackHelper.trackViewOnClick(view);
        } else {
            LenderSingleButtonDialog.d(this).h(3).g(autoDebtDetailsResponse.body.promptMessage).e(R.string.lender_ok).k("dialog_product_name_tips_in_detail").i(new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i) {
                    PastFixedOrderDetailActivity.U(dialogInterface, i);
                }
            }).show();
            ThirdPartEventUtils.D(this, "ec_productdetailtip_click", (String) null);
            SensorsDataAutoTrackHelper.trackViewOnClick(view);
            AutoTrackHelper.trackViewOnClick(view);
        }
    }

    private void W() {
        if (this.f119u.isRewardPrincipal() || !this.f119u.isAllowAutoAllocate() || this.f119u.transferType == null) {
            this.llExpireChoose.setVisibility(8);
        } else {
            this.llExpireChoose.setVisibility(0);
            this.tvExpireChoose.setText(getString(this.f119u.transferType.descResId));
        }
    }

    public void X(final AutoDebtDetailsResponse autoDebtDetailsResponse) {
        if (TextUtils.isEmpty(autoDebtDetailsResponse.body.promptMessage)) {
            this.ivProductNameTips.setVisibility(8);
        } else {
            this.ivProductNameTips.setVisibility(0);
            this.ivProductNameTips.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    PastFixedOrderDetailActivity.this.V(autoDebtDetailsResponse, view);
                }
            });
        }
    }

    private void Y() {
        if (this.f119u.redeem == null) {
            this.redeemedAmountView.setVisibility(8);
        } else {
            this.redeemedAmountView.setVisibility(0);
            this.redeemedAmountView.b(this.f119u.redeem, new RedeemedAmountView.Delegate() {
                @Override
                public final void a() {
                    PastFixedOrderDetailActivity.this.onRedeemAmountTipsClicked();
                }
            });
        }
    }

    private void Z() {
        if (!this.f119u.isRestructureOrder()) {
            this.ordvOrderRestructureDetail.setVisibility(8);
        } else {
            this.ordvOrderRestructureDetail.b(this.f119u);
            this.ordvOrderRestructureDetail.setVisibility(0);
        }
    }

    private void a0() {
        showLoadingDialog();
        ((ILenderApiRoutes) this.apiHelper.a()).R(this.f119u.id).a(new IdnObserver<AutoDebtDetailsResponse>(this) {
            public void onSuccess(AutoDebtDetailsResponse autoDebtDetailsResponse) {
                PastFixedOrderDetailActivity.this.X(autoDebtDetailsResponse);
                if (!CollectionUtils.f(autoDebtDetailsResponse.body.debtMatchDetails) && PastFixedOrderDetailActivity.this.f119u.status != OrderStatusType.INIT) {
                    PastFixedOrderDetailActivity pastFixedOrderDetailActivity = PastFixedOrderDetailActivity.this;
                    pastFixedOrderDetailActivity.otdvOrderTermDetail.e(pastFixedOrderDetailActivity, autoDebtDetailsResponse.body.debtMatchDetails);
                }
                PastFixedOrderDetailActivity.this.dismissLoadingDialog();
            }
        });
    }

    public void onRedeemAmountTipsClicked() {
        if (BaseUtils.l()) {
            return;
        }
        LenderSingleButtonDialog.d(this).h(3).f(R.string.lender_redeem_amount_tips).e(R.string.lender_ok).k("dialog_redeem_amount_tips_in_detail").i(new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                PastFixedOrderDetailActivity.T(dialogInterface, i);
            }
        }).show();
    }

    public static void startPastFixedOrderDetailActivity(Activity activity, OrderBean orderBean) {
        Intent intent = new Intent(activity, (Class<?>) PastFixedOrderDetailActivity.class);
        intent.putExtra("order_bean", orderBean);
        activity.startActivity(intent);
    }

    @Override
    protected void G(@NonNull Bundle bundle) {
        bundle.putSerializable("order_bean", this.f119u);
        bundle.putSerializable("trade_type", this.f120v);
    }

    @Override
    public int getLayoutID() {
        return R.layout.lender_activity_past_fixed_order_detail;
    }

    @OnClick({5330})
    public void onBorrowerDetailClicked(View view) {
        if (BaseUtils.l()) {
            return;
        }
        String str = this.f119u.productConfig.isManualDebtProduct() ? "webview/borrower-detail" : this.f119u.productConfig.isAutoDebtProduct() ? "webview/auto-borrower-detail" : "";
        if (!TextUtils.isEmpty(str)) {
            LenderWebViewActivity.startWebActivity(u(), Uri.parse(((BaseActivity) this).appGlobal.a.a().toString()).buildUpon().path(str).appendQueryParameter("orderId", this.f119u.id).build().toString());
            ThirdPartEventUtils.z(this, "lender_borrower_detail_click", new JsonParamsBuilder().d("id").a(String.valueOf(this.f119u.id)).c());
        } else {
            DevUtil.a(new RuntimeException("in PastFixedOrderDetailActivity Unknown product type : " + this.f119u.productConfig.financingProductType));
        }
    }

    @Override
    public Disposable runOnActiveEvent(Runnable runnable) {
        return com.lingyue.idnbaselib.framework.lifecycle.m.a(this, runnable);
    }

    @Override
    @SuppressLint({"CheckResult"})
    public Disposable runOnCreated(@NonNull Runnable runnable) {
        return com.lingyue.idnbaselib.framework.lifecycle.m.b(this, runnable);
    }

    @Override
    @SuppressLint({"CheckResult"})
    public Disposable runOnDestroy(@NonNull Runnable runnable) {
        return com.lingyue.idnbaselib.framework.lifecycle.m.c(this, runnable);
    }

    @Override
    @SuppressLint({"CheckResult"})
    public Disposable runOnEvent(@NonNull LifecycleEvent lifecycleEvent, @Nullable Runnable runnable) {
        return com.lingyue.idnbaselib.framework.lifecycle.m.d(this, lifecycleEvent, runnable);
    }

    @Override
    public Disposable runOnEvents(@NonNull LifecycleEvent[] lifecycleEventArr, @Nullable Runnable runnable) {
        return com.lingyue.idnbaselib.framework.lifecycle.m.e(this, lifecycleEventArr, runnable);
    }

    @Override
    protected void w() {
        super.w();
        S();
        this.tvProductName.setText("・" + this.f119u.productConfig.name);
        W();
        Z();
        OrderLendAmountView orderLendAmountView = this.olvLendingAmount;
        OrderBean orderBean = this.f119u;
        orderLendAmountView.b(orderBean.principal, orderBean.actualPrincipal, orderBean.coupon);
        R();
        TextView textView = this.tvProductReturn;
        ProductsBean productsBean = this.f119u.productConfig;
        textView.setText(EcFormatUtil.q(Double.valueOf(productsBean.displayBasicRate + productsBean.displayFloatRate)));
        this.orderAfterTaxEarning.c(this.f119u);
        this.tvLendingTime.setText(EcFormatUtil.d(Long.valueOf(this.f119u.productConfig.isDebtProduct() ? this.f119u.timeInvest : this.f119u.timeCreated)));
        this.tvPaybackTime.setText(EcFormatUtil.d(Long.valueOf(this.f119u.timeFinished)));
        this.clLendingMatchTime.setVisibility((!this.f119u.productConfig.isDebtProduct() || this.f119u.debtMatchCompleteTime <= 0) ? 8 : 0);
        this.tvLendingMatchTime.setText(EcFormatUtil.d(Long.valueOf(this.f119u.debtMatchCompleteTime)));
        if (this.f119u.timeRefundTax != null) {
            this.clLenderTimeRefundTax.setVisibility(0);
            this.tvLenderTimeRefundTax.setText(EcFormatUtil.d(this.f119u.timeRefundTax));
        } else {
            this.clLenderTimeRefundTax.setVisibility(8);
        }
        Y();
        Q();
        if (this.f119u.productConfig.isAutoDebtProduct()) {
            a0();
        }
    }

    @Override
    protected void y(@NonNull Bundle bundle) {
        this.f119u = (OrderBean) bundle.getSerializable("order_bean");
        this.f120v = (TransactionType) bundle.getSerializable("trade_type");
    }

    public static void startPastFixedOrderDetailActivity(Activity activity, TransactionType transactionType, OrderBean orderBean) {
        Intent intent = new Intent(activity, (Class<?>) PastFixedOrderDetailActivity.class);
        intent.putExtra("trade_type", transactionType);
        intent.putExtra("order_bean", orderBean);
        activity.startActivity(intent);
    }
}