Merge branch 'master' into dev_room_chat
# Conflicts: # live/src/main/java/com/yunbao/live/activity/PDLIiveChatActivity.java # main/src/main/java/com/yunbao/main/manager/imrongcloud/ConversationIMListManager.java
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.yunbao.live.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
@@ -26,14 +25,12 @@ import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.InstructorRemarkManager;
|
||||
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.adapter.SystemChatMessageAdapter;
|
||||
import com.yunbao.live.bean.ImUserBean;
|
||||
import com.yunbao.live.bean.SearchUserBean;
|
||||
import com.yunbao.live.http.ImHttpUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -46,11 +43,9 @@ import io.rong.imlib.model.UserInfo;
|
||||
* 直播页面聊天列表
|
||||
*/
|
||||
public class PDLIiveChatActivity extends FragmentActivity {
|
||||
private MyConversationListFragment conversationListFragment;
|
||||
private ConversationListFragment conversationListFragment;
|
||||
private FrameLayout container;
|
||||
private PDLIiveChatActivity mContext;
|
||||
private boolean isGetSystemMsg=true;//是否展示系统消息,默认为true
|
||||
private boolean isDialogWindow=false;//是否为半屏展示,默认为false
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
@@ -58,14 +53,6 @@ public class PDLIiveChatActivity extends FragmentActivity {
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
setContentView(R.layout.activity_pd_chat);
|
||||
mContext = this;
|
||||
Intent intent = getIntent();
|
||||
if(intent!=null) {
|
||||
isGetSystemMsg =intent.getBooleanExtra("systemMsg",true);
|
||||
isDialogWindow =intent.getBooleanExtra("dialogWindow",false);
|
||||
}else{
|
||||
isGetSystemMsg=true;
|
||||
isDialogWindow=false;
|
||||
}
|
||||
windowColor();
|
||||
initView();
|
||||
initData();
|
||||
@@ -89,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);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,25 +99,21 @@ public class PDLIiveChatActivity extends FragmentActivity {
|
||||
*/
|
||||
private void initData() {
|
||||
IMLoginManager.get(mContext).checkInstructor();
|
||||
//获取系统消息列表
|
||||
if(isGetSystemMsg) {
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
addSystemMessagesView(new ArrayList<>());
|
||||
}
|
||||
// //获取系统消息列表
|
||||
// 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();
|
||||
|
||||
@@ -138,10 +130,7 @@ public class PDLIiveChatActivity extends FragmentActivity {
|
||||
//倒序展示
|
||||
Collections.reverse(listUserBean);
|
||||
//展示会话列表
|
||||
conversationListFragment = new MyConversationListFragment();
|
||||
Bundle bundle=new Bundle();
|
||||
bundle.putBoolean("dialogWindow",isDialogWindow);
|
||||
conversationListFragment.setBundle(bundle);
|
||||
conversationListFragment = new ConversationListFragment();
|
||||
FragmentManager manager = getSupportFragmentManager();
|
||||
FragmentTransaction transaction = manager.beginTransaction();
|
||||
transaction.replace(R.id.container, conversationListFragment);
|
||||
|
||||
13
live/src/main/res/drawable/background_system_message.xml
Normal file
13
live/src/main/res/drawable/background_system_message.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="95dp" />
|
||||
<solid android:color="@color/red" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/white" />
|
||||
<padding
|
||||
android:bottom="5dp"
|
||||
android:left="10dp"
|
||||
android:right="10dp"
|
||||
android:top="5dp" />
|
||||
</shape>
|
||||
@@ -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>
|
||||
@@ -1,23 +1,147 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/rc_conversation_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/rc_conversation_item_height">
|
||||
android:layout_height="123dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<RelativeLayout
|
||||
android:id="@+id/administrator_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="8dp"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="8dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/img_administrator_layout"
|
||||
android:layout_width="54dp"
|
||||
android:layout_height="54dp"
|
||||
android:layout_marginStart="34dp"
|
||||
android:layout_marginTop="39dp"
|
||||
android:layout_marginEnd="15dp">
|
||||
|
||||
<com.yunbao.common.views.weight.ClipPathCircleImage
|
||||
android:id="@+id/img_administrator"
|
||||
android:layout_width="54dp"
|
||||
android:layout_height="54dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/beauty_jingbai" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_administrator_logo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="22dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="-5dp"
|
||||
android:src="@mipmap/img_news_instructor_tags_chinese"
|
||||
android:visibility="visible" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/conversation_linear"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="41dp"
|
||||
android:layout_toEndOf="@id/img_administrator_layout"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/conversation_title"
|
||||
style="@style/TextStyle.Alignment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:text="张三"
|
||||
android:textColor="#161616"
|
||||
android:textSize="16sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/conversation_linear"
|
||||
android:layout_toEndOf="@id/img_administrator_layout"
|
||||
android:layout_marginTop="7dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rc_conversation_read_receipt"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_content"
|
||||
style="@style/TextStyle.Alignment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="60dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:text="你好,朋友!"
|
||||
android:textColor="@color/rc_secondary_color"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/conversation_unread"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginEnd="26dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/conversation_unread_bg"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_centerInParent="true"
|
||||
app:srcCompat="@drawable/rc_unread_count_bg_normal" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/conversation_unread_count"
|
||||
style="@style/TextStyle.Alignment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="15"
|
||||
android:textColor="@color/rc_white_color"
|
||||
android:textSize="14sp" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/conversation_date"
|
||||
style="@style/TextStyle.Alignment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="41dp"
|
||||
android:layout_marginEnd="26dp"
|
||||
android:text="3 月 22 日"
|
||||
android:textColor="@color/rc_auxiliary_color"
|
||||
android:textSize="@dimen/rc_font_nav_or_date_size" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rc_conversation_portrait_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="visible">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rc_conversation_portrait_rl"
|
||||
android:layout_width="54dp"
|
||||
android:layout_height="54dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="15dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="39dp"
|
||||
android:layout_marginEnd="15dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rc_conversation_portrait"
|
||||
@@ -34,17 +158,15 @@
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rc_conversation_linear"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="@dimen/rc_margin_size_16"
|
||||
android:layout_marginStart="88dp"
|
||||
android:layout_marginTop="41dp"
|
||||
android:layout_marginEnd="@dimen/rc_margin_size_12"
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintEnd_toStartOf="@+id/rc_conversation_date"
|
||||
app:layout_constraintStart_toEndOf="@+id/rc_conversation_portrait_rl"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_title"
|
||||
@@ -54,7 +176,7 @@
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:text="张三"
|
||||
android:textColor="@color/rc_text_main_color"
|
||||
android:textColor="#161616"
|
||||
android:textSize="16sp" />
|
||||
|
||||
|
||||
@@ -62,30 +184,18 @@
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toEndOf="@+id/rc_conversation_portrait_rl"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rc_conversation_linear">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rc_conversation_read_receipt"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:visibility="gone" />
|
||||
android:layout_below="@id/rc_conversation_linear"
|
||||
android:layout_marginStart="88dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_content"
|
||||
android:id="@+id/conversation_content"
|
||||
style="@style/TextStyle.Alignment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="60dp"
|
||||
android:layout_weight="1"
|
||||
@@ -126,13 +236,12 @@
|
||||
style="@style/TextStyle.Alignment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="@dimen/rc_margin_size_16"
|
||||
android:layout_marginEnd="@dimen/rc_margin_size_12"
|
||||
android:text="3 月 22 日"
|
||||
android:textColor="@color/rc_auxiliary_color"
|
||||
android:textSize="@dimen/rc_font_nav_or_date_size"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
android:textSize="@dimen/rc_font_nav_or_date_size" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rc_conversation_no_disturb"
|
||||
@@ -142,6 +251,7 @@
|
||||
android:layout_marginBottom="@dimen/rc_margin_size_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:visibility="gone"
|
||||
app:srcCompat="@drawable/rc_no_disturb" />
|
||||
|
||||
|
||||
@@ -150,8 +260,9 @@
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginTop="71.5dp"
|
||||
android:background="@color/rc_divider_color"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="@id/rc_conversation_linear"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</RelativeLayout>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
live/src/main/res/mipmap-xxxhdpi/news_icon_clearance.png
Normal file
BIN
live/src/main/res/mipmap-xxxhdpi/news_icon_clearance.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
BIN
live/src/main/res/mipmap-xxxhdpi/white_bg.jpg
Normal file
BIN
live/src/main/res/mipmap-xxxhdpi/white_bg.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Reference in New Issue
Block a user