|
@@ -25,7 +25,10 @@ import com.cooleshow.base.constanst.Constants;
|
|
|
import com.cooleshow.base.router.RouterPath;
|
|
|
import com.cooleshow.base.ui.activity.BaseMVPActivity;
|
|
|
import com.cooleshow.base.utils.PopupUtil;
|
|
|
+import com.cooleshow.base.utils.SizeUtils;
|
|
|
+import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
|
|
|
import com.cooleshow.base.widgets.DensityUtil;
|
|
|
+import com.cooleshow.base.widgets.EmptyViewLayout;
|
|
|
import com.scwang.smart.refresh.layout.api.RefreshLayout;
|
|
|
import com.scwang.smart.refresh.layout.listener.OnRefreshListener;
|
|
|
|
|
@@ -47,9 +50,10 @@ public class NoticeActivity extends BaseMVPActivity<ActivityNoticeBinding, Notic
|
|
|
|
|
|
private String targetId = "";
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
- if (v.getId() == R.id.floatbutton) {
|
|
|
+ if (v.getId() == com.cooleshow.base.R.id.tv_right) {
|
|
|
ARouter.getInstance().build(RouterPath.ChatCenter.CHAT_GROUP_NOTICE_EDIT)
|
|
|
.withString("targetId", targetId)
|
|
|
.navigation();
|
|
@@ -65,6 +69,9 @@ public class NoticeActivity extends BaseMVPActivity<ActivityNoticeBinding, Notic
|
|
|
@Override
|
|
|
protected void initView() {
|
|
|
initMidTitleToolBar(viewBinding.toolbarInclude.toolbar, "群公告");
|
|
|
+ viewBinding.toolbarInclude.tvRight.setImageResource(R.drawable.icon_chat_group_notice_add);
|
|
|
+ viewBinding.toolbarInclude.tvRight.setVisibility(View.VISIBLE);
|
|
|
+ viewBinding.toolbarInclude.tvRight.setOnClickListener(this);
|
|
|
targetId = getIntent().getStringExtra("targetId");
|
|
|
recyclerView = viewBinding.recyclerView;
|
|
|
floatbutton = viewBinding.floatbutton;
|
|
@@ -80,6 +87,9 @@ public class NoticeActivity extends BaseMVPActivity<ActivityNoticeBinding, Notic
|
|
|
LinearLayoutManager manager = new LinearLayoutManager(this);
|
|
|
recyclerView.setLayoutManager(manager);
|
|
|
mAdapter = new NoticeListAdapter(noticeData);
|
|
|
+ EmptyViewLayout emptyViewLayout = new EmptyViewLayout(this);
|
|
|
+ emptyViewLayout.setContent(R.drawable.icon_empty_content, "暂无群公告");
|
|
|
+ mAdapter.setEmptyView(emptyViewLayout);
|
|
|
recyclerView.setAdapter(mAdapter);
|
|
|
|
|
|
mAdapter.getLoadMoreModule().setOnLoadMoreListener(new OnLoadMoreListener() {
|
|
@@ -105,6 +115,7 @@ public class NoticeActivity extends BaseMVPActivity<ActivityNoticeBinding, Notic
|
|
|
} else {
|
|
|
popuList.add("置顶");
|
|
|
}
|
|
|
+ popuList.add("删除");
|
|
|
initPopu(popuList, v, bean);
|
|
|
}
|
|
|
});
|
|
@@ -114,7 +125,7 @@ public class NoticeActivity extends BaseMVPActivity<ActivityNoticeBinding, Notic
|
|
|
@Override
|
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
- StatusBarUtil.setStatusBarDarkTheme(this, true);
|
|
|
+ QMUIStatusBarHelper.setStatusBarLightMode(this);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -133,7 +144,7 @@ public class NoticeActivity extends BaseMVPActivity<ActivityNoticeBinding, Notic
|
|
|
|
|
|
private void initPopu(List<String> popuList, View view, GroupNoticeBean.RowsBean bean) {
|
|
|
PopupUtil.showInDropWrapNObg(this, R.layout.notice_on_popu, view,
|
|
|
- DensityUtil.dp2px(this, 20), DensityUtil.dp2px(this, 20), (view1, popupWindow) -> {
|
|
|
+ SizeUtils.dp2px(20), SizeUtils.dp2px(20), (view1, popupWindow) -> {
|
|
|
RecyclerView recyclerView = view1.findViewById(R.id.recyclerView);
|
|
|
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(NoticeActivity.this);
|
|
|
recyclerView.setLayoutManager(linearLayoutManager);
|
|
@@ -158,6 +169,9 @@ public class NoticeActivity extends BaseMVPActivity<ActivityNoticeBinding, Notic
|
|
|
presenter.noticeUpdate(bean.id, targetId, bean.title, bean.content, false);
|
|
|
}
|
|
|
}
|
|
|
+ if (position == 2) {
|
|
|
+ presenter.noticeDel(String.valueOf(bean.id));
|
|
|
+ }
|
|
|
popupWindow.dismiss();
|
|
|
}
|
|
|
});
|
|
@@ -231,6 +245,18 @@ public class NoticeActivity extends BaseMVPActivity<ActivityNoticeBinding, Notic
|
|
|
|
|
|
@Override
|
|
|
public void updateGroupNoticeSuccess() {
|
|
|
+ if (!checkActivityExist()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ currentPage = 1;
|
|
|
+ queryData();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void delGroupNoticeSuccess() {
|
|
|
+ if (!checkActivityExist()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
currentPage = 1;
|
|
|
queryData();
|
|
|
}
|