|
|
@@ -1,10 +1,8 @@
|
|
|
-package com.itant.shibei.ui.home.template;
|
|
|
+package com.itant.shibei.ui.home.coupon;
|
|
|
|
|
|
import android.content.DialogInterface;
|
|
|
import android.content.Intent;
|
|
|
import android.os.Bundle;
|
|
|
-import android.view.View;
|
|
|
-import android.widget.ImageView;
|
|
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
import androidx.appcompat.app.AlertDialog;
|
|
|
@@ -52,8 +50,7 @@ public class TemplateFragment extends BaseMVPFragment implements ITemplateView<C
|
|
|
private int mCurrentPage = PAGE_START;
|
|
|
/**是否下拉获取数据*/
|
|
|
private boolean mIsRefresh = true;
|
|
|
- private ImageView iv_empty;
|
|
|
-
|
|
|
+
|
|
|
public TemplateFragment(int templateType) {
|
|
|
mTemplateType = templateType;
|
|
|
}
|
|
|
@@ -67,7 +64,6 @@ public class TemplateFragment extends BaseMVPFragment implements ITemplateView<C
|
|
|
public void onCreateViewFinished(@Nullable Bundle savedInstanceState) {
|
|
|
super.onCreateViewFinished(savedInstanceState);
|
|
|
|
|
|
- iv_empty = rootView.findViewById(R.id.iv_empty);
|
|
|
rv_template = rootView.findViewById(R.id.rv_template);
|
|
|
// 必须要设置LayoutManager,否则RecyclerView不知道要使用什么布局,从而在界面上不显示
|
|
|
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false);
|
|
|
@@ -81,6 +77,9 @@ public class TemplateFragment extends BaseMVPFragment implements ITemplateView<C
|
|
|
mAdapter = new TemplateAdapter(getActivity(), mCouponBeanList);
|
|
|
mAdapter.setCouponLongClickListener(this::showAdminDialog);
|
|
|
rv_template.setAdapter(mAdapter);
|
|
|
+ // 必须先绑定RecyclerView
|
|
|
+ mAdapter.setEmptyView(R.layout.view_empty, rv_template);
|
|
|
+
|
|
|
// 不要滑动一段距离
|
|
|
rv_template.smoothScrollToPosition(0);
|
|
|
srl_template = rootView.findViewById(R.id.srl_template);
|
|
|
@@ -197,12 +196,6 @@ public class TemplateFragment extends BaseMVPFragment implements ITemplateView<C
|
|
|
if (couponBeanList != null && couponBeanList.size() > 0) {
|
|
|
mCurrentPage++;
|
|
|
}
|
|
|
-
|
|
|
- if (mCouponBeanList.size() == 0) {
|
|
|
- iv_empty.setVisibility(View.VISIBLE);
|
|
|
- } else {
|
|
|
- iv_empty.setVisibility(View.GONE);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
/**
|