From a969abc2bf189890ffdf237fd6fa68c06e362aa2 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Mon, 5 Sep 2022 16:44:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B4=E6=92=AD=E9=97=B4=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E6=A1=86=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../live/activity/PDLIiveChatActivity.java | 39 ++++++++++++------- live/src/main/res/layout/activity_pd_chat.xml | 33 +++++++++++----- .../PDLiveConversationListActivity.java | 14 +++++-- 3 files changed, 58 insertions(+), 28 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/activity/PDLIiveChatActivity.java b/live/src/main/java/com/yunbao/live/activity/PDLIiveChatActivity.java index fd810069a..11a236b47 100644 --- a/live/src/main/java/com/yunbao/live/activity/PDLIiveChatActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/PDLIiveChatActivity.java @@ -76,6 +76,15 @@ public class PDLIiveChatActivity extends FragmentActivity { getWindow().setAttributes(lp); setFinishOnTouchOutside(true);//允许点击空白处关闭 + //展示会话列表 + conversationListFragment = new ConversationListFragment(); + FragmentManager manager = getSupportFragmentManager(); + FragmentTransaction transaction = manager.beginTransaction(); + transaction.replace(R.id.container, conversationListFragment); + transaction.commit(); + //自定义空数据背景View + conversationListFragment.setEmptyView(com.yunbao.live.R.layout.view_layout_msg); + } /** @@ -90,21 +99,21 @@ public class PDLIiveChatActivity extends FragmentActivity { */ private void initData() { IMLoginManager.get(mContext).checkInstructor(); - //获取系统消息列表 - ImHttpUtil.getImUserInfo("", new HttpCallback() { - @Override - public void onSuccess(int code, String msg, String[] info) { - if (code == 0) { - container.post(new Runnable() { - @Override - public void run() { - List listUserBean = JSON.parseArray(Arrays.toString(info), ImUserBean.class); - addSystemMessagesView(listUserBean); - } - }); - } - } - }); +// //获取系统消息列表 +// ImHttpUtil.getImUserInfo("", new HttpCallback() { +// @Override +// public void onSuccess(int code, String msg, String[] info) { +// if (code == 0) { +// container.post(new Runnable() { +// @Override +// public void run() { +// List listUserBean = JSON.parseArray(Arrays.toString(info), ImUserBean.class); +// addSystemMessagesView(listUserBean); +// } +// }); +// } +// } +// }); //刷新列表内用户信息 addUserInfoProvider(); diff --git a/live/src/main/res/layout/activity_pd_chat.xml b/live/src/main/res/layout/activity_pd_chat.xml index 884c302e1..aaeaa2496 100644 --- a/live/src/main/res/layout/activity_pd_chat.xml +++ b/live/src/main/res/layout/activity_pd_chat.xml @@ -1,24 +1,37 @@ - - + app:cardBackgroundColor="@color/white" + app:cardCornerRadius="8dp" + app:cardElevation="0dp"> + + + + + - \ No newline at end of file + \ No newline at end of file diff --git a/main/src/main/java/com/yunbao/main/activity/PDLiveConversationListActivity.java b/main/src/main/java/com/yunbao/main/activity/PDLiveConversationListActivity.java index 33d415a82..ff86667ae 100644 --- a/main/src/main/java/com/yunbao/main/activity/PDLiveConversationListActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/PDLiveConversationListActivity.java @@ -36,6 +36,7 @@ import com.yunbao.common.bean.ImUserInfoModel; import com.yunbao.common.custom.TabButtonGroup; import com.yunbao.common.event.MessageIMEvent; import com.yunbao.common.event.UpdateTablePointMe; +import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.manager.IMLoginManager; @@ -89,6 +90,7 @@ public class PDLiveConversationListActivity extends AbsActivity implements View. private String type = null; private List listUserBean = new ArrayList<>(); private LinearLayout topLayout; + private ImageView imgNewsNotice, imgNewsInteraction, imgNewsOnline; @Override @@ -169,6 +171,9 @@ public class PDLiveConversationListActivity extends AbsActivity implements View. textNewsOnline = findViewById(R.id.text_news_online); newsIconClearance = findViewById(R.id.news_icon_clearance); topLayout = findViewById(R.id.top_layout); + imgNewsNotice = findViewById(R.id.img_news_notice); + imgNewsInteraction = findViewById(R.id.img_news_interaction); + imgNewsOnline = findViewById(R.id.img_news_online); mTabButtonGroup.setCurPosition(2); findViewById(R.id.btn_start).setOnClickListener(v -> { //防止重新加载多个 @@ -256,7 +261,8 @@ public class PDLiveConversationListActivity extends AbsActivity implements View. textNewsNotice.setVisibility(View.VISIBLE); textNewsNotice.setText(userBean.getNum()); } - ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.img_news_notice), () -> { + ImgLoader.display(mContext, userBean.getImage(), imgNewsNotice); + ViewClicksAntiShake.clicksAntiShake(imgNewsNotice, () -> { type = userBean.getType(); netHandler.post(systemNumberRunnable); startActivity(new Intent(mContext, SystemMessageActivity.class) @@ -274,7 +280,8 @@ public class PDLiveConversationListActivity extends AbsActivity implements View. textNewsInteraction.setVisibility(View.VISIBLE); textNewsInteraction.setText(userBean.getNum()); } - ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.img_news_interaction), () -> { + ImgLoader.display(mContext, userBean.getImage(), imgNewsInteraction); + ViewClicksAntiShake.clicksAntiShake(imgNewsInteraction, () -> { type = userBean.getType(); netHandler.post(systemNumberRunnable); startActivity(new Intent(mContext, SystemMessageActivity.class) @@ -292,7 +299,8 @@ public class PDLiveConversationListActivity extends AbsActivity implements View. textNewsOnline.setVisibility(View.VISIBLE); textNewsOnline.setText(userBean.getNum()); } - ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.img_news_online), () -> { + ImgLoader.display(mContext, userBean.getImage(), imgNewsOnline); + ViewClicksAntiShake.clicksAntiShake(imgNewsOnline, () -> { type = userBean.getType(); netHandler.post(systemNumberRunnable); FirebaseAnalytics.getInstance(mContext).logEvent("FS_customer_service", null);