导航菜单

页面标题

页面副标题

大众借. v4.1.2 - M0ACT.java 源代码

正在查看: 大众借. v4.1.2 应用的 M0ACT.java JAVA 源代码文件

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


package com.shiliuj.ui.activitys;

import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import com.base.commonlibrary.base.baseapp.AppActivityManager;
import com.base.commonlibrary.base.baserx.RxHelper;
import com.base.commonlibrary.base.baserx.RxSchedulers;
import com.base.commonlibrary.baseview.recyclerview.MultiItemTypeAdapter;
import com.base.commonlibrary.views.LoadingTip;
import com.base.commonlibrary.views.TitleLayout;
import com.shiliuj.mjyp.BMAG01ACT;
import com.shiliuj.mjyp.adapters.LoanAdapter;
import com.shiliuj.mjyp.app.api.Api;
import com.shiliuj.mjyp.app.base.BaseBindActivity;
import com.shiliuj.mjyp.app.base.RxSubscriber;
import com.shiliuj.ui.bean.MyOrderListBean;
import com.shiliuj.ui.bean.PageForm;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

public class M0ACT extends BaseBindActivity {
    protected LoanAdapter adapter;

    @BindView(2131296342)
    TextView allMoney;

    @BindView(2131296547)
    TextView hMoney;

    @BindView(2131296636)
    LinearLayout llBottom;

    @BindView(2131296792)
    TextView qMoney;

    @BindView(2131296802)
    RecyclerView recycleView;

    @BindView(2131296998)
    TitleLayout title;
    protected int pageNo = 1;
    protected int pageSize = 10;
    protected List<MyOrderListBean.PageBean.RecordsBean> list = new ArrayList();

    protected boolean canLoadMore() {
        return true;
    }

    public int getLayoutId() {
        return 2131492907;
    }

    public void initPresenter() {
    }

    protected void refresh() {
        this.pageNo = 1;
        getLoanList(false);
    }

    protected void loadMore() {
        this.pageNo++;
        getLoanList(false);
    }

    public void initView(Bundle bundle) {
        this.adapter = new LoanAdapter(this.mContext, 2131492977, this.list);
        this.recycleView.setLayoutManager(new LinearLayoutManager(this.mContext));
        this.recycleView.setAdapter(this.adapter);
        this.loadTip.setOnKnowListener(new LoadingTip.onKnowListener() {
            public final void know() {
                M0ACT.lambda$initView$0();
            }
        });
        this.loadTip.setOnReloadListener(new LoadingTip.onReloadListener() {
            public final void reload() {
                M0ACT.this.lambda$initView$1$M0ACT();
            }
        });
        this.adapter.setOnItemClickListener(new MultiItemTypeAdapter.OnItemClickListener() {
            public boolean onItemLongClick(View view, RecyclerView.ViewHolder viewHolder, int i) {
                return false;
            }

            public void onItemClick(View view, RecyclerView.ViewHolder viewHolder, int i) {
                if (M0ACT.this.list.size() > 0) {
                    MyOrderListBean.PageBean.RecordsBean recordsBean = M0ACT.this.list.get(i);
                    Integer valueOf = Integer.valueOf(recordsBean.getStatus());
                    Integer repStatus = recordsBean.getRepStatus();
                    String orderNo = recordsBean.getOrderNo();
                    Bundle bundle2 = new Bundle();
                    bundle2.putString("ORDERID", orderNo);
                    if (valueOf.intValue() == 1 || valueOf.intValue() == 3 || valueOf.intValue() == 4 || valueOf.intValue() == 5) {
                        if (valueOf.intValue() != 3) {
                            M0ACT.this.startActivity(N0ACT.class, bundle2);
                            return;
                        } else {
                            if (repStatus != null) {
                                return;
                            }
                            AppActivityManager.getAppManager().returnToActivity(BMAG01ACT.class);
                            AppActivityManager.getAppManager().getActivity(BMAG01ACT.class).onCheckPosition(1);
                            M0ACT.this.finish();
                            return;
                        }
                    }
                    M0ACT.this.startActivity(N0ACT.class, bundle2);
                }
            }
        });
        getLoanList(true);
    }

    static void lambda$initView$0() {
        AppActivityManager.getAppManager().getActivity(BMAG01ACT.class).onCheckPosition(0);
        AppActivityManager.getAppManager().returnToActivity(BMAG01ACT.class);
    }

    public void lambda$initView$1$M0ACT() {
        getLoanList(true);
    }

    public void setData(List list) {
        if (list == null || list.size() == 0) {
            if (this.pageNo == 1) {
                showEmpty();
                return;
            } else {
                showShortToast(getString(2131689872));
                stopLoading();
                return;
            }
        }
        if (this.pageNo == 1) {
            this.list.clear();
        }
        this.adapter.addAll(list);
        this.adapter.notifyDataSetChanged();
        stopLoading();
    }

    protected void getLoanList(boolean z) {
        this.mRxManager.add(Api.getDefault().myOrderList(new PageForm(this.pageNo + "", this.pageSize + "")).compose(RxSchedulers.io_main()).compose(RxHelper.handleResult()).subscribe(new RxSubscriber<MyOrderListBean>(this.mContext, z) {
            public void _onNext(MyOrderListBean myOrderListBean) {
                BigDecimal amount = myOrderListBean.getAmount();
                BigDecimal dueAmount = myOrderListBean.getDueAmount();
                BigDecimal repAmount = myOrderListBean.getRepAmount();
                M0ACT.this.allMoney.setText(M0ACT.this.getString(2131689824) + amount + "");
                M0ACT.this.hMoney.setText(M0ACT.this.getString(2131689824) + repAmount + "");
                M0ACT.this.qMoney.setText(M0ACT.this.getString(2131689824) + dueAmount + "");
                if (myOrderListBean.getPage() != null && myOrderListBean.getPage().getRecords() != null && myOrderListBean.getPage().getRecords().size() > 0) {
                    List records = myOrderListBean.getPage().getRecords();
                    if (records.size() > 1) {
                        M0ACT.this.setData(records.subList(0, 1));
                        return;
                    } else {
                        M0ACT.this.setData(records);
                        return;
                    }
                }
                M0ACT.this.showEmpty();
            }

            protected void _onError(String str) {
                M0ACT.this.showErrorTip(str);
            }
        }));
    }

    public void showEmpty() {
        this.loadTip.setLoadingTip(LoadingTip.LoadStatus.empty);
        this.loadTip.setVisibility(0);
        this.loadTip.setBtOperateVisibility(false);
        this.loadTip.setFinishVisibility(true);
        this.loadTip.setTips(getResources().getString(2131689877));
        this.loadTip.setImgTipLog(2131558453);
        this.loadTip.setKnowText(getResources().getString(2131689882));
    }
}