导航菜单

页面标题

页面副标题

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

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

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


package com.shiliuj.ui.activitys;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
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.TitleLayout;
import com.shiliuj.mjyp.adapters.BankListAdapter;
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.BankListBean;
import java.util.ArrayList;
import java.util.List;

public class L0ACT extends BaseBindActivity {
    protected BankListAdapter adapter;

    @BindView(2131296802)
    RecyclerView recycleView;

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

    protected boolean canLoadMore() {
        return false;
    }

    public int getLayoutId() {
        return 2131492897;
    }

    public void initPresenter() {
    }

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

    private void loadData(boolean z) {
        this.mRxManager.add(Api.getDefault().getBanks().compose(RxSchedulers.io_main()).compose(RxHelper.handleResult()).subscribe(new RxSubscriber<List<BankListBean>>(this.mContext, z) {
            public void _onNext(List<BankListBean> list) {
                L0ACT.this.setData(list);
            }

            protected void _onError(String str) {
                L0ACT.this.showShortToast(str);
            }
        }));
    }

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

    public void initView(Bundle bundle) {
        this.adapter = new BankListAdapter(this.mContext, 2131492973, this.list);
        this.recycleView.setLayoutManager(new LinearLayoutManager(this.mContext));
        this.recycleView.setAdapter(this.adapter);
        loadData(true);
        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 (i < 0 || i >= L0ACT.this.list.size()) {
                    return;
                }
                BankListBean bankListBean = L0ACT.this.list.get(i);
                String bankName = bankListBean.getBankName();
                String imgUrl = bankListBean.getImgUrl();
                Intent intent = new Intent();
                intent.putExtra("bankName", bankName);
                intent.putExtra("imgUrl", imgUrl);
                L0ACT.this.setResult(2000, intent);
                L0ACT.this.finish();
            }
        });
    }

    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();
    }
}