use of com.mtm.mrecord.mvp.model.entity.MobileUnitBean in project Mvp-Rxjava-Retrofit-dagger2 by pengMaster.
the class RecordUnitListActivity method initData.
@Override
public void initData(Bundle savedInstanceState) {
// 下载单位列表
userId = GlobalConstantUtils.getUser().getId();
mPresenter.initUnitList(userId, currentPage + "", "", "", "", "", true);
// 初始化下拉刷新控件
swipeContainer.setColorSchemeResources(R.color.color_bule2, R.color.color_bule, R.color.color_bule2, R.color.color_bule3);
// 下拉刷新
swipeContainer.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
currentPage = 1;
mPresenter.initUnitList(userId, currentPage + "", "", "", "", "", true);
}
});
lvContent.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
MobileUnitBean unitBean = (MobileUnitBean) lvContent.getItemAtPosition(i);
Bundle bundle = new Bundle();
bundle.putString("unitBean", gson.toJson(unitBean));
Intent intent = new Intent();
intent.setClass(getApplicationContext(), RecordSuperviseListActivity.class);
intent.putExtras(bundle);
startActivity(intent);
}
});
}
use of com.mtm.mrecord.mvp.model.entity.MobileUnitBean in project Mvp-Rxjava-Retrofit-dagger2 by pengMaster.
the class RecordSuperviseListActivity method initData.
@Override
public void initData(Bundle savedInstanceState) {
btnQuery.setVisibility(View.GONE);
// 下载单位列表
String unitBean = getIntent().getStringExtra("unitBean");
if (null == unitBean) {
return;
}
MobileUnitBean mobileUnitBean = gson.fromJson(unitBean, MobileUnitBean.class);
compId = mobileUnitBean.getId();
mPresenter.downLoadSuperviseRecord(compId);
// ListItem点击事件
lvContent.setOnItemClickListener(new AdapterView.OnItemClickListener() {
private String id;
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
RecordListBean.SuperviseListBean superviseListBean = (RecordListBean.SuperviseListBean) lvContent.getItemAtPosition(i);
id = superviseListBean.getId();
mPresenter.downLoadSuperviseRecordBaseInfo(id);
}
});
}
use of com.mtm.mrecord.mvp.model.entity.MobileUnitBean in project Mvp-Rxjava-Retrofit-dagger2 by pengMaster.
the class RecordUnitListActivity method addNewData.
@Override
public void addNewData(RecordUnitListBean unitListBean) {
hibernatePage = unitListBean.getHibernatePage();
List<MobileUnitBean> superviseList = unitListBean.getSuperviseList();
mAdapter = new Adapter(lvContent, superviseList, "unitList");
lvContent.setAdapter(mAdapter);
// 下拉刷新转圈消失
swipeContainer.setRefreshing(false);
// 当前页和总页数
currentPage++;
totalPages = hibernatePage.getTotalPages();
// 初始化 mPaginate
mPaginate = Paginate.with(lvContent, this).setLoadingTriggerThreshold(2).addLoadingListItem(true).build();
}
Aggregations