直播间聊天框修改

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,24 +1,37 @@
<?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">
<TextView
android:id="@+id/top_noback"
<androidx.cardview.widget.CardView
android:id="@+id/top_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="18dp"
android:text="@string/message"
android:textColor="@color/black3"
android:textSize="24sp"
android:textStyle="bold" />
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="8dp"
app:cardElevation="0dp">
<TextView
android:id="@+id/top_noback"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="18dp"
android:text="@string/message"
android:textColor="@color/black3"
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>