直播间消息列表
This commit is contained in:
parent
b5d4b88753
commit
5d0f29db42
@ -176,7 +176,7 @@ dependencies {
|
||||
//腾讯im
|
||||
api 'com.tencent.imsdk:imsdk-plus:5.4.666'
|
||||
api 'com.google.code.gson:gson:2.8.8'
|
||||
api 'cn.rongcloud.sdk:rtc_lib:5.6.9' // 音视频通话基础能力库
|
||||
api 'cn.rongcloud.sdk:rtc_lib:5.7.0' // 音视频通话基础能力库
|
||||
//此处以集成 5.1.2 版本为例
|
||||
api 'cn.rongcloud.sdk:im_lib:5.7.0'
|
||||
|
||||
|
@ -1,10 +1,9 @@
|
||||
package com.yunbao.main.adapter;
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@ -14,26 +13,19 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.yunbao.common.bean.MainMessageChatListTimer;
|
||||
import com.yunbao.common.dialog.DebugDialog;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnRecyclerListRefreshListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.message.content.MessageChatCardContent;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.DateFormatUtil;
|
||||
import com.yunbao.common.utils.ListUtils;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.ViewUtils;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.main.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -44,11 +36,9 @@ import io.rong.imkit.conversationlist.model.BaseUiConversation;
|
||||
import io.rong.imkit.conversationlist.model.SingleConversation;
|
||||
import io.rong.imkit.utils.RouteUtils;
|
||||
import io.rong.imkit.widget.adapter.ViewHolder;
|
||||
import io.rong.imkit.widget.refresh.listener.OnRefreshListener;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.imlib.model.MessageContent;
|
||||
import io.rong.message.TextMessage;
|
||||
|
||||
public class MainConversationListAdapter extends ConversationListAdapter {
|
@ -1,4 +1,4 @@
|
||||
package com.yunbao.main.fragment;
|
||||
package com.yunbao.common.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
@ -9,15 +9,10 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.bean.MainMessageChatListTimer;
|
||||
import com.yunbao.common.dialog.DebugDialog;
|
||||
import com.yunbao.common.event.MessageIMEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnRecyclerListRefreshListener;
|
||||
import com.yunbao.common.manager.base.ACache;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.main.adapter.MainConversationListAdapter;
|
||||
import com.yunbao.common.adapter.MainConversationListAdapter;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@ -27,21 +22,15 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import io.rong.imkit.conversationlist.model.BaseUiConversation;
|
||||
import io.rong.imkit.widget.refresh.SmartRefreshLayout;
|
||||
import io.rong.imlib.RongCoreClient;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.imlib.model.ReceivedProfile;
|
||||
import io.rong.message.TextMessage;
|
||||
|
||||
public abstract class AbsMainMessageChatListFragment extends Fragment {
|
||||
RecyclerView recyclerView;
|
||||
MainConversationListAdapter mAdapter;
|
||||
SmartRefreshLayout refreshLayout;
|
||||
public RecyclerView recyclerView;
|
||||
public MainConversationListAdapter mAdapter;
|
||||
public SmartRefreshLayout refreshLayout;
|
||||
|
||||
public void setAdapter(MainConversationListAdapter mAdapter) {
|
||||
this.mAdapter = mAdapter;
|
@ -1,4 +1,4 @@
|
||||
package com.yunbao.main.fragment;
|
||||
package com.yunbao.common.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
@ -10,16 +10,18 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.lifecycle.Observer;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.MainConversationListAdapter;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.adapter.MainConversationListAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.common.rlog.RLog;
|
||||
import io.rong.imkit.conversationlist.ConversationListAdapter;
|
||||
import io.rong.imkit.conversationlist.ConversationListFragment;
|
||||
import io.rong.imkit.conversationlist.model.BaseUiConversation;
|
||||
@ -45,8 +47,6 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
Log.i(TAG, "onViewCreated:创建融云页面");
|
||||
mConversationListViewModel.getConversationListLiveData().observe(this.getViewLifecycleOwner(), new Observer<List<BaseUiConversation>>() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onChanged(List<BaseUiConversation> uiConversations) {
|
||||
if (listHashCode != uiConversations.hashCode()) {
|
||||
@ -119,6 +119,7 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
}
|
||||
list.addAll(data);
|
||||
getChatRecordList(list, search);
|
||||
L.eSw(new Gson().toJson(list));
|
||||
}
|
||||
|
||||
private void getChatRecordList(List<BaseUiConversation> list, String search) {
|
||||
@ -156,8 +157,6 @@ public class MainMessageChatFragment extends ConversationListFragment {
|
||||
mAdapter.setDataCollection(list);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void onChatList() {
|
@ -1,4 +1,4 @@
|
||||
package com.yunbao.main.fragment;
|
||||
package com.yunbao.common.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
@ -6,21 +6,18 @@ import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.interfaces.OnRecyclerListRefreshListener;
|
||||
import com.yunbao.common.manager.InstructorRemarkManager;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.live.R;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -29,9 +26,8 @@ import io.rong.imkit.conversationlist.model.BaseUiConversation;
|
||||
public class MainMessageChatListFragment extends AbsMainMessageChatListFragment {
|
||||
private static final String TAG = "MainMessageChatListFragment";
|
||||
private Context mContext;
|
||||
|
||||
public MainMessageChatListFragment() {
|
||||
this.mContext = AppManager.getInstance().getMainActivity();
|
||||
public MainMessageChatListFragment(Context mContext) {
|
||||
this.mContext =mContext;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@ -50,8 +46,8 @@ public class MainMessageChatListFragment extends AbsMainMessageChatListFragment
|
||||
setAdapter(conversationListFragment.getAdapter());
|
||||
FragmentManager manager = ((FragmentActivity) mContext).getSupportFragmentManager();
|
||||
FragmentTransaction transaction = manager.beginTransaction();
|
||||
transaction.replace(R.id.container, conversationListFragment);
|
||||
transaction.commit();
|
||||
transaction.replace(view.findViewById(R.id.container).getId(), conversationListFragment);
|
||||
transaction.commitAllowingStateLoss();
|
||||
//自定义空数据背景View
|
||||
//conversationListFragment.setEmptyView(emptyView);
|
||||
conversationListFragment.setEmptyView(R.layout.view_layout_msg);
|
@ -0,0 +1,51 @@
|
||||
package com.yunbao.common.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.lifecycle.Observer;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.MainConversationListAdapter;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imkit.conversationlist.ConversationListAdapter;
|
||||
import io.rong.imkit.conversationlist.ConversationListFragment;
|
||||
import io.rong.imkit.conversationlist.model.BaseUiConversation;
|
||||
import io.rong.imkit.conversationlist.model.SingleConversation;
|
||||
import io.rong.imkit.event.Event;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.SearchConversationResult;
|
||||
|
||||
public class MainMessageRecommendFragment extends ConversationListFragment {
|
||||
|
||||
@Nullable
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.msg_main_recommend_list_fragment, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
90
common/src/main/res/layout/msg_main_recommend_item.xml
Normal file
90
common/src/main/res/layout/msg_main_recommend_item.xml
Normal file
@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/rc_conversation_item"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="@dimen/rc_conversation_item_height">
|
||||
<RelativeLayout
|
||||
android:id="@+id/rc_conversation_portrait_rl"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
>
|
||||
|
||||
<com.yunbao.common.views.weight.ClipPathCircleImage
|
||||
android:id="@+id/rc_conversation_portrait"
|
||||
android:layout_width="54dp"
|
||||
android:layout_height="54dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/beauty_jingbai" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rc_conversation_unread"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rc_conversation_unread_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@drawable/rc_unread_count_bg_normal" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_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="@dimen/rc_font_auxiliary_size" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_title"
|
||||
style="@style/TextStyle.Alignment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxWidth="120dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/rc_text_main_color"
|
||||
android:textSize="@dimen/rc_font_secondary_size"
|
||||
tools:text="张三11111111111111111111111" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="25dp"
|
||||
android:singleLine="true"
|
||||
android:textSize="8sp"
|
||||
android:visibility="visible"
|
||||
tools:text="在线" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/rc_conversation_status_icon"
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="5dp"
|
||||
android:src="@color/green_81c160"
|
||||
android:layout_marginTop="25dp"
|
||||
android:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:gravity="bottom"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<io.rong.imkit.widget.refresh.SmartRefreshLayout
|
||||
android:id="@+id/rc_refresh"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rc_conversation_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
tools:listitem="@layout/msg_main_recommend_item" />
|
||||
</io.rong.imkit.widget.refresh.SmartRefreshLayout>
|
||||
</LinearLayout>
|
@ -2,7 +2,7 @@
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="280dp"
|
||||
android:layout_height="440dp"
|
||||
android:layout_height="350dp"
|
||||
android:orientation="vertical"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="16dp">
|
||||
@ -248,6 +248,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="29dp"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="29dp"
|
||||
android:gravity="center_vertical">
|
||||
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
@ -1468,4 +1468,10 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="activity_msg_chat_top_status_online">Online</string>
|
||||
<string name="activity_msg_chat_top_status_offline">Offline</string>
|
||||
<string name="commen_user_active">Personal updates</string>
|
||||
|
||||
<string name="activity_msg_list_title_contacts">Contacts</string>
|
||||
<string name="activity_msg_chat_list_card">[In-app sharing]</string>
|
||||
<string name="activity_msg_list_include">Include:</string>
|
||||
<string name="message_chat_msg_look_live">看直播%dmin</string>
|
||||
<string name="activity_msg_list_title_chat_records">Chat Records</string>
|
||||
</resources>
|
||||
|
@ -1550,4 +1550,9 @@
|
||||
<string name="pking_over">主播正在PK,稍後再試</string>
|
||||
<string name="guard_buy_tips_1">您將花費%s鑽石,為主播開通</string>
|
||||
<string name="prank_complete">完成*1</string>
|
||||
<string name="activity_msg_list_title_contacts">聯繫人</string>
|
||||
<string name="activity_msg_chat_list_card">[站内分享]</string>
|
||||
<string name="activity_msg_list_include">包含:</string>
|
||||
<string name="message_chat_msg_look_live">看直播%dmin</string>
|
||||
<string name="activity_msg_list_title_chat_records">聊天記錄</string>
|
||||
</resources>
|
||||
|
@ -1550,4 +1550,9 @@
|
||||
<string name="pking_over">主播正在PK,稍後再試</string>
|
||||
<string name="guard_buy_tips_1">您將花費%s鑽石,為主播開通</string>
|
||||
<string name="prank_complete">完成*1</string>
|
||||
<string name="activity_msg_list_title_contacts">聯繫人</string>
|
||||
<string name="activity_msg_chat_list_card">[站内分享]</string>
|
||||
<string name="activity_msg_list_include">包含:</string>
|
||||
<string name="message_chat_msg_look_live">看直播%dmin</string>
|
||||
<string name="activity_msg_list_title_chat_records">聊天記錄</string>
|
||||
</resources>
|
||||
|
@ -1548,4 +1548,9 @@
|
||||
<string name="pking_over">主播正在PK,稍後再試</string>
|
||||
<string name="guard_buy_tips_1">您將花費%s鑽石,為主播開通</string>
|
||||
<string name="prank_complete">完成*1</string>
|
||||
<string name="activity_msg_list_title_contacts">聯繫人</string>
|
||||
<string name="activity_msg_chat_list_card">[站内分享]</string>
|
||||
<string name="activity_msg_list_include">包含:</string>
|
||||
<string name="message_chat_msg_look_live">看直播%dmin</string>
|
||||
<string name="activity_msg_list_title_chat_records">聊天記錄</string>
|
||||
</resources>
|
||||
|
@ -1572,4 +1572,9 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="main_type_theater" >Theater</string>
|
||||
<string name="pking_over">The anchor is in PK, please try again later</string>
|
||||
<string name="prank_complete">once</string>
|
||||
<string name="activity_msg_list_title_contacts">Contacts</string>
|
||||
<string name="activity_msg_chat_list_card">[In-app sharing]</string>
|
||||
<string name="activity_msg_list_include">Include:</string>
|
||||
<string name="message_chat_msg_look_live">看直播%dmin</string>
|
||||
<string name="activity_msg_list_title_chat_records">Chat Records</string>
|
||||
</resources>
|
||||
|
@ -24,6 +24,6 @@ android.nonTransitiveRClass=false
|
||||
|
||||
systemProp.http.proxyHost=127.0.0.1
|
||||
systemProp.https.proxyHost=127.0.0.1
|
||||
systemProp.https.proxyPort=7890
|
||||
systemProp.http.proxyPort=7890
|
||||
systemProp.https.proxyPort=10809
|
||||
systemProp.http.proxyPort=10809
|
||||
#android.enableR8.fullMode=true
|
@ -77,6 +77,7 @@ import com.yunbao.live.dialog.LiveRedPackListDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveRedPackSendDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveShareDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveUserAnchorMailBoxPopDialog;
|
||||
import com.yunbao.live.dialog.LiveUserAnchorMsgPopDialog;
|
||||
import com.yunbao.live.dialog.LiveUserDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveUserMoreDialogFragment;
|
||||
import com.yunbao.live.presenter.LiveLinkMicAnchorPresenter;
|
||||
@ -989,6 +990,13 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
new LiveUserAnchorMailBoxPopDialog(mContext).showDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户端打开聊天列表页面
|
||||
*/
|
||||
public void openLiveMsgWindow() {
|
||||
LiveUserAnchorMsgPopDialog fragment = new LiveUserAnchorMsgPopDialog();
|
||||
fragment.show(((LiveActivity) mContext).getSupportFragmentManager(), "LiveUserAnchorMsgPopDialog");
|
||||
}
|
||||
|
||||
/**
|
||||
* 发 弹幕 消息
|
||||
|
@ -0,0 +1,159 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.fragment.AbsMainMessageChatListFragment;
|
||||
import com.yunbao.common.fragment.MainMessageChatListFragment;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
import com.yunbao.common.utils.ViewPageIndicatorUtils;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
|
||||
import net.lucode.hackware.magicindicator.MagicIndicator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorTransitionPagerTitleView;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.SimplePagerTitleView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 直播间用户消息列表
|
||||
*/
|
||||
public class LiveUserAnchorMsgPopDialog extends AbsDialogFragment {
|
||||
private ViewPager2 viewPager;
|
||||
private MagicIndicator mIndicator;
|
||||
private List<AbsMainMessageChatListFragment> fragmentList;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.dialog_live_user_msg;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDialogStyle() {
|
||||
return R.style.dialog2;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canCancel() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setWindowAttributes(Window window) {
|
||||
window.setWindowAnimations(R.style.bottomToTopAnim);
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
window.setWindowAnimations(R.style.bottomToTopAnim);
|
||||
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
params.height = (int) (ScreenDimenUtil.getInstance().getScreenHeight()*0.6);
|
||||
params.gravity = Gravity.BOTTOM;
|
||||
window.setAttributes(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
mIndicator = (MagicIndicator) findViewById(R.id.indicator);
|
||||
viewPager = (ViewPager2) findViewById(R.id.viewPager);
|
||||
fragmentList = new ArrayList<>();
|
||||
fragmentList.add(new MainMessageChatListFragment(AppManager.getInstance().getLiveActivity()));
|
||||
viewPager.setAdapter(new FragmentStateAdapter((FragmentActivity) AppManager.getInstance().getLiveActivity()) {
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return fragmentList.size();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int i) {
|
||||
return fragmentList.get(i);
|
||||
}
|
||||
});
|
||||
viewPager.setCurrentItem(0);
|
||||
viewPager.setUserInputEnabled(false);
|
||||
initIndicator();
|
||||
initData();
|
||||
}
|
||||
/**
|
||||
* 初始化数据
|
||||
*/
|
||||
private void initData() {
|
||||
IMLoginManager.get(mContext).checkInstructor();
|
||||
MessageIMManager.get(mContext).getSystemMessages();
|
||||
}
|
||||
private void initIndicator() {
|
||||
final String[] titles = new String[]{
|
||||
WordUtil.getNewString(R.string.message_chat_msg_all),
|
||||
};
|
||||
CommonNavigator commonNavigator = new CommonNavigator(AppManager.getInstance().getLiveActivity());
|
||||
commonNavigator.setAdjustMode(true);
|
||||
commonNavigator.setAdapter(new CommonNavigatorAdapter() {
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return titles.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPagerTitleView getTitleView(Context context, final int index) {
|
||||
SimplePagerTitleView simplePagerTitleView = new ColorTransitionPagerTitleView(context);
|
||||
simplePagerTitleView.setNormalColor(Color.parseColor("#777777"));
|
||||
simplePagerTitleView.setSelectedColor(Color.parseColor("#333333"));
|
||||
simplePagerTitleView.setText(titles[index]);
|
||||
simplePagerTitleView.setTextSize(18);
|
||||
simplePagerTitleView.getPaint().setFakeBoldText(true);
|
||||
simplePagerTitleView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (viewPager != null) {
|
||||
viewPager.setCurrentItem(index);
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
return simplePagerTitleView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPagerIndicator getIndicator(Context context) {
|
||||
LinePagerIndicator linePagerIndicator = new LinePagerIndicator(context);
|
||||
linePagerIndicator.setMode(LinePagerIndicator.MODE_WRAP_CONTENT);
|
||||
linePagerIndicator.setXOffset(DpUtil.dp2px(5));
|
||||
linePagerIndicator.setRoundRadius(DpUtil.dp2px(2));
|
||||
linePagerIndicator.setColors(Color.parseColor("#EB6FFF"), Color.parseColor("#FF83C6"));
|
||||
return linePagerIndicator;
|
||||
}
|
||||
});
|
||||
mIndicator.setNavigator(commonNavigator);
|
||||
ViewPageIndicatorUtils.bind(mIndicator, viewPager, new ViewPager2.OnPageChangeCallback() {
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
super.onPageSelected(position);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -9,6 +9,7 @@ import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.views.AbsViewHolder;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
@ -38,8 +39,13 @@ public abstract class AbsLiveViewHolder extends AbsViewHolder implements View.On
|
||||
public void onClick(View v) {
|
||||
int i = v.getId();
|
||||
if (i == R.id.btn_msg) {
|
||||
MobclickAgent.onEvent(mContext, "live_room_envelope", "直播间信封按钮");
|
||||
((LiveActivity) mContext).openChatListWindow();
|
||||
if(mContext instanceof LiveAudienceActivity){
|
||||
//MobclickAgent.onEvent(mContext, "live_room_envelope", "直播间信封按钮");
|
||||
((LiveActivity) mContext).openLiveMsgWindow();
|
||||
}else{
|
||||
MobclickAgent.onEvent(mContext, "live_room_envelope", "直播间信封按钮");
|
||||
((LiveActivity) mContext).openChatListWindow();
|
||||
}
|
||||
} else if (i == R.id.et_input) {
|
||||
MobclickAgent.onEvent(mContext, "live_room_chat_btn", "直播间点开最下面的聊天按钮");
|
||||
((LiveActivity) mContext).openChatWindow();
|
||||
|
@ -303,7 +303,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
ivLoading = mRootContainer.findViewById(R.id.iv_loading);
|
||||
mSecondPage = (ViewGroup) LayoutInflater.from(mContext).inflate(R.layout.view_audience_page, mViewPager, false);
|
||||
mContainerWrap = mSecondPage.findViewById(R.id.container_wrap);
|
||||
mContainer = mSecondPage.findViewById(R.id.container);
|
||||
mContainer = mSecondPage.findViewById(R.id.container11);
|
||||
btnSmallScreen.setOnClickListener(v -> {
|
||||
mViewPager.setCurrentItem(1);
|
||||
btnSmallScreen.setVisibility(View.GONE);
|
||||
@ -637,8 +637,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
//心愿单顶部bannner
|
||||
mLiveRoomViewHolder.setWishListProgress(data.getWishListProgress());
|
||||
//初始化顶部banner
|
||||
mLiveRoomViewHolder.initTopBanner();
|
||||
mLiveRoomViewHolder.updateTopBanner();
|
||||
//mLiveRoomViewHolder.initTopBanner();
|
||||
//mLiveRoomViewHolder.updateTopBanner();
|
||||
mLiveRoomViewHolder.setVoteData(data.getEnterRoomInfo().getVoteModel());
|
||||
mLiveRoomViewHolder.updateFansMessageRed();
|
||||
mLiveRoomViewHolder.setFansGroup(data.getEnterRoomInfo().getIsFans());
|
||||
|
21
live/src/main/res/layout/dialog_live_user_msg.xml
Normal file
21
live/src/main/res/layout/dialog_live_user_msg.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<net.lucode.hackware.magicindicator.MagicIndicator
|
||||
android:id="@+id/indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="37dp"
|
||||
android:visibility="visible" />
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/viewPager"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/green_81c160"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
</LinearLayout>
|
@ -12,7 +12,7 @@
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/container"
|
||||
android:id="@+id/container11"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
|
@ -290,6 +290,7 @@
|
||||
<!--消息中心-->
|
||||
<RelativeLayout
|
||||
android:id="@+id/msg_view"
|
||||
android:visibility="visible"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
@ -240,6 +240,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:visibility="gone"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
|
@ -10,10 +10,9 @@ import android.view.ViewGroup;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.yunbao.common.bean.MessageChatUserBean;
|
||||
import com.yunbao.common.fragment.AbsMainMessageChatListFragment;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnRecyclerListRefreshListener;
|
||||
@ -23,7 +22,7 @@ import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.adapter.MainConversationListAdapter;
|
||||
import com.yunbao.common.adapter.MainConversationListAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -32,11 +31,9 @@ import java.util.Map;
|
||||
import io.rong.imkit.conversationlist.model.BaseUiConversation;
|
||||
import io.rong.imkit.conversationlist.model.SingleConversation;
|
||||
import io.rong.imkit.userinfo.RongUserInfoManager;
|
||||
import io.rong.imkit.userinfo.UserDataProvider;
|
||||
import io.rong.imkit.utils.RouteUtils;
|
||||
import io.rong.imkit.widget.adapter.BaseAdapter;
|
||||
import io.rong.imkit.widget.adapter.ViewHolder;
|
||||
import io.rong.imkit.widget.refresh.SmartRefreshLayout;
|
||||
import io.rong.imkit.widget.refresh.api.RefreshLayout;
|
||||
import io.rong.imkit.widget.refresh.listener.OnLoadMoreListener;
|
||||
import io.rong.imkit.widget.refresh.listener.OnRefreshListener;
|
||||
|
@ -10,9 +10,9 @@ import android.view.ViewGroup;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.bean.MessageChatUserBean;
|
||||
import com.yunbao.common.fragment.AbsMainMessageChatListFragment;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnRecyclerListRefreshListener;
|
||||
@ -21,7 +21,7 @@ import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.adapter.MainConversationListAdapter;
|
||||
import com.yunbao.common.adapter.MainConversationListAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -33,7 +33,6 @@ import io.rong.imkit.userinfo.RongUserInfoManager;
|
||||
import io.rong.imkit.utils.RouteUtils;
|
||||
import io.rong.imkit.widget.adapter.BaseAdapter;
|
||||
import io.rong.imkit.widget.adapter.ViewHolder;
|
||||
import io.rong.imkit.widget.refresh.SmartRefreshLayout;
|
||||
import io.rong.imkit.widget.refresh.api.RefreshLayout;
|
||||
import io.rong.imkit.widget.refresh.listener.OnLoadMoreListener;
|
||||
import io.rong.imkit.widget.refresh.listener.OnRefreshListener;
|
||||
|
@ -6,8 +6,6 @@ import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Handler;
|
||||
import android.text.Editable;
|
||||
import android.text.InputFilter;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
@ -35,10 +33,6 @@ import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.dialog.DebugDialog;
|
||||
import com.yunbao.common.manager.base.ACache;
|
||||
import com.yunbao.common.utils.DateFormatUtil;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.bean.ImUserInfoModel;
|
||||
@ -68,8 +62,8 @@ import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.MainActivity;
|
||||
import com.yunbao.main.adapter.SystemMessageAdapter;
|
||||
import com.yunbao.main.dialog.MsgMoreDialog;
|
||||
import com.yunbao.main.fragment.AbsMainMessageChatListFragment;
|
||||
import com.yunbao.main.fragment.MainMessageChatListFragment;
|
||||
import com.yunbao.common.fragment.AbsMainMessageChatListFragment;
|
||||
import com.yunbao.common.fragment.MainMessageChatListFragment;
|
||||
import com.yunbao.main.fragment.MainMessageChatListSystemFragment;
|
||||
import com.yunbao.main.fragment.MainMessageChatListUserFragment;
|
||||
import com.yunbao.main.manager.imrongcloud.ConversationIMListManager;
|
||||
@ -89,7 +83,6 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@ -207,7 +200,7 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
|
||||
private void initFragment() {
|
||||
fragmentList = new ArrayList<>();
|
||||
fragmentList.add(new MainMessageChatListFragment());
|
||||
fragmentList.add(new MainMessageChatListFragment(AppManager.getInstance().getMainActivity()));
|
||||
fragmentList.add(new MainMessageChatListSystemFragment());
|
||||
fragmentList.add(new MainMessageChatListUserFragment());
|
||||
|
||||
|
@ -301,7 +301,6 @@
|
||||
android:id="@+id/indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="37dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/line" />
|
||||
|
@ -27,8 +27,6 @@
|
||||
<string name="activity_msg_newts_interaction">互動消息</string>
|
||||
<string name="activity_msg_news_online">在線客服</string>
|
||||
<string name="activity_msg_search_hint">搜索</string>
|
||||
<string name="activity_msg_list_include">包含:</string>
|
||||
<string name="activity_msg_list_title_contacts">聯繫人</string>
|
||||
<string name="activity_msg_list_title_chat_records">聊天記錄</string>
|
||||
<string name="activity_msg_addressbook_layout_title">通訊錄</string>
|
||||
<string name="activity_msg_addressbook_search_hint">搜索昵稱</string>
|
||||
|
@ -27,8 +27,6 @@
|
||||
<string name="activity_msg_newts_interaction">Chats</string>
|
||||
<string name="activity_msg_news_online">Service</string>
|
||||
<string name="activity_msg_search_hint">Search</string>
|
||||
<string name="activity_msg_list_include">Include:</string>
|
||||
<string name="activity_msg_list_title_contacts">Contacts</string>
|
||||
<string name="activity_msg_list_title_chat_records">Chat Records</string>
|
||||
<string name="activity_msg_addressbook_layout_title">Address Book</string>
|
||||
<string name="activity_msg_addressbook_search_hint">Search</string>
|
||||
|
Loading…
Reference in New Issue
Block a user