diff --git a/common/build.gradle b/common/build.gradle index baf45358f..758311bf3 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -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' diff --git a/main/src/main/java/com/yunbao/main/adapter/MainConversationListAdapter.java b/common/src/main/java/com/yunbao/common/adapter/MainConversationListAdapter.java similarity index 96% rename from main/src/main/java/com/yunbao/main/adapter/MainConversationListAdapter.java rename to common/src/main/java/com/yunbao/common/adapter/MainConversationListAdapter.java index 6d4231eb0..c746da32d 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MainConversationListAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/MainConversationListAdapter.java @@ -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 { diff --git a/main/src/main/java/com/yunbao/main/fragment/AbsMainMessageChatListFragment.java b/common/src/main/java/com/yunbao/common/fragment/AbsMainMessageChatListFragment.java similarity index 85% rename from main/src/main/java/com/yunbao/main/fragment/AbsMainMessageChatListFragment.java rename to common/src/main/java/com/yunbao/common/fragment/AbsMainMessageChatListFragment.java index 9fb577525..6cc8c97ae 100644 --- a/main/src/main/java/com/yunbao/main/fragment/AbsMainMessageChatListFragment.java +++ b/common/src/main/java/com/yunbao/common/fragment/AbsMainMessageChatListFragment.java @@ -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; diff --git a/main/src/main/java/com/yunbao/main/fragment/MainMessageChatFragment.java b/common/src/main/java/com/yunbao/common/fragment/MainMessageChatFragment.java similarity index 96% rename from main/src/main/java/com/yunbao/main/fragment/MainMessageChatFragment.java rename to common/src/main/java/com/yunbao/common/fragment/MainMessageChatFragment.java index 64369d4b6..5cafa6dcc 100644 --- a/main/src/main/java/com/yunbao/main/fragment/MainMessageChatFragment.java +++ b/common/src/main/java/com/yunbao/common/fragment/MainMessageChatFragment.java @@ -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>() { - - @Override public void onChanged(List 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 list, String search) { @@ -156,8 +157,6 @@ public class MainMessageChatFragment extends ConversationListFragment { mAdapter.setDataCollection(list); } }); - - } public void onChatList() { diff --git a/main/src/main/java/com/yunbao/main/fragment/MainMessageChatListFragment.java b/common/src/main/java/com/yunbao/common/fragment/MainMessageChatListFragment.java similarity index 87% rename from main/src/main/java/com/yunbao/main/fragment/MainMessageChatListFragment.java rename to common/src/main/java/com/yunbao/common/fragment/MainMessageChatListFragment.java index 8b24e9695..3d8da397d 100644 --- a/main/src/main/java/com/yunbao/main/fragment/MainMessageChatListFragment.java +++ b/common/src/main/java/com/yunbao/common/fragment/MainMessageChatListFragment.java @@ -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); diff --git a/common/src/main/java/com/yunbao/common/fragment/MainMessageRecommendFragment.java b/common/src/main/java/com/yunbao/common/fragment/MainMessageRecommendFragment.java new file mode 100644 index 000000000..0c72d07a3 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/fragment/MainMessageRecommendFragment.java @@ -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); + + } + + + + + + +} diff --git a/main/src/main/res/drawable/bg_msg_list_item.xml b/common/src/main/res/drawable/bg_msg_list_item.xml similarity index 100% rename from main/src/main/res/drawable/bg_msg_list_item.xml rename to common/src/main/res/drawable/bg_msg_list_item.xml diff --git a/main/src/main/res/drawable/bg_msg_list_item_bottom.xml b/common/src/main/res/drawable/bg_msg_list_item_bottom.xml similarity index 100% rename from main/src/main/res/drawable/bg_msg_list_item_bottom.xml rename to common/src/main/res/drawable/bg_msg_list_item_bottom.xml diff --git a/main/src/main/res/drawable/bg_msg_list_item_centre.xml b/common/src/main/res/drawable/bg_msg_list_item_centre.xml similarity index 100% rename from main/src/main/res/drawable/bg_msg_list_item_centre.xml rename to common/src/main/res/drawable/bg_msg_list_item_centre.xml diff --git a/main/src/main/res/drawable/bg_msg_list_item_top.xml b/common/src/main/res/drawable/bg_msg_list_item_top.xml similarity index 100% rename from main/src/main/res/drawable/bg_msg_list_item_top.xml rename to common/src/main/res/drawable/bg_msg_list_item_top.xml diff --git a/live/src/main/res/layout/fragment_main_message_chat_list.xml b/common/src/main/res/layout/fragment_main_message_chat_list.xml similarity index 100% rename from live/src/main/res/layout/fragment_main_message_chat_list.xml rename to common/src/main/res/layout/fragment_main_message_chat_list.xml diff --git a/main/src/main/res/layout/item_main_msg_search_chat.xml b/common/src/main/res/layout/item_main_msg_search_chat.xml similarity index 100% rename from main/src/main/res/layout/item_main_msg_search_chat.xml rename to common/src/main/res/layout/item_main_msg_search_chat.xml diff --git a/main/src/main/res/layout/item_main_msg_search_title.xml b/common/src/main/res/layout/item_main_msg_search_title.xml similarity index 100% rename from main/src/main/res/layout/item_main_msg_search_title.xml rename to common/src/main/res/layout/item_main_msg_search_title.xml diff --git a/main/src/main/res/layout/item_main_msg_search_user.xml b/common/src/main/res/layout/item_main_msg_search_user.xml similarity index 100% rename from main/src/main/res/layout/item_main_msg_search_user.xml rename to common/src/main/res/layout/item_main_msg_search_user.xml diff --git a/common/src/main/res/layout/msg_main_recommend_item.xml b/common/src/main/res/layout/msg_main_recommend_item.xml new file mode 100644 index 000000000..2594d56a9 --- /dev/null +++ b/common/src/main/res/layout/msg_main_recommend_item.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/msg_main_recommend_list_fragment.xml b/common/src/main/res/layout/msg_main_recommend_list_fragment.xml new file mode 100644 index 000000000..2844c7f9a --- /dev/null +++ b/common/src/main/res/layout/msg_main_recommend_list_fragment.xml @@ -0,0 +1,23 @@ + + + + + + + + diff --git a/main/src/main/res/layout/rc_conversationlist_fragment.xml b/common/src/main/res/layout/rc_conversationlist_fragment.xml similarity index 100% rename from main/src/main/res/layout/rc_conversationlist_fragment.xml rename to common/src/main/res/layout/rc_conversationlist_fragment.xml diff --git a/live/src/main/res/layout/rc_conversationlist_item.xml b/common/src/main/res/layout/rc_conversationlist_item.xml similarity index 100% rename from live/src/main/res/layout/rc_conversationlist_item.xml rename to common/src/main/res/layout/rc_conversationlist_item.xml diff --git a/common/src/main/res/layout/view_live_open.xml b/common/src/main/res/layout/view_live_open.xml index 54aba0a57..18c987669 100644 --- a/common/src/main/res/layout/view_live_open.xml +++ b/common/src/main/res/layout/view_live_open.xml @@ -2,7 +2,7 @@ @@ -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"> diff --git a/live/src/main/res/mipmap-mdpi/beauty_jingbai.png b/common/src/main/res/mipmap-mdpi/beauty_jingbai.png similarity index 100% rename from live/src/main/res/mipmap-mdpi/beauty_jingbai.png rename to common/src/main/res/mipmap-mdpi/beauty_jingbai.png diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index 89417111e..51b015de3 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1468,4 +1468,10 @@ Limited ride And limited avatar frame Online Offline Personal updates + + Contacts + [In-app sharing] + Include: + 看直播%dmin + Chat Records diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index d46a0ba17..5f22f4eb4 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1550,4 +1550,9 @@ 主播正在PK,稍後再試 您將花費%s鑽石,為主播開通 完成*1 + 聯繫人 + [站内分享] + 包含: + 看直播%dmin + 聊天記錄 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index 1c038f7c4..adcacec34 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1550,4 +1550,9 @@ 主播正在PK,稍後再試 您將花費%s鑽石,為主播開通 完成*1 + 聯繫人 + [站内分享] + 包含: + 看直播%dmin + 聊天記錄 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index a30e61716..8dee54329 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1548,4 +1548,9 @@ 主播正在PK,稍後再試 您將花費%s鑽石,為主播開通 完成*1 + 聯繫人 + [站内分享] + 包含: + 看直播%dmin + 聊天記錄 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 37e0c9595..804b365a5 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1572,4 +1572,9 @@ Limited ride And limited avatar frame Theater The anchor is in PK, please try again later once + Contacts + [In-app sharing] + Include: + 看直播%dmin + Chat Records diff --git a/gradle.properties b/gradle.properties index c41a7a913..5547a2720 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 \ No newline at end of file diff --git a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java index a5f335d3e..e130bbd06 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java @@ -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"); + } /** * 发 弹幕 消息 diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveUserAnchorMsgPopDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveUserAnchorMsgPopDialog.java new file mode 100644 index 000000000..2172f9d31 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/dialog/LiveUserAnchorMsgPopDialog.java @@ -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 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); + } + }); + } +} diff --git a/live/src/main/java/com/yunbao/live/views/AbsLiveViewHolder.java b/live/src/main/java/com/yunbao/live/views/AbsLiveViewHolder.java index 036739a01..8fd5702fa 100644 --- a/live/src/main/java/com/yunbao/live/views/AbsLiveViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/AbsLiveViewHolder.java @@ -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(); diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index 7fd444ca1..bf75a8e8d 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -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()); diff --git a/live/src/main/res/layout/dialog_live_user_msg.xml b/live/src/main/res/layout/dialog_live_user_msg.xml new file mode 100644 index 000000000..3883d576c --- /dev/null +++ b/live/src/main/res/layout/dialog_live_user_msg.xml @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/view_audience_page.xml b/live/src/main/res/layout/view_audience_page.xml index 97f9b9331..6e0204bc8 100644 --- a/live/src/main/res/layout/view_audience_page.xml +++ b/live/src/main/res/layout/view_audience_page.xml @@ -12,7 +12,7 @@ android:layout_height="match_parent"> diff --git a/live/src/main/res/layout/view_live_audience.xml b/live/src/main/res/layout/view_live_audience.xml index f3e474019..4d76af3ef 100644 --- a/live/src/main/res/layout/view_live_audience.xml +++ b/live/src/main/res/layout/view_live_audience.xml @@ -290,6 +290,7 @@ diff --git a/live/src/main/res/layout/view_new_live_ready.xml b/live/src/main/res/layout/view_new_live_ready.xml index 5b6a1682d..f0122898b 100644 --- a/live/src/main/res/layout/view_new_live_ready.xml +++ b/live/src/main/res/layout/view_new_live_ready.xml @@ -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" diff --git a/main/src/main/java/com/yunbao/main/fragment/MainMessageChatListSystemFragment.java b/main/src/main/java/com/yunbao/main/fragment/MainMessageChatListSystemFragment.java index d0a37f0aa..58f48eedb 100644 --- a/main/src/main/java/com/yunbao/main/fragment/MainMessageChatListSystemFragment.java +++ b/main/src/main/java/com/yunbao/main/fragment/MainMessageChatListSystemFragment.java @@ -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; diff --git a/main/src/main/java/com/yunbao/main/fragment/MainMessageChatListUserFragment.java b/main/src/main/java/com/yunbao/main/fragment/MainMessageChatListUserFragment.java index 1d5d7ba4d..cb992dbb2 100644 --- a/main/src/main/java/com/yunbao/main/fragment/MainMessageChatListUserFragment.java +++ b/main/src/main/java/com/yunbao/main/fragment/MainMessageChatListUserFragment.java @@ -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; diff --git a/main/src/main/java/com/yunbao/main/views/MainMessageViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainMessageViewHolder.java index 21ef7593d..8398e4e7b 100644 --- a/main/src/main/java/com/yunbao/main/views/MainMessageViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainMessageViewHolder.java @@ -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()); diff --git a/main/src/main/res/layout/view_main_message.xml b/main/src/main/res/layout/view_main_message.xml index 8c0a5280d..4e2b23189 100644 --- a/main/src/main/res/layout/view_main_message.xml +++ b/main/src/main/res/layout/view_main_message.xml @@ -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" /> diff --git a/main/src/main/res/values-zh/strings.xml b/main/src/main/res/values-zh/strings.xml index 2f6a5b752..b06dc17c5 100644 --- a/main/src/main/res/values-zh/strings.xml +++ b/main/src/main/res/values-zh/strings.xml @@ -27,8 +27,6 @@ 互動消息 在線客服 搜索 - 包含: - 聯繫人 聊天記錄 通訊錄 搜索昵稱 diff --git a/main/src/main/res/values/strings.xml b/main/src/main/res/values/strings.xml index dc3079726..177b07e29 100644 --- a/main/src/main/res/values/strings.xml +++ b/main/src/main/res/values/strings.xml @@ -27,8 +27,6 @@ Chats Service Search - Include: - Contacts Chat Records Address Book Search