直播间聊天框修改

This commit is contained in:
18401019693 2022-09-05 16:44:30 +08:00
parent 7281296d8e
commit a969abc2bf
3 changed files with 58 additions and 28 deletions

View File

@ -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<ImUserBean> 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<ImUserBean> listUserBean = JSON.parseArray(Arrays.toString(info), ImUserBean.class);
// addSystemMessagesView(listUserBean);
// }
// });
// }
// }
// });
//刷新列表内用户信息
addUserInfoProvider();

View File

@ -1,10 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:id="@+id/top_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="8dp"
app:cardElevation="0dp">
<TextView
android:id="@+id/top_noback"
android:layout_width="match_parent"
@ -15,10 +23,15 @@
android:textSize="24sp"
android:textStyle="bold" />
</androidx.cardview.widget.CardView>
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="400dp"
android:layout_below="@id/top_card"
android:layout_marginTop="-10dp"
android:background="@color/white"
android:paddingTop="10dp" />
</LinearLayout>
</RelativeLayout>

View File

@ -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<ImUserBean> 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);