|
|
@@ -32,6 +32,7 @@ public class NotiView {
|
|
|
private Context context;
|
|
|
private NotiListAdapter notiListAdapter;
|
|
|
private RecyclerView recyclerView;
|
|
|
+ private View layoutNothing;
|
|
|
private int index;
|
|
|
|
|
|
public NotiView(Context context, View view, int position, List<NoticeBean> dataList, IEventListener listener) {
|
|
|
@@ -39,7 +40,7 @@ public class NotiView {
|
|
|
this.listener = listener;
|
|
|
this.index = position;
|
|
|
setLayoutNothingText(view, position);
|
|
|
- init(view, dataList, this.listener);
|
|
|
+ init(view, dataList);
|
|
|
}
|
|
|
|
|
|
private void setLayoutNothingText(View view, int position) {
|
|
|
@@ -57,11 +58,10 @@ public class NotiView {
|
|
|
*
|
|
|
* @param view
|
|
|
* @param beans
|
|
|
- * @param listener
|
|
|
*/
|
|
|
- public void init(View view, List<NoticeBean> beans, IEventListener listener) {
|
|
|
+ public void init(View view, List<NoticeBean> beans) {
|
|
|
recyclerView = view.findViewById(R.id.recycler_view_alarm_list);
|
|
|
- View layoutNothing = view.findViewById(R.id.layout_nothing);
|
|
|
+ layoutNothing = view.findViewById(R.id.layout_nothing);
|
|
|
recyclerView.setLayoutManager(new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false));
|
|
|
recyclerView.addItemDecoration(new RecyclerView.ItemDecoration() {
|
|
|
@Override
|
|
|
@@ -81,6 +81,16 @@ public class NotiView {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void update(List<NoticeBean> beans) {
|
|
|
+ if (null == beans || beans.size() == 0) {
|
|
|
+ layoutNothing.setVisibility(View.VISIBLE);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ layoutNothing.setVisibility(View.GONE);
|
|
|
+ notiListAdapter.update(beans);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public void setFocusPage(int position) {
|
|
|
if (this.index == position) {
|
|
|
if (NoticeBean.CATEGORY_NOTICE.equals(NoticeBean.getCategoryName(this.index))) {
|