导航菜单

页面标题

页面副标题

自健身 v3.3.4 - SelectCouponActivity.java 源代码

正在查看: 自健身 v3.3.4 应用的 SelectCouponActivity.java JAVA 源代码文件

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


package com.mu.gymtrain.Activity.MainPackage;

import android.os.Handler;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import com.mu.gymtrain.Base.BaseActivity;
import com.mu.gymtrain.Base.BaseModel;
import com.mu.gymtrain.Http.CreatMap;
import com.mu.gymtrain.Http.HttpHelper;
import com.mu.gymtrain.R;
import com.mu.gymtrain.Utils.FinalTools;
import com.mu.gymtrain.Widget.MyItemDivider;
import com.mu.gymtrain.Widget.xRefresh.BaseRecyclerAdapter;
import com.mu.gymtrain.Widget.xRefresh.XRefreshView;
import java.util.ArrayList;
import java.util.List;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

public class SelectCouponActivity extends BaseActivity {
    BaseRecyclerAdapter mAdapter;

    @BindView(R.id.recy_only)
    RecyclerView recyOnly;

    @BindView(R.id.title_left)
    ImageView titleLeft;

    @BindView(R.id.title_middle)
    TextView titleMiddle;

    @BindView(R.id.tv_nodata)
    TextView tvNodata;

    @BindView(R.id.xrfv)
    XRefreshView xrfv;
    List mList = new ArrayList();
    String class_id = "";

    public int getContentLayout() {
        return R.layout.activity_onlylist;
    }

    public void initData() {
        HttpHelper.getInstance().getRetrofitService(this).getUseCouponNum(new CreatMap.Builder().addParams("class_id", this.class_id).build().getParam()).observeOn(AndroidSchedulers.mainThread()).subscribeOn(Schedulers.io()).subscribe(new Subscriber<BaseModel>() {
            public void onCompleted() {
            }

            public void onError(Throwable e) {
            }

            public void onNext(BaseModel o) {
            }
        });
    }

    public void initView() {
        this.class_id = getIntent().getStringExtra(FinalTools.INTENT_COMMON);
        this.titleLeft.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                SelectCouponActivity.this.finish();
            }
        });
        this.recyOnly.setLayoutManager(new LinearLayoutManager(this));
        this.recyOnly.setHasFixedSize(true);
        this.recyOnly.setItemAnimator((RecyclerView.ItemAnimator) null);
        this.recyOnly.addItemDecoration(new MyItemDivider(this, MyItemDivider.ORIENTATION_H, 20, 0));
        this.xrfv.setXRefreshViewListener(new XRefreshView.SimpleXRefreshListener() {
            @Override
            public void onRefresh() {
                super.onRefresh();
                new Handler().postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        SelectCouponActivity.this.xrfv.mPage = 1;
                        SelectCouponActivity.this.initData();
                        SelectCouponActivity.this.xrfv.stopRefresh();
                    }
                }, 500L);
            }

            @Override
            public void onLoadMore(boolean isSilence) {
                super.onLoadMore(isSilence);
                new Handler().postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        SelectCouponActivity.this.xrfv.mPage++;
                        SelectCouponActivity.this.initData();
                        SelectCouponActivity.this.xrfv.stopLoadMore();
                    }
                }, 500L);
            }
        });
    }
}