|
@@ -66,13 +66,14 @@ public class WithdrawalRecordActivity extends BaseMVPActivity<ActivityWithdrawal
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
StatusBarUtil.setStatusBarDarkTheme(this, true);
|
|
|
}
|
|
|
+
|
|
|
private WithdrawalRecordAdapter withdrawalRecordAdapter;
|
|
|
- List<WithdrawalRecordBean.RowsBean> dataList = new ArrayList<>();
|
|
|
|
|
|
@Override
|
|
|
protected void initView() {
|
|
@@ -83,10 +84,10 @@ public class WithdrawalRecordActivity extends BaseMVPActivity<ActivityWithdrawal
|
|
|
RecyclerView rvAddress = viewBinding.recyclerView;
|
|
|
LinearLayoutManager manager = new LinearLayoutManager(this);
|
|
|
rvAddress.setLayoutManager(manager);
|
|
|
- withdrawalRecordAdapter = new WithdrawalRecordAdapter(dataList);
|
|
|
+ withdrawalRecordAdapter = new WithdrawalRecordAdapter();
|
|
|
LayoutInflater inflater = LayoutInflater.from(this);
|
|
|
View emptyLayout = inflater.inflate(R.layout.layout_empty_conent, null);
|
|
|
- ImageView im_empty_logo=emptyLayout.findViewById(R.id.im_empty_logo);
|
|
|
+ ImageView im_empty_logo = emptyLayout.findViewById(R.id.im_empty_logo);
|
|
|
im_empty_logo.setBackgroundResource(R.drawable.icon_empty_content);
|
|
|
withdrawalRecordAdapter.setEmptyView(emptyLayout);
|
|
|
rvAddress.setAdapter(withdrawalRecordAdapter);
|
|
@@ -171,27 +172,27 @@ public class WithdrawalRecordActivity extends BaseMVPActivity<ActivityWithdrawal
|
|
|
pvTime = new TimePickerBuilder(this, (date, v) -> {//选中事件回调
|
|
|
reBuildFilter(date, currentWithdrawalFilterStatus);
|
|
|
}).setLayoutRes(com.cooleshow.base.R.layout.pickerview_default_layout, new CustomListener() {
|
|
|
+ @Override
|
|
|
+ public void customLayout(View v) {
|
|
|
+ //自定义布局中的控件初始化及事件处理
|
|
|
+ final TextView tvSubmit = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_finish);
|
|
|
+ TextView ivCancel = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_cancel);
|
|
|
+ tvSubmit.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
- public void customLayout(View v) {
|
|
|
- //自定义布局中的控件初始化及事件处理
|
|
|
- final TextView tvSubmit = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_finish);
|
|
|
- TextView ivCancel = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_cancel);
|
|
|
- tvSubmit.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- pvTime.returnData();
|
|
|
- pvTime.dismiss();
|
|
|
- }
|
|
|
- });
|
|
|
- ivCancel.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- pvTime.dismiss();
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
+ public void onClick(View v) {
|
|
|
+ pvTime.returnData();
|
|
|
+ pvTime.dismiss();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ ivCancel.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ pvTime.dismiss();
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
.setLineSpacingMultiplier(2.5f)
|
|
|
.setType(new boolean[]{true, true, false, false, false, false})// 默认全部显示
|
|
|
.setTextColorCenter(getResources().getColor(com.cooleshow.base.R.color.color_1a1a1a))//设置选中项的颜色
|
|
@@ -267,18 +268,19 @@ public class WithdrawalRecordActivity extends BaseMVPActivity<ActivityWithdrawal
|
|
|
|
|
|
@Override
|
|
|
public void withdrawalPageSuccess(int page, WithdrawalRecordBean data) {
|
|
|
- if (data != null) {
|
|
|
+ if (data != null && withdrawalRecordAdapter != null) {
|
|
|
if (page == 1) {
|
|
|
- dataList.clear();
|
|
|
+ withdrawalRecordAdapter.getData().clear();
|
|
|
viewBinding.refreshLayout.finishRefresh();
|
|
|
+ withdrawalRecordAdapter.notifyDataSetChanged();
|
|
|
if (data.rows != null && data.rows.size() > 0) {
|
|
|
checkHasNext(data.rows.size());
|
|
|
- dataList.addAll(data.rows);
|
|
|
+ withdrawalRecordAdapter.setNewInstance(data.rows);
|
|
|
}
|
|
|
- withdrawalRecordAdapter.notifyDataSetChanged();
|
|
|
} else {
|
|
|
if (data.rows != null && data.rows.size() > 0) {
|
|
|
withdrawalRecordAdapter.getLoadMoreModule().loadMoreComplete();
|
|
|
+ withdrawalRecordAdapter.addData(data.rows);
|
|
|
checkHasNext(data.rows.size());
|
|
|
} else {
|
|
|
withdrawalRecordAdapter.getLoadMoreModule().loadMoreEnd();
|