From 520bcf541a858c160416548bb68ef0f327f946f8 Mon Sep 17 00:00:00 2001 From: jlayi <1241255445@qq.com> Date: Thu, 9 Jan 2025 15:55:28 +0800 Subject: [PATCH] 1.22.1 --- CHANGELOG.md | 31 + README.md | 5 +- build.gradle | 4 +- .../livedemo/PLVLoginWatcherActivity.java | 8 +- .../res/layout/plv_login_watcher_activity.xml | 3 +- .../src/main/res/values-b+zh+Hant/strings.xml | 1 - demo/src/main/res/values-ja/strings.xml | 1 - demo/src/main/res/values-ko/strings.xml | 1 - demo/src/main/res/values-zh/strings.xml | 1 - demo/src/main/res/values/strings.xml | 1 - .../controller/PLVLCLiveMediaController.java | 2 +- polyvLiveCommonModul/build.gradle | 2 +- .../module/data/IPLVLiveRoomDataManager.java | 12 + .../module/data/PLVLiveRoomDataManager.java | 23 + .../module/data/PLVLiveRoomDataRequester.java | 31 + .../ui/widget/PLVClipOutMaskView.java | 173 ++++++ .../src/main/res/values-b+zh+Hant/strings.xml | 5 + .../src/main/res/values-ja/strings.xml | 5 + .../src/main/res/values-ko/strings.xml | 5 + .../src/main/res/values-zh/strings.xml | 5 + .../src/main/res/values/attrs.xml | 5 + .../src/main/res/values/strings.xml | 5 + .../PLVLSNetworkDisconnectMaskLayout.java | 99 +++ .../scenes/PLVLSLiveStreamerActivity.java | 13 + .../plvls_network_disconnect_icon.png | Bin 0 -> 2482 bytes .../layout/plvls_live_streamer_activity.xml | 7 + .../plvls_network_disconnect_mask_layout.xml | 38 ++ .../chatroom/IPLVSAChatroomLayout.java | 5 + .../modules/chatroom/PLVSAChatroomLayout.java | 7 + .../chatroom/adapter/PLVSAMessageAdapter.java | 108 +++- .../PLVSALinkMicRequestTipsLayout.java | 159 +---- .../modules/liveroom/PLVSAMoreLayout.java | 87 ++- .../PLVSANetworkDisconnectMaskLayout.java | 85 +++ .../modules/liveroom/PLVSASettingLayout.java | 188 +++--- .../statusbar/IPLVSAStatusBarLayout.java | 17 +- .../statusbar/PLVSAStatusBarLayout.java | 139 ++++- .../scenes/PLVSAStreamerAloneActivity.java | 66 +- .../fragments/PLVSAStreamerHomeFragment.java | 74 +-- .../plvsa_gift_effect_close.png | Bin 0 -> 866 bytes .../drawable-xhdpi/plvsa_gift_effect_open.png | Bin 0 -> 1181 bytes .../plvsa_gift_reward_close.png | Bin 0 -> 798 bytes .../drawable-xhdpi/plvsa_gift_reward_open.png | Bin 0 -> 1037 bytes .../plvsa_live_replay_close.png | Bin 0 -> 1286 bytes .../drawable-xhdpi/plvsa_live_replay_open.png | Bin 0 -> 1265 bytes .../plvsa_live_room_setting_beauty_icon.png | Bin 1350 -> 1927 bytes .../plvsa_network_disconnect_icon.png | Bin 0 -> 2482 bytes .../drawable/plvsa_gift_effect_selector.xml | 5 + .../drawable/plvsa_gift_reward_selector.xml | 5 + .../drawable/plvsa_live_replay_selector.xml | 5 + .../layout/plvsa_streamer_alone_activity.xml | 13 +- ..._live_room_linkmic_request_tips_layout.xml | 48 +- .../layout/plvsa_live_room_more_layout.xml | 260 ++++---- .../layout/plvsa_live_room_setting_layout.xml | 570 +++++++++--------- .../plvsa_network_disconnect_mask_layout.xml | 38 ++ .../layout/plvsa_streamer_home_fragment.xml | 22 +- .../layout/plvsa_status_bar_layout.xml | 245 ++++---- .../src/main/res/values-zh/strings.xml | 2 +- 57 files changed, 1650 insertions(+), 984 deletions(-) create mode 100644 polyvLiveCommonModul/src/main/java/com/easefun/polyv/livecommon/ui/widget/PLVClipOutMaskView.java create mode 100644 polyvLiveStreamerScene/src/main/java/com/easefun/polyv/livestreamer/modules/liveroom/PLVLSNetworkDisconnectMaskLayout.java create mode 100644 polyvLiveStreamerScene/src/main/res/drawable-xhdpi/plvls_network_disconnect_icon.png create mode 100644 polyvLiveStreamerScene/src/main/res/layouts/liveroom/layout/plvls_network_disconnect_mask_layout.xml create mode 100644 polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/liveroom/PLVSANetworkDisconnectMaskLayout.java create mode 100644 polyvStreamerAloneScene/src/main/res/drawable-xhdpi/plvsa_gift_effect_close.png create mode 100644 polyvStreamerAloneScene/src/main/res/drawable-xhdpi/plvsa_gift_effect_open.png create mode 100644 polyvStreamerAloneScene/src/main/res/drawable-xhdpi/plvsa_gift_reward_close.png create mode 100644 polyvStreamerAloneScene/src/main/res/drawable-xhdpi/plvsa_gift_reward_open.png create mode 100644 polyvStreamerAloneScene/src/main/res/drawable-xhdpi/plvsa_live_replay_close.png create mode 100644 polyvStreamerAloneScene/src/main/res/drawable-xhdpi/plvsa_live_replay_open.png create mode 100644 polyvStreamerAloneScene/src/main/res/drawable-xhdpi/plvsa_network_disconnect_icon.png create mode 100644 polyvStreamerAloneScene/src/main/res/drawable/plvsa_gift_effect_selector.xml create mode 100644 polyvStreamerAloneScene/src/main/res/drawable/plvsa_gift_reward_selector.xml create mode 100644 polyvStreamerAloneScene/src/main/res/drawable/plvsa_live_replay_selector.xml create mode 100644 polyvStreamerAloneScene/src/main/res/layouts/liveroom/layout/plvsa_network_disconnect_mask_layout.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index 88ae2fe6..54cd658a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,34 @@ +## 【v1.22.1] - 2025-01-09 + +### 【手机开播(纯视频)场景】 + +新增: +1. 【推流】断流后页面增加常驻提示【Demo、Common】 +2. 【打赏】支持屏蔽打赏特效【Demo】 +3. 【打赏】支持开启/关闭礼物打赏【Demo、Common、SDK】 +4. 【回放】支持开播前设置回放开关【Demo、SDK】 + +优化: +1. 【UI】在线列表入口优化【Demo】 +2. 【UI】观众申请连麦提示优化【Demo】 +3. 【UI】开播前设置页优化【Demo】 +4. 【UI】根据参数隐藏"混流布局"、"横竖屏"【Demo、SDK】 + +### 【手机开播(三分屏)场景】 + +新增: +1. 【推流】断流后页面增加常驻提示【Demo、Common】 + +### 【观看端(云课堂)场景】 + +修复: +1. 【打赏】修复横屏礼物打赏响应开关失败问题【Demo】 + +### 【SDK】 + +优化: +1. 【RTC】RTC兼容低版本【SDK】 + ## 【v1.22.0] - 2024-12-10 ### 【手机开播(纯视频)场景】 diff --git a/README.md b/README.md index 5cfdd91c..7e6295fe 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ polyv-android-livescenes-sdk-demo === [![build passing](https://img.shields.io/badge/build-passing-brightgreen.svg)](#) -[![GitHub release](https://img.shields.io/badge/release-v1.22.0-blue.svg)](https://github.com/polyv/polyv-android-livescenes-sdk-demo/releases/tag/v1.22.0) +[![GitHub release](https://img.shields.io/badge/release-v1.22.1-blue.svg)](https://github.com/polyv/polyv-android-livescenes-sdk-demo/releases/tag/v1.22.1) @@ -66,7 +66,8 @@ Demo [下载链接](https://www.pgyer.com/Mb6m) (密码:polyv) | Github仓库Tag | 依赖SDK版本 | API文档 | Common层 | 观看端-云课堂场景 | 观看端-直播带货场景 | 开播端-手机开播三分屏场景 | 开播端-手机开播纯视频场景 | 互动学堂场景 | |-------------|------------|-------------------------------------------------------------------------------------------|---------|---------|----------|---------------|---------------|--------| -| 1.22.0 | 1.22.0 | [v1.22.0 API](http://repo.polyv.net/android/livescenes/javadoc/1.22.0/index.html) | ✅ | ✅ | ✅ | ✅ | ✅ | | +| 1.22.1 | 1.22.1 | [v1.22.1 API](http://repo.polyv.net/android/livescenes/javadoc/1.22.1/index.html) | ✅ | ✅ | | ✅ | ✅ | | +| 1.22.0 | 1.22.0 | [v1.22.0 API](http://repo.polyv.net/android/livescenes/javadoc/1.22.0/index.html) | ✅ | ✅ | ✅ | ✅ | ✅ | | | 1.21.0 | 1.21.0 | [v1.21.0 API](http://repo.polyv.net/android/livescenes/javadoc/1.21.0/index.html) | ✅ | | | ✅ | ✅ | | | 1.20.0 | 1.20.0 | [v1.20.0 API](http://repo.polyv.net/android/livescenes/javadoc/1.20.0/index.html) | ✅ | ✅ | ✅ | ✅ | ✅ | | | 1.19.1 | 1.19.1 | [v1.19.1 API](http://repo.polyv.net/android/livescenes/javadoc/1.19.1/index.html) | ✅ | ✅ | ✅ | | | | diff --git a/build.gradle b/build.gradle index 44c4f6a2..79027eaa 100644 --- a/build.gradle +++ b/build.gradle @@ -52,8 +52,8 @@ ext { compileSdkVersion = 31 minSdkVersion = 21 targetSdkVersion = 30 - versionCode = 1220 - versionName = "1.22.0" + versionCode = 1221 + versionName = "1.22.1" } task clean(type: Delete) { diff --git a/demo/src/main/java/com/easefun/polyv/livedemo/PLVLoginWatcherActivity.java b/demo/src/main/java/com/easefun/polyv/livedemo/PLVLoginWatcherActivity.java index e4778ceb..99fc80f7 100644 --- a/demo/src/main/java/com/easefun/polyv/livedemo/PLVLoginWatcherActivity.java +++ b/demo/src/main/java/com/easefun/polyv/livedemo/PLVLoginWatcherActivity.java @@ -1,6 +1,5 @@ package com.easefun.polyv.livedemo; -import static com.plv.foundationsdk.utils.PLVSugarUtil.format; import static com.plv.foundationsdk.utils.PLVSugarUtil.nullable; import android.app.ProgressDialog; @@ -50,6 +49,7 @@ import com.plv.thirdpart.blankj.utilcode.util.ToastUtils; import java.io.File; +import java.util.Calendar; /** * date: 2020-04-29 @@ -185,6 +185,7 @@ private void initView() { //默认选择直播 rlLiveGroupLayout.performClick(); + initCopyright(); initPlaybackCacheConfig(); initPlaybackCacheViewModel(); initMultiVenueViewModel(); @@ -312,6 +313,11 @@ public void onDismiss(DialogInterface dialog) { }); } + private void initCopyright() { + final int year = Calendar.getInstance().get(Calendar.YEAR); + tvCopyright.setText(""); + } + private void initPlaybackCacheConfig() { PLVDependManager.getInstance().get(PLVPlaybackCacheConfig.class) .setApplicationContext(getApplicationContext()) diff --git a/demo/src/main/res/layout/plv_login_watcher_activity.xml b/demo/src/main/res/layout/plv_login_watcher_activity.xml index 620346a7..61612f0a 100644 --- a/demo/src/main/res/layout/plv_login_watcher_activity.xml +++ b/demo/src/main/res/layout/plv_login_watcher_activity.xml @@ -2,6 +2,7 @@ + tools:text="Copyright" /> diff --git a/demo/src/main/res/values-b+zh+Hant/strings.xml b/demo/src/main/res/values-b+zh+Hant/strings.xml index 61d1d047..cd098c17 100644 --- a/demo/src/main/res/values-b+zh+Hant/strings.xml +++ b/demo/src/main/res/values-b+zh+Hant/strings.xml @@ -10,7 +10,6 @@ APP ID APP Secret 正在登录中,请稍等… - 2013 – 2023 易方信息科技股份有限公司 版权所有 手機開播 diff --git a/demo/src/main/res/values-ja/strings.xml b/demo/src/main/res/values-ja/strings.xml index 70007db2..914fb687 100644 --- a/demo/src/main/res/values-ja/strings.xml +++ b/demo/src/main/res/values-ja/strings.xml @@ -10,7 +10,6 @@ APP ID APP Secret 正在登录中,请稍等… - 2013 – 2023 易方信息科技股份有限公司 版权所有 携帯電話でスタート diff --git a/demo/src/main/res/values-ko/strings.xml b/demo/src/main/res/values-ko/strings.xml index 5a79fbd9..84046e3b 100644 --- a/demo/src/main/res/values-ko/strings.xml +++ b/demo/src/main/res/values-ko/strings.xml @@ -10,7 +10,6 @@ APP ID APP Secret 正在登录中,请稍等… - 2013 – 2023 易方信息科技股份有限公司 版权所有 휴대폰 방송 시작 diff --git a/demo/src/main/res/values-zh/strings.xml b/demo/src/main/res/values-zh/strings.xml index d0ed4d8c..28d3b6fc 100644 --- a/demo/src/main/res/values-zh/strings.xml +++ b/demo/src/main/res/values-zh/strings.xml @@ -10,7 +10,6 @@ APP ID APP Secret 正在登录中,请稍等… - 2013 – 2023 易方信息科技股份有限公司 版权所有 手机开播 diff --git a/demo/src/main/res/values/strings.xml b/demo/src/main/res/values/strings.xml index ca898be6..833a1afe 100644 --- a/demo/src/main/res/values/strings.xml +++ b/demo/src/main/res/values/strings.xml @@ -10,7 +10,6 @@ APP ID APP Secret 正在登录中,请稍等… - 2013 – 2023 易方信息科技股份有限公司 版权所有 Mobile Live Broadcast diff --git a/polyvLiveCloudClassScene/src/main/java/com/easefun/polyv/livecloudclass/modules/media/controller/PLVLCLiveMediaController.java b/polyvLiveCloudClassScene/src/main/java/com/easefun/polyv/livecloudclass/modules/media/controller/PLVLCLiveMediaController.java index 13a4516e..8e70c1af 100644 --- a/polyvLiveCloudClassScene/src/main/java/com/easefun/polyv/livecloudclass/modules/media/controller/PLVLCLiveMediaController.java +++ b/polyvLiveCloudClassScene/src/main/java/com/easefun/polyv/livecloudclass/modules/media/controller/PLVLCLiveMediaController.java @@ -157,7 +157,7 @@ public class PLVLCLiveMediaController extends FrameLayout implements IPLVLCLiveM // 服务端的点赞开关 private boolean isLikesSwitchEnabled = true; // 服务端的打赏开关 - private boolean isRewardSwitchEnabled = true; + private boolean isRewardSwitchEnabled = false; // 聊天室tab是否可见 private boolean isChatDisplayEnabled = true; // 主播放器是否正在播放 diff --git a/polyvLiveCommonModul/build.gradle b/polyvLiveCommonModul/build.gradle index 1cef20cb..69b27d99 100644 --- a/polyvLiveCommonModul/build.gradle +++ b/polyvLiveCommonModul/build.gradle @@ -31,7 +31,7 @@ android { dependencies { implementation 'com.android.support:design:27.1.1' implementation 'com.android.support:gridlayout-v7:27.1.1' - api 'net.polyv.android:polyvSDKLiveScenes:1.22.0' + api 'net.polyv.android:polyvSDKLiveScenes:1.22.1' //glide api("com.github.bumptech.glide:okhttp3-integration:4.7.1") { diff --git a/polyvLiveCommonModul/src/main/java/com/easefun/polyv/livecommon/module/data/IPLVLiveRoomDataManager.java b/polyvLiveCommonModul/src/main/java/com/easefun/polyv/livecommon/module/data/IPLVLiveRoomDataManager.java index b9500f4d..c899425c 100644 --- a/polyvLiveCommonModul/src/main/java/com/easefun/polyv/livecommon/module/data/IPLVLiveRoomDataManager.java +++ b/polyvLiveCommonModul/src/main/java/com/easefun/polyv/livecommon/module/data/IPLVLiveRoomDataManager.java @@ -11,6 +11,7 @@ import com.plv.livescenes.model.PLVPlaybackChannelDetailVO; import com.plv.livescenes.model.commodity.saas.PLVCommodityVO2; import com.plv.livescenes.model.interact.PLVWebviewUpdateAppStatusVO; +import com.plv.livescenes.model.pointreward.PLVRewardSettingVO; import com.plv.socket.event.chat.PLVRewardEvent; import com.plv.socket.event.interact.PLVCallAppEvent; @@ -113,6 +114,12 @@ public interface IPLVLiveRoomDataManager { */ LiveData> getPlaybackChannelData(); + /** + * 获取打赏设置LiveData + * @return + */ + LiveData> getRewardSettingData(); + /** * 获取请求商品接口的rank */ @@ -223,6 +230,11 @@ public interface IPLVLiveRoomDataManager { * 请求回放频道的详细信息 */ void requestPlaybackChannelStatus(); + + /** + * 请求打赏设置 + */ + void requestRewardSetting(); // // diff --git a/polyvLiveCommonModul/src/main/java/com/easefun/polyv/livecommon/module/data/PLVLiveRoomDataManager.java b/polyvLiveCommonModul/src/main/java/com/easefun/polyv/livecommon/module/data/PLVLiveRoomDataManager.java index f29b888d..7fdc8d33 100644 --- a/polyvLiveCommonModul/src/main/java/com/easefun/polyv/livecommon/module/data/PLVLiveRoomDataManager.java +++ b/polyvLiveCommonModul/src/main/java/com/easefun/polyv/livecommon/module/data/PLVLiveRoomDataManager.java @@ -12,6 +12,7 @@ import com.plv.livescenes.model.PLVPlaybackChannelDetailVO; import com.plv.livescenes.model.commodity.saas.PLVCommodityVO2; import com.plv.livescenes.model.interact.PLVWebviewUpdateAppStatusVO; +import com.plv.livescenes.model.pointreward.PLVRewardSettingVO; import com.plv.livescenes.streamer.transfer.PLVStreamerInnerDataTransfer; import com.plv.socket.event.chat.PLVRewardEvent; import com.plv.socket.event.interact.PLVCallAppEvent; @@ -62,6 +63,8 @@ public class PLVLiveRoomDataManager implements IPLVLiveRoomDataManager { private MutableLiveData isOnlyAudio = new MutableLiveData<>(); //回放频道的详细信息 private MutableLiveData> playbackChannelDetailVO = new MutableLiveData<>(); + //打赏配置 + private MutableLiveData> rewardSettingVO = new MutableLiveData<>(); //直播场次Id private MutableLiveData sessionIdLiveData = new MutableLiveData<>(); //聊天室token @@ -146,6 +149,11 @@ public LiveData> getPlaybackChannelD return playbackChannelDetailVO; } + @Override + public MutableLiveData> getRewardSettingData() { + return rewardSettingVO; + } + @Override public MutableLiveData getSessionIdLiveData() { return sessionIdLiveData; @@ -381,6 +389,21 @@ public void onFailed(String msg, Throwable throwable) { } }); } + + @Override + public void requestRewardSetting() { + liveRoomDataRequester.requestRewardSetting(new PLVLiveRoomDataRequester.IPLVNetRequestListener() { + @Override + public void onSuccess(PLVRewardSettingVO plvRewardSettingVO) { + rewardSettingVO.postValue(PLVStatefulData.success(plvRewardSettingVO)); + } + + @Override + public void onFailed(String msg, Throwable throwable) { + rewardSettingVO.postValue(PLVStatefulData.error(msg, throwable)); + } + }); + } // // diff --git a/polyvLiveCommonModul/src/main/java/com/easefun/polyv/livecommon/module/data/PLVLiveRoomDataRequester.java b/polyvLiveCommonModul/src/main/java/com/easefun/polyv/livecommon/module/data/PLVLiveRoomDataRequester.java index 3972741a..30cb8b88 100644 --- a/polyvLiveCommonModul/src/main/java/com/easefun/polyv/livecommon/module/data/PLVLiveRoomDataRequester.java +++ b/polyvLiveCommonModul/src/main/java/com/easefun/polyv/livecommon/module/data/PLVLiveRoomDataRequester.java @@ -13,6 +13,8 @@ import com.plv.foundationsdk.rx.PLVRxBaseRetryFunction; import com.plv.foundationsdk.rx.PLVRxBaseTransformer; import com.plv.foundationsdk.utils.PLVFormatUtils; +import com.plv.livescenes.feature.pointreward.IPLVPointRewardDataSource; +import com.plv.livescenes.feature.pointreward.PLVRewardDataSource; import com.plv.livescenes.hiclass.PLVHiClassDataBean; import com.plv.livescenes.hiclass.api.PLVHCApiManager; import com.plv.livescenes.hiclass.vo.PLVHCLessonDetailVO; @@ -20,6 +22,7 @@ import com.plv.livescenes.model.PLVLiveStatusVO2; import com.plv.livescenes.model.PLVPlaybackChannelDetailVO; import com.plv.livescenes.model.commodity.saas.PLVCommodityVO2; +import com.plv.livescenes.model.pointreward.PLVRewardSettingVO; import com.plv.livescenes.net.PLVApiManager; import com.plv.socket.user.PLVSocketUserConstant; @@ -43,6 +46,7 @@ public class PLVLiveRoomDataRequester { //请求商品的rank private int commodityRank = -1; + private PLVRewardDataSource rewardDataSource = new PLVRewardDataSource(); //直播频道配置参数 private PLVLiveChannelConfig liveChannelConfig; @@ -420,6 +424,32 @@ void disposePlayBackChannelDetail(){ } // + // + void requestRewardSetting(final IPLVNetRequestListener listener) { + rewardDataSource.getRewardSetting(getConfig().getChannelId(), new IPLVPointRewardDataSource.IPointRewardListener() { + @Override + public void onSuccess(PLVRewardSettingVO plvRewardSettingVO) { + if (listener != null) { + listener.onSuccess(plvRewardSettingVO); + } + } + + @Override + public void onFailed(Throwable throwable) { + if (listener != null) { + listener.onFailed(getErrorMessage(throwable), throwable); + } + } + }); + } + + void disposeRewardSetting() { + if (rewardDataSource != null) { + rewardDataSource.destroy(); + } + } + // + // void destroy() { disposablePageViewer(); @@ -430,6 +460,7 @@ void destroy() { disposeUpdateChannelName(); disposeLessonDetail(); disposePlayBackChannelDetail(); + disposeRewardSetting(); } // diff --git a/polyvLiveCommonModul/src/main/java/com/easefun/polyv/livecommon/ui/widget/PLVClipOutMaskView.java b/polyvLiveCommonModul/src/main/java/com/easefun/polyv/livecommon/ui/widget/PLVClipOutMaskView.java new file mode 100644 index 00000000..0b021143 --- /dev/null +++ b/polyvLiveCommonModul/src/main/java/com/easefun/polyv/livecommon/ui/widget/PLVClipOutMaskView.java @@ -0,0 +1,173 @@ +package com.easefun.polyv.livecommon.ui.widget; + +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Path; +import android.graphics.RectF; +import android.graphics.Region; +import android.support.annotation.Nullable; +import android.support.annotation.Px; +import android.util.AttributeSet; +import android.view.MotionEvent; +import android.view.View; + +import com.easefun.polyv.livecommon.R; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Hoshiiro + */ +public class PLVClipOutMaskView extends View { + + private final List clipOutParams = new ArrayList<>(); + private final List clipOutPaths = new ArrayList<>(); + private int maskColor = Color.TRANSPARENT; + + public PLVClipOutMaskView(Context context) { + this(context, null); + } + + public PLVClipOutMaskView(Context context, @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public PLVClipOutMaskView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(attrs, defStyleAttr); + } + + private void init(@Nullable AttributeSet attrs, int defStyleAttr) { + TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.PLVClipOutMaskView, defStyleAttr, 0); + int maskColor = typedArray.getColor(R.styleable.PLVClipOutMaskView_plv_mask_color, Color.TRANSPARENT); + boolean consumeClick = typedArray.getBoolean(R.styleable.PLVClipOutMaskView_plv_mask_consume_click, true); + typedArray.recycle(); + + this.setMaskColor(maskColor); + if (consumeClick) { + setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + + } + }); + } + } + + public void setMaskColor(int maskColor) { + this.maskColor = maskColor; + } + + public void clipOut(View anchor) { + final ClipOutParam param = new ClipOutParam(); + param.anchor = anchor; + clipOutParams.add(param); + clipOutPaths.clear(); + } + + public void clipOutRoundRect(View anchor, @Px float radius) { + final ClipOutParam param = new ClipOutParam(); + param.anchor = anchor; + param.radiusTopLeft = radius; + param.radiusTopRight = radius; + param.radiusBottomLeft = radius; + param.radiusBottomRight = radius; + clipOutParams.add(param); + clipOutPaths.clear(); + } + + public void clipOutRoundRect(View anchor, @Px float radiusTopLeft, float radiusTopRight, float radiusBottomLeft, float radiusBottomRight) { + final ClipOutParam param = new ClipOutParam(); + param.anchor = anchor; + param.radiusTopLeft = radiusTopLeft; + param.radiusTopRight = radiusTopRight; + param.radiusBottomLeft = radiusBottomLeft; + param.radiusBottomRight = radiusBottomRight; + clipOutParams.add(param); + clipOutPaths.clear(); + } + + public void clearClipOutParams() { + clipOutParams.clear(); + clipOutPaths.clear(); + } + + @Override + public boolean onTouchEvent(MotionEvent event) { + int[] location = new int[2]; + for (ClipOutParam clipOutParam : clipOutParams) { + clipOutParam.anchor.getLocationOnScreen(location); + final int anchorX = location[0]; + final int anchorY = location[1]; + final int anchorWidth = clipOutParam.anchor.getWidth(); + final int anchorHeight = clipOutParam.anchor.getHeight(); + final RectF anchorRect = new RectF(anchorX, anchorY, anchorX + anchorWidth, anchorY + anchorHeight); + if (anchorRect.contains(event.getRawX(), event.getRawY())) { + return false; + } + } + return super.onTouchEvent(event); + } + + @Override + public void invalidate() { + this.clipOutPaths.clear(); + super.invalidate(); + } + + @Override + protected void onDraw(Canvas canvas) { + prepareClipOutPath(); + for (Path path : clipOutPaths) { + canvas.clipPath(path, Region.Op.DIFFERENCE); + } + canvas.drawColor(this.maskColor); + } + + private void prepareClipOutPath() { + if (!clipOutPaths.isEmpty() || clipOutParams.isEmpty()) { + return; + } + int[] location = new int[2]; + for (ClipOutParam clipOutParam : clipOutParams) { + clipOutParam.anchor.getLocationOnScreen(location); + final int anchorX = location[0]; + final int anchorY = location[1]; + final int anchorWidth = clipOutParam.anchor.getWidth(); + final int anchorHeight = clipOutParam.anchor.getHeight(); + this.getLocationOnScreen(location); + final int maskX = location[0]; + final int maskY = location[1]; + final int offsetX = anchorX - maskX; + final int offsetY = anchorY - maskY; + final float radiusTopLeft = clipOutParam.radiusTopLeft; + final float radiusTopRight = clipOutParam.radiusTopRight; + final float radiusBottomLeft = clipOutParam.radiusBottomLeft; + final float radiusBottomRight = clipOutParam.radiusBottomRight; + + final Path path = new Path(); + path.addRoundRect( + new RectF(offsetX, offsetY, offsetX + anchorWidth, offsetY + anchorHeight), + new float[]{radiusTopLeft, radiusTopLeft, radiusTopRight, radiusTopRight, radiusBottomRight, radiusBottomRight, radiusBottomLeft, radiusBottomLeft}, + Path.Direction.CCW + ); + clipOutPaths.add(path); + } + } + + public static class ClipOutParam { + View anchor; + @Px + float radiusTopLeft = 0F; + @Px + float radiusTopRight = 0F; + @Px + float radiusBottomLeft = 0F; + @Px + float radiusBottomRight = 0F; + } + +} diff --git a/polyvLiveCommonModul/src/main/res/values-b+zh+Hant/strings.xml b/polyvLiveCommonModul/src/main/res/values-b+zh+Hant/strings.xml index 11fcceb9..88890b96 100644 --- a/polyvLiveCommonModul/src/main/res/values-b+zh+Hant/strings.xml +++ b/polyvLiveCommonModul/src/main/res/values-b+zh+Hant/strings.xml @@ -321,6 +321,7 @@ 點擊下課將結束直播,確認下課嗎? 網路斷開,已停止直播,請更換網路後重試 + 網絡斷開,直播已暫停 上課前無法發起連麥 請先點選上課 弱網處理 @@ -501,6 +502,7 @@ 確認退出回放 + 直播重播 沒有資料 載入失敗,請點選重試 @@ -539,6 +541,9 @@ 請選擇打賞數 請選擇打賞道具 打賞 + 禮物打賞 + 禮物特效 + 開啟/關閉打賞設定後,觀眾需刷新頁面或重進直播間 %s 發了一個%s, 點選領取 diff --git a/polyvLiveCommonModul/src/main/res/values-ja/strings.xml b/polyvLiveCommonModul/src/main/res/values-ja/strings.xml index b4a3254e..217de534 100644 --- a/polyvLiveCommonModul/src/main/res/values-ja/strings.xml +++ b/polyvLiveCommonModul/src/main/res/values-ja/strings.xml @@ -321,6 +321,7 @@ 退室を終了するためにクリックすると、ライブ ブロードキャストが終了します。本当に退室を終了しますか? ネットワークが切断されたため、ライブ ブロードキャストが停止しました。ネットワークを変更してもう一度お試しください。 + ネットオフ、生中継一時停止 授業の前に linkmic を開始できません 最初にクリックして授業を行ってください 弱いネットワーク処理 @@ -500,6 +501,7 @@ 再生の終了を確認する + ライブ再生 データがありません 読み込みに失敗しました。クリックして再試行してください。 @@ -538,6 +540,9 @@ 報酬額を選択してください 特典アイテムを選択してください 報酬 + プレゼント + プレゼント効果 + 打賞設定をオン/オフにすると、視聴者はページを更新するか、ライブルームに再入力する必要があります %s が %s にメッセージを送信しました。 クリックして受け取る diff --git a/polyvLiveCommonModul/src/main/res/values-ko/strings.xml b/polyvLiveCommonModul/src/main/res/values-ko/strings.xml index b4e079f9..fbc6b49d 100644 --- a/polyvLiveCommonModul/src/main/res/values-ko/strings.xml +++ b/polyvLiveCommonModul/src/main/res/values-ko/strings.xml @@ -321,6 +321,7 @@ 퇴실을 종료하려면 라이브 방송이 종료됩니다. 수업을 종료하시겠습니까? 네트워크 연결이 끊어져 라이브 방송이 중단되었습니다. 네트워크를 변경하고 다시 시도해 주세요. + 네트워크 끊김, 실시간 중단 수업 전에 링크마이크를 시작할 수 없습니다 먼저 수업을 클릭해 주세요 약한 네트워크 처리 @@ -501,6 +502,7 @@ 재생 종료 확인 + 생방송 재생 데이터 없음 로드에 실패했습니다. 다시 시도하려면 클릭하세요 @@ -539,6 +541,9 @@ 보상 금액을 선택해주세요 보상 아이템을 선택해주세요 보상 + 선물 타상 + 선물 효과 + 포상 설정을 켜거나 끈 후, 시청자는 페이지를 새로 고치거나 생방송으로 다시 들어가야 한다 %s님이 %s님에게 메시지를 보냈습니다, 수신하려면 클릭하세요 diff --git a/polyvLiveCommonModul/src/main/res/values-zh/strings.xml b/polyvLiveCommonModul/src/main/res/values-zh/strings.xml index 24139bda..25b4d21f 100644 --- a/polyvLiveCommonModul/src/main/res/values-zh/strings.xml +++ b/polyvLiveCommonModul/src/main/res/values-zh/strings.xml @@ -321,6 +321,7 @@ 点击下课将结束直播,确认下课吗? 网络断开,已停止直播,请更换网络后重试 + 网络断开,直播已暂停 上课前无法发起连麦 请先点击上课 弱网处理 @@ -501,6 +502,7 @@ 确认退出回放 + 直播回放 没有数据 加载失败,请点击重试 @@ -539,6 +541,9 @@ 请选择打赏数量 请选择打赏道具 打赏 + 礼物打赏 + 礼物特效 + 开启/关闭打赏设置后,观众需刷新页面或重进直播间 %s 发了一个%s, 点击领取 diff --git a/polyvLiveCommonModul/src/main/res/values/attrs.xml b/polyvLiveCommonModul/src/main/res/values/attrs.xml index 0a24eae9..07f830b6 100644 --- a/polyvLiveCommonModul/src/main/res/values/attrs.xml +++ b/polyvLiveCommonModul/src/main/res/values/attrs.xml @@ -480,4 +480,9 @@ + + + + + \ No newline at end of file diff --git a/polyvLiveCommonModul/src/main/res/values/strings.xml b/polyvLiveCommonModul/src/main/res/values/strings.xml index 1579f85c..7d3b97f0 100644 --- a/polyvLiveCommonModul/src/main/res/values/strings.xml +++ b/polyvLiveCommonModul/src/main/res/values/strings.xml @@ -321,6 +321,7 @@ Selecting "End class" will disconnect the live lesson. End class now\? Lost connection. Live class ended. Please restore network and retry streaming + Network down, live stream paused Unable to start call before class begins Please start the class first Weak net @@ -501,6 +502,7 @@ Confirm to exit playback + Live Replay No more data Loading failed, please tap retry @@ -539,6 +541,9 @@ Please select the reward amount Please select a reward gift Reward + Gifts Reward + Gifts Effects + After toggling the switch, viewers need to refresh or reload the page for the changes to take effect %s sent a %s,  Click to receive diff --git a/polyvLiveStreamerScene/src/main/java/com/easefun/polyv/livestreamer/modules/liveroom/PLVLSNetworkDisconnectMaskLayout.java b/polyvLiveStreamerScene/src/main/java/com/easefun/polyv/livestreamer/modules/liveroom/PLVLSNetworkDisconnectMaskLayout.java new file mode 100644 index 00000000..0d1611ab --- /dev/null +++ b/polyvLiveStreamerScene/src/main/java/com/easefun/polyv/livestreamer/modules/liveroom/PLVLSNetworkDisconnectMaskLayout.java @@ -0,0 +1,99 @@ +package com.easefun.polyv.livestreamer.modules.liveroom; + +import android.app.Activity; +import android.arch.lifecycle.LifecycleOwner; +import android.arch.lifecycle.Observer; +import android.content.Context; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.FrameLayout; + +import com.easefun.polyv.livecommon.module.modules.streamer.contract.IPLVStreamerContract; +import com.easefun.polyv.livecommon.module.modules.streamer.view.PLVAbsStreamerView; +import com.easefun.polyv.livecommon.ui.widget.PLVClipOutMaskView; +import com.easefun.polyv.livestreamer.R; +import com.plv.foundationsdk.utils.PLVNetworkUtils; +import com.plv.linkmic.PLVLinkMicConstant; +import com.plv.thirdpart.blankj.utilcode.util.ConvertUtils; + +/** + * @author Hoshiiro + */ +public class PLVLSNetworkDisconnectMaskLayout extends FrameLayout { + + private PLVClipOutMaskView clipOutMaskView; + + private boolean isLive = false; + private boolean isNetworkDisconnect = false; + + public PLVLSNetworkDisconnectMaskLayout(@NonNull Context context) { + super(context); + init(); + } + + public PLVLSNetworkDisconnectMaskLayout(@NonNull Context context, @Nullable AttributeSet attrs) { + super(context, attrs); + init(); + } + + public PLVLSNetworkDisconnectMaskLayout(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(); + } + + private void init() { + LayoutInflater.from(getContext()).inflate(R.layout.plvls_network_disconnect_mask_layout, this); + clipOutMaskView = findViewById(R.id.plvls_clip_out_mask_view); + } + + public final IPLVStreamerContract.IStreamerView streamerView = new PLVAbsStreamerView() { + @Override + public void setPresenter(@NonNull IPLVStreamerContract.IStreamerPresenter presenter) { + presenter.getData().getStreamerStatus().observe((LifecycleOwner) getContext(), new Observer() { + @Override + public void onChanged(@Nullable Boolean isLive) { + PLVLSNetworkDisconnectMaskLayout.this.isLive = isLive != null && isLive; + update(); + } + }); + } + + @Override + public void onNetworkQuality(PLVLinkMicConstant.NetworkQuality quality) { + isNetworkDisconnect = quality == PLVLinkMicConstant.NetworkQuality.DISCONNECT || !PLVNetworkUtils.isConnected(getContext()); + update(); + } + + }; + + private void update() { + final boolean currentVisible = getVisibility() == VISIBLE; + final boolean needVisible = isLive && isNetworkDisconnect; + if (currentVisible == needVisible) { + return; + } + if (!needVisible) { + setVisibility(GONE); + return; + } + setupClipOutMaskView(); + setVisibility(VISIBLE); + } + + private void setupClipOutMaskView() { + clipOutMaskView.clearClipOutParams(); + final Activity activity = (Activity) getContext(); + final View closeIcon = activity.findViewById(R.id.plvls_status_bar_class_control_tv); + if (closeIcon != null && closeIcon.isShown()) { + clipOutMaskView.clipOutRoundRect(closeIcon, ConvertUtils.dp2px(30)); + } + final View networkStatusBar = activity.findViewById(R.id.plvls_status_bar_net_quality_view); + if (networkStatusBar != null && networkStatusBar.isShown()) { + clipOutMaskView.clipOutRoundRect(networkStatusBar, ConvertUtils.dp2px(10)); + } + } + +} diff --git a/polyvLiveStreamerScene/src/main/java/com/easefun/polyv/livestreamer/scenes/PLVLSLiveStreamerActivity.java b/polyvLiveStreamerScene/src/main/java/com/easefun/polyv/livestreamer/scenes/PLVLSLiveStreamerActivity.java index 273e58eb..6026827c 100644 --- a/polyvLiveStreamerScene/src/main/java/com/easefun/polyv/livestreamer/scenes/PLVLSLiveStreamerActivity.java +++ b/polyvLiveStreamerScene/src/main/java/com/easefun/polyv/livestreamer/scenes/PLVLSLiveStreamerActivity.java @@ -37,6 +37,7 @@ import com.easefun.polyv.livestreamer.modules.document.IPLVLSDocumentLayout; import com.easefun.polyv.livestreamer.modules.document.PLVLSDocumentLayout; import com.easefun.polyv.livestreamer.modules.document.widget.PLVLSDocumentControllerExpandMenu; +import com.easefun.polyv.livestreamer.modules.liveroom.PLVLSNetworkDisconnectMaskLayout; import com.easefun.polyv.livestreamer.modules.liveroom.PLVLSPushDowngradeAlertToastLayout; import com.easefun.polyv.livestreamer.modules.statusbar.IPLVLSStatusBarLayout; import com.easefun.polyv.livestreamer.modules.streamer.IPLVLSStreamerLayout; @@ -100,6 +101,7 @@ public class PLVLSLiveStreamerActivity extends PLVBaseActivity { private PLVLSPushDowngradeAlertToastLayout pushDowngradeAlertToastLy; // 互动布局 private IPLVStreamerInteractLayout interactLayout; + private PLVLSNetworkDisconnectMaskLayout networkDisconnectMaskLayout; // // @@ -196,6 +198,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { observeStreamerLayout(); observeChatroomLayout(); observeDocumentLayout(); + observeNetworkDisconnectLayout(); } @Override @@ -318,6 +321,8 @@ private void initView() { toTopView = findViewById(R.id.plvls_chatroom_to_top_view); pushDowngradeAlertToastLy = findViewById(R.id.plvls_push_downgrade_alert_toast_ly); interactLayout = findViewById(R.id.plvsa_interact_layout); + networkDisconnectMaskLayout = findViewById(R.id.plvls_network_disconnect_mask_layout); + interactLayout.init(liveRoomDataManager); // 初始化推流和连麦布局 @@ -686,6 +691,14 @@ public void onSwitchFullScreen(boolean toFullScreen) { } // + // + + private void observeNetworkDisconnectLayout() { + plvlsStreamerLy.getStreamerPresenter().registerView(networkDisconnectMaskLayout.streamerView); + } + + // + // private void checkStreamRecover() { diff --git a/polyvLiveStreamerScene/src/main/res/drawable-xhdpi/plvls_network_disconnect_icon.png b/polyvLiveStreamerScene/src/main/res/drawable-xhdpi/plvls_network_disconnect_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a57ef8a0979ba4e8c31b4216118206f40acaa3db GIT binary patch literal 2482 zcmX|D2T;?=8{LFJAWBm>A|N0lh9XTOMGr!x7=wy5F%&sbB+>~YoggT^7^(sXB1O6a zkxqVa5Rjvnh!To|6p`j}fO6nJ-hbx4nceU0n{W5+?9S}l7_-YJ{3vl00Dzxx!O)zO zp`VSHhtr$0-H@CFqnMlEL1n+>5@&#*;0czzoCxN<6%7EN9l_AR(m#7;a?N}6f)sP3 zxN2+f5>GU*n(!APnD&FCvNq9>AL5L#e>8}O-t(>-Q@b5i9<++xZOh(vGv2#Vu~yu} zJvwZ@=Al2yNY@nS<7oUBxC5q30<}z1kUaS~`TO5b3i|hEm)<7q>iBu-cQK^dxj+2E zS~Gmrm3I2}S+UQm{q~bm|Q$qG&w?+1;cGvgA6$RdTU` zXSXEr{6;5wBx9vtLx_6P#y0pG7q*}Z5n_>t)_j7$iMvWog`4EB<>x=DF`<9P&AhFy;3Ejs`WId9>YGgq#R z5gSPp^8r|x7gt!ZH*@XcR-sRewMgVV7X)pyT)7QgbU`Jvc$9C17&!5Hav>~j6^CNI z&!KN+71*lpoOeGFQp0j+YMQ=8zRRuMnBAZ>k>Y$*Gu=q5@a!StX^wL1i1toaR-xi( z+2d-L4VYKWeh%iIkLyjW&88IO?!$;}yU}huOs8-4U&6=Lc8fyp%u1t*8*vd#+9G8s zv6o&C%)VN#^q?u%8xK>IOA$U2_7{H-w6CYRsEf(|QUkYfRmD1dGT7rGRHb{Rxd?MK zr(y%c$O5!}*Ra(5&xbh2dfkd1r7aA?Mp zbnn;;MGj&0LJ={Bptdm-$0GA$LA}ID_6#XQ5pPBWtF=>Fr_0|3EGsc%WDPQQCJrqar}f)m zlkK-ay^>yT$DR8d43&%Lv{G9T)hq{M>35idNJ@xBHWsXo&ED4;i0M2MuRcJ@QMToq z`@E0!47~B=h-Pcxt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L0W{gZ&-Vc^e`4tQ&C0&^!+y9_!)MjND4isDfa&Jhx#>2(t z3no^p3F@lEZ0%*KnN0QhnsE`QW(|Lb&vTvD)EN2}X}D>44=0QyRK=@zw%*D2|97U< z@b#ronI_6LJ`sy@MBt1aTh2CXyAa8+BmnlM>T9wHSMS^LB_Bi0L{AJx{`tJjD{b~z zorRSsh!N7PENxS@LjOdijT|KY6BYGvkR(_#;nj;F77({u)A`qaSlj~z(t-o_#P_1B zsCgZi=Kkr7)ozPYL8yZiq_C9ltM5fKm_0i6%u7GCBz6}Rdtv8nH>^zQ%k<Vwet1y`%x`+)8y^mohIrbrNH?iH0gWAh$ z2eywtErP4PVtHVBo^cGW=nGb0pR=ue(wzLxwRrUw_4$TzxvrNPn{4!m;hVqAQj{R| zZA|A`LRjoxn`8^~2t$>fRPa;~ij>JNe~aSTzlDWm3PqZ%oCvY|6Ur@D0bOk8Z}{bw zyPAs&@%kbwgkxm_P=~$VB>C4ee3kd>X|YukZ^R6&PO+JVj!thMBz}Lf@%QZcca@_N z;M@nyLC@OeAQUnoVm}VOnIsEN`eZHS6o{4nMgN2(Y}5A5KUV$X&IencgTETv3HWrU zM(P(i;*BV$9QosnK?rGveo84b_v}5mK6qlOz~jHmt-uKKLJsEru`v literal 0 HcmV?d00001 diff --git a/polyvLiveStreamerScene/src/main/res/layout/plvls_live_streamer_activity.xml b/polyvLiveStreamerScene/src/main/res/layout/plvls_live_streamer_activity.xml index eb2402f2..7b3299c5 100644 --- a/polyvLiveStreamerScene/src/main/res/layout/plvls_live_streamer_activity.xml +++ b/polyvLiveStreamerScene/src/main/res/layout/plvls_live_streamer_activity.xml @@ -63,6 +63,13 @@ app:layout_constraintRight_toRightOf="@+id/plvls_document_ly" app:layout_constraintTop_toTopOf="@+id/plvls_document_ly" /> + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/chatroom/IPLVSAChatroomLayout.java b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/chatroom/IPLVSAChatroomLayout.java index 4e9c03bf..9209544b 100644 --- a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/chatroom/IPLVSAChatroomLayout.java +++ b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/chatroom/IPLVSAChatroomLayout.java @@ -46,6 +46,11 @@ public interface IPLVSAChatroomLayout { */ void callInputWindow(); + /** + * 改变聊天列表显示类型 + */ + void changeDisplayType(int displayDataType); + /** * 添加信息到聊天列表中 * diff --git a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/chatroom/PLVSAChatroomLayout.java b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/chatroom/PLVSAChatroomLayout.java index a9575686..d02c6784 100644 --- a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/chatroom/PLVSAChatroomLayout.java +++ b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/chatroom/PLVSAChatroomLayout.java @@ -293,6 +293,13 @@ public boolean onSendMsg(String message) { }); } + @Override + public void changeDisplayType(int displayDataType) { + if (chatMessageAdapter != null) { + chatMessageAdapter.changeDisplayType(displayDataType); + } + } + @Override public void addChatMessageToChatList(final List chatMessageDataList, final boolean isScrollEnd) { addChatMessageToList(chatMessageDataList, isScrollEnd); diff --git a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/chatroom/adapter/PLVSAMessageAdapter.java b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/chatroom/adapter/PLVSAMessageAdapter.java index 5384b58a..5a5691ba 100644 --- a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/chatroom/adapter/PLVSAMessageAdapter.java +++ b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/chatroom/adapter/PLVSAMessageAdapter.java @@ -6,6 +6,7 @@ import android.view.View; import android.view.ViewGroup; +import com.easefun.polyv.livecommon.module.modules.chatroom.PLVCustomGiftEvent; import com.easefun.polyv.livecommon.module.modules.chatroom.PLVSpecialTypeTag; import com.easefun.polyv.livecommon.module.modules.chatroom.holder.PLVChatMessageBaseViewHolder; import com.easefun.polyv.livecommon.module.modules.chatroom.holder.PLVChatMessageItemType; @@ -24,6 +25,7 @@ import com.plv.socket.event.chat.IPLVMessageIdEvent; import com.plv.socket.event.chat.PLVChatQuoteVO; import com.plv.socket.event.chat.PLVProhibitedWordVO; +import com.plv.socket.event.chat.PLVRewardEvent; import java.util.ArrayList; import java.util.List; @@ -34,11 +36,15 @@ public class PLVSAMessageAdapter extends PLVBaseAdapter> { // public static final String PAYLOAD_PROHIBITED_CHANGED = "prohibitedChanged"; + public static final int DISPLAY_DATA_TYPE_FULL = 1; + public static final int DISPLAY_DATA_TYPE_SPECIAL = 2; + public static final int DISPLAY_DATA_TYPE_REMOVE_REWARD = 3;//仅适配全部消息的数据列表 private List dataList;//adapter使用的数据列表 private List fullDataList;//全部信息的数据列表 private List specialDataList;//只看讲师信息的数据列表(包括我、讲师类型、嘉宾类型、助教类型、管理员类型的信息) + private List excludeRewardDataList;//移除了打赏信息的数据列表 - private boolean isDisplaySpecialType;//是否只看讲师 + private int displayDataType = DISPLAY_DATA_TYPE_FULL;//显示数据类型 private int msgIndex; // @@ -51,7 +57,14 @@ public class PLVSAMessageAdapter extends PLVBaseAdapter(); specialDataList = new ArrayList<>(); - dataList = isDisplaySpecialType ? specialDataList : fullDataList; + excludeRewardDataList = new ArrayList<>(); + if (displayDataType == DISPLAY_DATA_TYPE_FULL) { + dataList = fullDataList; + } else if (displayDataType == DISPLAY_DATA_TYPE_SPECIAL) { + dataList = specialDataList; + } else { + dataList = excludeRewardDataList; + } } // @@ -127,18 +140,19 @@ public void setMsgIndex(int msgIndex) { } // - public void changeDisplayType(boolean isDisplaySpecialType) { - if (this.isDisplaySpecialType == isDisplaySpecialType) { + public void changeDisplayType(int displayDataType) { + if (this.displayDataType == displayDataType) { return; } - this.isDisplaySpecialType = isDisplaySpecialType; - if (isDisplaySpecialType) { - dataList = specialDataList; - notifyDataSetChanged(); - } else { + this.displayDataType = displayDataType; + if (displayDataType == DISPLAY_DATA_TYPE_FULL) { dataList = fullDataList; - notifyDataSetChanged(); + } else if (displayDataType == DISPLAY_DATA_TYPE_SPECIAL) { + dataList = specialDataList; + } else if (displayDataType == DISPLAY_DATA_TYPE_REMOVE_REWARD) { + dataList = excludeRewardDataList; } + notifyDataSetChanged(); } // @@ -148,6 +162,10 @@ public boolean addDataChangedAtLast(PLVBaseViewData baseViewData) { if (baseViewData.getTag() instanceof PLVSpecialTypeTag) { specialDataList.add(baseViewData); } + if (!(baseViewData.getData() instanceof PLVCustomGiftEvent) + && !(baseViewData.getData() instanceof PLVRewardEvent)) { + excludeRewardDataList.add(baseViewData); + } if (dataList.size() != oldSize) { notifyItemInserted(dataList.size() - 1); return true; @@ -163,6 +181,12 @@ public boolean addDataListChangedAtLast(List list) { specialDataList.add(baseViewData); } } + for (PLVBaseViewData baseViewData : list) { + if (!(baseViewData.getData() instanceof PLVCustomGiftEvent) + && !(baseViewData.getData() instanceof PLVRewardEvent)) { + excludeRewardDataList.add(baseViewData); + } + } if (dataList.size() != oldSize) { notifyItemRangeInserted(oldSize, dataList.size() - oldSize); return true; @@ -179,6 +203,13 @@ public boolean addDataListChangedAtFirst(List> lis specialDataList.add(0, baseViewData); } } + for (int i = list.size() - 1; i >= 0; i--) { + PLVBaseViewData baseViewData = list.get(i); + if (!(baseViewData.getData() instanceof PLVCustomGiftEvent) + && !(baseViewData.getData() instanceof PLVRewardEvent)) { + excludeRewardDataList.add(0, baseViewData); + } + } if (dataList.size() != oldSize) { notifyItemRangeInserted(0, dataList.size() - oldSize); return true; @@ -213,7 +244,30 @@ public void notifyProhibitedChanged(String prohibitedMessage, String hintMsg, St } } } - notifyItemChanged(isDisplaySpecialType ? changedSpecialDataPosition : changedFullDataPosition, PAYLOAD_PROHIBITED_CHANGED); + int changedExcludeRewardDataPosition = -1; + for (int i = excludeRewardDataList.size() - 1; i >= 0; i--) { + PLVBaseViewData baseViewData = excludeRewardDataList.get(i); + if (baseViewData.getData() instanceof PolyvLocalMessage) { + String speakMsg = ((PolyvLocalMessage) baseViewData.getData()).getSpeakMessage(); + if (prohibitedMessage != null && speakMsg != null && speakMsg.contains(prohibitedMessage)) { + PLVProhibitedWordVO prohibitedWordVO = new PLVProhibitedWordVO(prohibitedMessage, hintMsg, status); + ((PolyvLocalMessage) baseViewData.getData()).setProhibitedWord(prohibitedWordVO); + changedExcludeRewardDataPosition = i; + break; + } + } + } + int changedPosition = -1; + if (displayDataType == DISPLAY_DATA_TYPE_FULL) { + changedPosition = changedFullDataPosition; + } else if (displayDataType == DISPLAY_DATA_TYPE_SPECIAL) { + changedPosition = changedSpecialDataPosition; + } else if (displayDataType == DISPLAY_DATA_TYPE_REMOVE_REWARD) { + changedPosition = changedExcludeRewardDataPosition; + } + if (changedPosition != -1) { + notifyItemChanged(changedPosition); + } } public boolean removeDataChanged(String id) { @@ -243,9 +297,30 @@ public boolean removeDataChanged(String id) { break; } } + int removeExcludeRewardDataPosition = -1; + for (PLVBaseViewData baseViewData : excludeRewardDataList) { + removeExcludeRewardDataPosition++; + if (baseViewData.getData() instanceof IPLVIdEvent + && id.equals(((IPLVIdEvent) baseViewData.getData()).getId()) + || (baseViewData.getData() instanceof IPLVMessageIdEvent + && id.equals(((IPLVMessageIdEvent) baseViewData.getData()).getMessageId()))) { + excludeRewardDataList.remove(baseViewData); + break; + } + } if (dataList.size() != oldSize) { - notifyItemRemoved(isDisplaySpecialType ? removeSpecialDataPosition : removeFullDataPosition); - return true; + int changedPosition = -1; + if (displayDataType == DISPLAY_DATA_TYPE_FULL) { + changedPosition = removeFullDataPosition; + } else if (displayDataType == DISPLAY_DATA_TYPE_SPECIAL) { + changedPosition = removeSpecialDataPosition; + } else if (displayDataType == DISPLAY_DATA_TYPE_REMOVE_REWARD) { + changedPosition = removeExcludeRewardDataPosition; + } + if (changedPosition != -1) { + notifyItemChanged(changedPosition); + return true; + } } return false; } @@ -265,6 +340,12 @@ public boolean removeDataChanged(int maxLength) { specialDataList.clear(); specialDataList.addAll(retainList); } + if (excludeRewardDataList.size() > maxLength) { +// excludeRewardDataList.removeAll(excludeRewardDataList.subList(0, excludeRewardDataList.size() - maxLength)); + List retainList = new ArrayList<>(excludeRewardDataList.subList(excludeRewardDataList.size() - maxLength, excludeRewardDataList.size())); + excludeRewardDataList.clear(); + excludeRewardDataList.addAll(retainList); + } if (dataList.size() != oldSize) { notifyDataSetChanged(); return true; @@ -276,6 +357,7 @@ public boolean removeAllDataChanged() { int oldSize = dataList.size(); fullDataList.clear(); specialDataList.clear(); + excludeRewardDataList.clear(); if (dataList.size() != oldSize) {//if dataList=fullDataList or dataList=specialDataList notifyDataSetChanged(); return true; diff --git a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/liveroom/PLVSALinkMicRequestTipsLayout.java b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/liveroom/PLVSALinkMicRequestTipsLayout.java index ed813f5f..f2b60845 100644 --- a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/liveroom/PLVSALinkMicRequestTipsLayout.java +++ b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/liveroom/PLVSALinkMicRequestTipsLayout.java @@ -1,14 +1,8 @@ package com.easefun.polyv.streameralone.modules.liveroom; -import android.animation.Animator; -import android.animation.AnimatorListenerAdapter; -import android.animation.ObjectAnimator; -import android.arch.lifecycle.LifecycleOwner; -import android.arch.lifecycle.Observer; +import static com.plv.foundationsdk.utils.PLVTimeUnit.seconds; + import android.content.Context; -import android.os.Handler; -import android.os.Looper; -import android.os.Message; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.util.AttributeSet; @@ -20,12 +14,9 @@ import android.widget.LinearLayout; import android.widget.TextView; -import com.easefun.polyv.livecommon.module.modules.beauty.viewmodel.PLVBeautyViewModel; -import com.easefun.polyv.livecommon.module.modules.beauty.viewmodel.vo.PLVBeautyUiState; -import com.easefun.polyv.livecommon.ui.widget.roundview.PLVRoundRectLayout; +import com.easefun.polyv.livecommon.ui.util.PLVViewUtil; +import com.easefun.polyv.livecommon.ui.widget.PLVTriangleIndicateLayout; import com.easefun.polyv.streameralone.R; -import com.plv.foundationsdk.component.di.PLVDependManager; -import com.plv.thirdpart.blankj.utilcode.util.ConvertUtils; /** @@ -37,56 +28,12 @@ public class PLVSALinkMicRequestTipsLayout extends FrameLayout { // - private PLVRoundRectLayout plvsaEmptyLinkmicTipsGroupLayout; + private PLVTriangleIndicateLayout plvsaEmptyLinkmicTipsGroupLayout; private LinearLayout plvsaEmptyLinkmicTipsLl; private ImageView plvsaEmptyLinkmicTipsIconIv; private TextView plvsaEmptyLinkmicTipsTv; private Button plvsaEmptyLinkmicNavBtn; - // 有人申请连麦提示条的宽度+右边距 - private int linkmicTipsGroupWidthWithMargin; - - // 连麦提示条动画 - private ObjectAnimator linkmicTipsMoveInAnimator = new ObjectAnimator(); - private ObjectAnimator linkmicTipsMoveOutAnimator = new ObjectAnimator(); - private boolean isLinkmicTipsAnimating = false; - private boolean isLinkmicTipsShowing = false; - - // 连麦提示条动画 消息处理Handler - private static final int MSG_CANCEL = 0; - private static final int MSG_MOVE_IN = 1; - private static final int MSG_MOVE_OUT = 2; - private final Handler animatorHandler = new Handler(Looper.getMainLooper()) { - @Override - public void handleMessage(Message msg) { - switch (msg.what) { - case MSG_CANCEL: - animatorHandler.removeMessages(MSG_MOVE_IN); - animatorHandler.removeMessages(MSG_MOVE_OUT); - linkmicTipsMoveInAnimator.cancel(); - linkmicTipsMoveOutAnimator.cancel(); - plvsaEmptyLinkmicTipsGroupLayout.setAlpha(1); - plvsaEmptyLinkmicTipsGroupLayout.setTranslationX(linkmicTipsGroupWidthWithMargin); - isLinkmicTipsShowing = false; - isLinkmicTipsAnimating = false; - break; - case MSG_MOVE_IN: - if (!isLinkmicTipsShowing && !isLinkmicTipsAnimating) { - linkmicTipsMoveInAnimator.start(); - } - break; - case MSG_MOVE_OUT: - if (isLinkmicTipsShowing && !isLinkmicTipsAnimating) { - linkmicTipsMoveOutAnimator.start(); - } - break; - default: - } - } - }; - - private boolean isBeautyLayoutShowing = false; - private OnTipsClickListener onTipsClickListener; // @@ -114,68 +61,15 @@ private void initView() { LayoutInflater.from(getContext()).inflate(R.layout.plvsa_live_room_linkmic_request_tips_layout, this); findView(); - initLinkmicTipsAnimator(); initLinkmicTipsOnClickListener(); - - observeBeautyLayoutStatus(); } private void findView() { - plvsaEmptyLinkmicTipsGroupLayout = (PLVRoundRectLayout) findViewById(R.id.plvsa_empty_linkmic_tips_group_layout); - plvsaEmptyLinkmicTipsLl = (LinearLayout) findViewById(R.id.plvsa_empty_linkmic_tips_ll); - plvsaEmptyLinkmicTipsIconIv = (ImageView) findViewById(R.id.plvsa_empty_linkmic_tips_icon_iv); - plvsaEmptyLinkmicTipsTv = (TextView) findViewById(R.id.plvsa_empty_linkmic_tips_tv); - plvsaEmptyLinkmicNavBtn = (Button) findViewById(R.id.plvsa_empty_linkmic_nav_btn); - } - - private void initLinkmicTipsAnimator() { - plvsaEmptyLinkmicTipsGroupLayout.post(new Runnable() { - @Override - public void run() { - final int tipsWidth = plvsaEmptyLinkmicTipsGroupLayout.getWidth(); - final int tipsWidthWithMargin = tipsWidth + ConvertUtils.dp2px(8); - linkmicTipsGroupWidthWithMargin = tipsWidthWithMargin; - - plvsaEmptyLinkmicTipsGroupLayout.setTranslationX(tipsWidthWithMargin); - - // 移入:从屏幕右侧移入 - linkmicTipsMoveInAnimator = ObjectAnimator.ofFloat(plvsaEmptyLinkmicTipsGroupLayout, "translationX", tipsWidthWithMargin, 0); - linkmicTipsMoveInAnimator.setDuration(500); - - // 移出:渐隐 - linkmicTipsMoveOutAnimator = ObjectAnimator.ofFloat(plvsaEmptyLinkmicTipsGroupLayout, "alpha", 1, 0); - linkmicTipsMoveOutAnimator.setDuration(1000); - - linkmicTipsMoveInAnimator.addListener(new AnimatorListenerAdapter() { - @Override - public void onAnimationStart(Animator animation, boolean isReverse) { - isLinkmicTipsShowing = true; - isLinkmicTipsAnimating = true; - } - - @Override - public void onAnimationEnd(Animator animation) { - isLinkmicTipsAnimating = false; - animatorHandler.sendMessageDelayed(Message.obtain(animatorHandler, MSG_MOVE_OUT), 10 * 1000); - } - }); - - linkmicTipsMoveOutAnimator.addListener(new AnimatorListenerAdapter() { - @Override - public void onAnimationStart(Animator animation) { - isLinkmicTipsAnimating = true; - } - - @Override - public void onAnimationEnd(Animator animation, boolean isReverse) { - isLinkmicTipsShowing = false; - isLinkmicTipsAnimating = false; - plvsaEmptyLinkmicTipsGroupLayout.setAlpha(1); - plvsaEmptyLinkmicTipsGroupLayout.setTranslationX(tipsWidthWithMargin); - } - }); - } - }); + plvsaEmptyLinkmicTipsGroupLayout = findViewById(R.id.plvsa_empty_linkmic_tips_group_layout); + plvsaEmptyLinkmicTipsLl = findViewById(R.id.plvsa_empty_linkmic_tips_ll); + plvsaEmptyLinkmicTipsIconIv = findViewById(R.id.plvsa_empty_linkmic_tips_icon_iv); + plvsaEmptyLinkmicTipsTv = findViewById(R.id.plvsa_empty_linkmic_tips_tv); + plvsaEmptyLinkmicNavBtn = findViewById(R.id.plvsa_empty_linkmic_nav_btn); } private void initLinkmicTipsOnClickListener() { @@ -197,32 +91,16 @@ public void onClick(View v) { }); } - private void observeBeautyLayoutStatus() { - PLVDependManager.getInstance().get(PLVBeautyViewModel.class) - .getUiState() - .observe((LifecycleOwner) getContext(), new Observer() { - @Override - public void onChanged(@Nullable PLVBeautyUiState beautyUiState) { - PLVSALinkMicRequestTipsLayout.this.isBeautyLayoutShowing = beautyUiState != null && beautyUiState.isBeautyMenuShowing; - updateVisibility(); - } - }); - } - // // public void show() { - animatorHandler.sendMessage(Message.obtain(animatorHandler, MSG_MOVE_IN)); + PLVViewUtil.showViewForDuration(this, seconds(10).toMillis()); } public void hide() { - animatorHandler.sendMessage(Message.obtain(animatorHandler, MSG_MOVE_OUT)); - } - - public void cancel() { - animatorHandler.sendMessage(Message.obtain(animatorHandler, MSG_CANCEL)); + setVisibility(View.GONE); } public void setOnTipsClickListener(OnTipsClickListener onTipsClickListener) { @@ -231,19 +109,6 @@ public void setOnTipsClickListener(OnTipsClickListener onTipsClickListener) { // - // - - private void updateVisibility() { - // 美颜布局显示时,不显示连麦提示条 - if (isBeautyLayoutShowing) { - setVisibility(View.GONE); - return; - } - setVisibility(View.VISIBLE); - } - - // - // public interface OnTipsClickListener { diff --git a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/liveroom/PLVSAMoreLayout.java b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/liveroom/PLVSAMoreLayout.java index a037097e..74965366 100644 --- a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/liveroom/PLVSAMoreLayout.java +++ b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/liveroom/PLVSAMoreLayout.java @@ -1,5 +1,7 @@ package com.easefun.polyv.streameralone.modules.liveroom; +import static com.plv.foundationsdk.utils.PLVAppUtils.postToMainThread; + import android.app.Activity; import android.arch.lifecycle.LifecycleOwner; import android.arch.lifecycle.Observer; @@ -7,7 +9,6 @@ import android.content.DialogInterface; import android.graphics.Color; import android.graphics.PorterDuff; -import android.os.Build; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.constraint.ConstraintLayout; @@ -55,15 +56,18 @@ import com.plv.livescenes.access.PLVUserAbility; import com.plv.livescenes.access.PLVUserAbilityManager; import com.plv.livescenes.chatroom.IPLVChatroomManager; +import com.plv.livescenes.feature.pointreward.IPLVPointRewardDataSource; +import com.plv.livescenes.feature.pointreward.PLVRewardDataSource; import com.plv.livescenes.linkmic.manager.PLVLinkMicConfig; +import com.plv.livescenes.model.pointreward.PLVRewardSettingVO; import com.plv.livescenes.streamer.config.PLVStreamerConfig; import com.plv.thirdpart.blankj.utilcode.util.ConvertUtils; -import static com.plv.foundationsdk.utils.PLVAppUtils.postToMainThread; import java.util.HashMap; import java.util.Map; import io.socket.client.Ack; +import okhttp3.ResponseBody; /** * 更多布局 @@ -93,7 +97,6 @@ public class PLVSAMoreLayout extends FrameLayout implements View.OnClickListener //view private ConstraintLayout plvsaMoreLayout; - private TextView plvsaMoreTextTv; private ViewGroup plvsaMoreSettingsSv; private FlexboxLayout plvsaMoreSettingsLayout; private ImageView plvsaMoreCameraIv; @@ -130,6 +133,12 @@ public class PLVSAMoreLayout extends FrameLayout implements View.OnClickListener private ImageView moreHangUpViewerLinkmicIv; private TextView moreHangUpViewerLinkmicTv; private LinearLayout moreInteractSigninLl; + private LinearLayout moreGiftRewardLayout; + private ImageView moreGiftRewardIv; + private TextView moreGiftRewardTv; + private LinearLayout moreGiftEffectLayout; + private ImageView moreGiftEffectIv; + private TextView moreGiftEffectTv; //streamerPresenter private IPLVStreamerContract.IStreamerPresenter streamerPresenter; @@ -162,6 +171,7 @@ public class PLVSAMoreLayout extends FrameLayout implements View.OnClickListener private long lastClickCameraSwitchViewTime; private IPLVLiveRoomDataManager liveRoomDataManager; + private PLVRewardDataSource rewardDataSource = new PLVRewardDataSource(); private String channelId; /** @@ -198,7 +208,6 @@ private void initView() { LayoutInflater.from(getContext()).inflate(R.layout.plvsa_live_room_more_layout, this); plvsaMoreLayout = (ConstraintLayout) findViewById(R.id.plvsa_more_layout); - plvsaMoreTextTv = (TextView) findViewById(R.id.plvsa_more_text_tv); plvsaMoreSettingsSv = findViewById(R.id.plvsa_more_settings_sv); plvsaMoreSettingsLayout = (FlexboxLayout) findViewById(R.id.plvsa_more_settings_layout); plvsaMoreCameraIv = (ImageView) findViewById(R.id.plvsa_more_camera_iv); @@ -235,6 +244,12 @@ private void initView() { moreHangUpViewerLinkmicIv = findViewById(R.id.plvsa_more_hang_up_viewer_linkmic_iv); moreHangUpViewerLinkmicTv = findViewById(R.id.plvsa_more_hang_up_viewer_linkmic_tv); moreInteractSigninLl = findViewById(R.id.plvsa_more_interact_signin_layout); + moreGiftRewardLayout = findViewById(R.id.plvsa_more_gift_reward_layout); + moreGiftRewardIv = findViewById(R.id.plvsa_more_gift_reward_iv); + moreGiftRewardTv = findViewById(R.id.plvsa_more_gift_reward_tv); + moreGiftEffectLayout = findViewById(R.id.plvsa_more_gift_effect_layout); + moreGiftEffectIv = findViewById(R.id.plvsa_more_gift_effect_iv); + moreGiftEffectTv = findViewById(R.id.plvsa_more_gift_effect_tv); plvsaMoreCameraIv.setOnClickListener(this); plvsaMoreCameraTv.setOnClickListener(this); @@ -260,15 +275,17 @@ private void initView() { moreLinkmicSettingLayout.setOnClickListener(this); moreHangUpViewerLinkmicLayout.setOnClickListener(this); moreInteractSigninLl.setOnClickListener(this); + moreGiftRewardLayout.setOnClickListener(this); + moreGiftEffectLayout.setOnClickListener(this); plvsaMoreCloseRoomIv.setSelected(PolyvChatroomManager.getInstance().isCloseRoom()); plvsaMoreCloseRoomTv.setText(plvsaMoreCloseRoomIv.isSelected() ? R.string.plv_chat_cancel_close_room : R.string.plv_chat_confirm_close_room); if (!PLVLinkMicConfig.getInstance().isSupportScreenShare()){ - plvsaMoreSettingsLayout.removeView(plvsaMoreShareScreenLl); + plvsaMoreShareScreenLl.setVisibility(View.GONE); } - if (!PLVUserAbilityManager.myAbility().hasAbility(PLVUserAbility.STREAMER_ALLOW_CHANGE_MIX_LAYOUT)) { - plvsaMoreSettingsLayout.removeView(plvsaMoreMixLayout); + if (!PLVUserAbilityManager.myAbility().hasAbility(PLVUserAbility.STREAMER_ALLOW_CHANGE_GIFT_REWARD_OPEN)) { + moreGiftRewardLayout.setVisibility(View.GONE); } //init bitrateLayout @@ -359,6 +376,17 @@ public void onChanged(@Nullable PLVStatefulData polyvLiv } } }); + liveRoomDataManager.getRewardSettingData().observe((LifecycleOwner) getContext(), new Observer>() { + @Override + public void onChanged(@Nullable PLVStatefulData statefulData) { + liveRoomDataManager.getRewardSettingData().removeObserver(this); + if (statefulData == null || !statefulData.isSuccess() || statefulData.getData() == null) { + return; + } + boolean isOpen = statefulData.getData().getDonateGiftEnabled(); + moreGiftRewardLayout.setSelected(isOpen ? false : true); + } + }); } } @@ -428,6 +456,7 @@ public void init(IPLVLiveRoomDataManager liveRoomDataManager) { initBitrateMapIcon(); observeLiveRoomStatus(); updateLinkMicStrategy(liveRoomDataManager); + initMixLayoutButton(); } private void updateLinkMicStrategy(IPLVLiveRoomDataManager liveRoomDataManager) { @@ -435,8 +464,19 @@ private void updateLinkMicStrategy(IPLVLiveRoomDataManager liveRoomDataManager) final boolean isNewLinkMicStrategy = PLVChannelFeatureManager.onChannel(liveRoomDataManager.getConfig().getChannelId()) .isFeatureSupport(PLVChannelFeature.LIVE_NEW_LINKMIC_STRATEGY); if (!canControlLinkMic || !isNewLinkMicStrategy) { - plvsaMoreSettingsLayout.removeView(moreAllowViewerLinkmicLayout); - plvsaMoreSettingsLayout.removeView(moreLinkmicSettingLayout); + moreAllowViewerLinkmicLayout.setVisibility(View.GONE); + moreLinkmicSettingLayout.setVisibility(View.GONE); + moreHangUpViewerLinkmicLayout.setVisibility(View.GONE); + } + } + + private void initMixLayoutButton() { + final boolean showMixLayoutButton = PLVChannelFeatureManager.onChannel(liveRoomDataManager.getConfig().getChannelId()) + .getOrDefault(PLVChannelFeature.STREAMER_SETTING_SHOW_MIX_LAYOUT_BUTTON, true); + if (PLVUserAbilityManager.myAbility().hasAbility(PLVUserAbility.STREAMER_ALLOW_CHANGE_MIX_LAYOUT) && showMixLayoutButton) { + plvsaMoreMixLayout.setVisibility(View.VISIBLE); + } else { + plvsaMoreMixLayout.setVisibility(View.GONE); } } // @@ -794,6 +834,29 @@ public void onFailed(Throwable t) { if (onViewActionListener != null) { onViewActionListener.onShowSignInAction(); } + } else if (id == moreGiftRewardLayout.getId()) { + moreGiftRewardLayout.setSelected(!moreGiftRewardLayout.isSelected()); + moreGiftRewardLayout.setEnabled(false); + PLVToast.Builder.context(getContext()) + .setText(getContext().getString(R.string.plv_reward_gift_reward_switch_tips)) + .show(); + rewardDataSource.updateGiftReward(channelId, !moreGiftRewardLayout.isSelected(), new IPLVPointRewardDataSource.IPointRewardListener() { + @Override + public void onSuccess(ResponseBody responseBody) { + moreGiftRewardLayout.setEnabled(true); + } + + @Override + public void onFailed(Throwable throwable) { + moreGiftRewardLayout.setEnabled(true); + PLVCommonLog.exception(throwable); + } + }); + } else if (id == moreGiftEffectLayout.getId()) { + moreGiftEffectLayout.setSelected(!moreGiftEffectLayout.isSelected()); + if (onViewActionListener != null) { + onViewActionListener.onGiftEffectSwitch(!moreGiftEffectLayout.isSelected()); + } } } @@ -900,7 +963,6 @@ private void updateViewWithOrientation() { moreLayoutParam.height = MORE_LAYOUT_HEIGHT_LAND; moreLayoutParam.gravity = MORE_LAYOUT_GRAVITY_LAND; plvsaMoreLayout.setBackgroundResource(MORE_LAYOUT_BACKGROUND_RES_LAND); - settingLayoutParam.topToBottom = R.id.plvsa_more_text_tv; settingLayoutParam.topMargin = ConvertUtils.dp2px(plvsaMoreSettingsLayout.getChildCount() > 9 ? 48 : 0); } @@ -919,6 +981,11 @@ public interface OnViewActionListener { * 显示签到 */ void onShowSignInAction(); + + /** + * 礼物特效开关切换 + */ + void onGiftEffectSwitch(boolean isOpen); } // } diff --git a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/liveroom/PLVSANetworkDisconnectMaskLayout.java b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/liveroom/PLVSANetworkDisconnectMaskLayout.java new file mode 100644 index 00000000..ea0dfe4b --- /dev/null +++ b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/liveroom/PLVSANetworkDisconnectMaskLayout.java @@ -0,0 +1,85 @@ +package com.easefun.polyv.streameralone.modules.liveroom; + +import android.app.Activity; +import android.content.Context; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.FrameLayout; + +import com.easefun.polyv.livecommon.module.modules.streamer.contract.IPLVStreamerContract; +import com.easefun.polyv.livecommon.module.modules.streamer.view.PLVAbsStreamerView; +import com.easefun.polyv.livecommon.ui.widget.PLVClipOutMaskView; +import com.easefun.polyv.streameralone.R; +import com.plv.foundationsdk.utils.PLVNetworkUtils; +import com.plv.linkmic.PLVLinkMicConstant; +import com.plv.thirdpart.blankj.utilcode.util.ConvertUtils; + +/** + * @author Hoshiiro + */ +public class PLVSANetworkDisconnectMaskLayout extends FrameLayout { + + private PLVClipOutMaskView clipOutMaskView; + + public PLVSANetworkDisconnectMaskLayout(@NonNull Context context) { + super(context); + init(); + } + + public PLVSANetworkDisconnectMaskLayout(@NonNull Context context, @Nullable AttributeSet attrs) { + super(context, attrs); + init(); + } + + public PLVSANetworkDisconnectMaskLayout(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(); + } + + private void init() { + LayoutInflater.from(getContext()).inflate(R.layout.plvsa_network_disconnect_mask_layout, this); + clipOutMaskView = findViewById(R.id.plvsa_clip_out_mask_view); + } + + public final IPLVStreamerContract.IStreamerView streamerView = new PLVAbsStreamerView() { + @Override + public void onNetworkQuality(PLVLinkMicConstant.NetworkQuality quality) { + final boolean isNetworkDisconnected = quality == PLVLinkMicConstant.NetworkQuality.DISCONNECT || !PLVNetworkUtils.isConnected(getContext()); + onNetworkChanged(isNetworkDisconnected); + } + }; + + private void onNetworkChanged(boolean isNetworkDisconnected) { + final boolean currentVisible = getVisibility() == VISIBLE; + if (currentVisible == isNetworkDisconnected) { + return; + } + if (!isNetworkDisconnected) { + setVisibility(GONE); + return; + } + setupClipOutMaskView(); + setVisibility(VISIBLE); + } + + private void setupClipOutMaskView() { + clipOutMaskView.clearClipOutParams(); + final Activity activity = (Activity) getContext(); + final View closeIcon = activity.findViewById(R.id.plvsa_status_bar_close_iv); + if (closeIcon != null && closeIcon.isShown()) { + clipOutMaskView.clipOutRoundRect(closeIcon, ConvertUtils.dp2px(32)); + } + final View emptyFragmentCloseIcon = activity.findViewById(R.id.plvsa_empty_close_iv); + if (emptyFragmentCloseIcon != null && emptyFragmentCloseIcon.isShown()) { + clipOutMaskView.clipOutRoundRect(emptyFragmentCloseIcon, ConvertUtils.dp2px(32)); + } + final View networkStatusBar = activity.findViewById(R.id.plvsa_status_bar_network_status_layout); + if (networkStatusBar != null && networkStatusBar.isShown()) { + clipOutMaskView.clipOutRoundRect(networkStatusBar, ConvertUtils.dp2px(10)); + } + } + +} diff --git a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/liveroom/PLVSASettingLayout.java b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/liveroom/PLVSASettingLayout.java index 309253f4..af07b3c4 100644 --- a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/liveroom/PLVSASettingLayout.java +++ b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/liveroom/PLVSASettingLayout.java @@ -1,9 +1,9 @@ package com.easefun.polyv.streameralone.modules.liveroom; import static com.plv.foundationsdk.utils.PLVSugarUtil.getOrDefault; -import static com.plv.foundationsdk.utils.PLVSugarUtil.scaleToRange; import android.Manifest; +import android.annotation.SuppressLint; import android.app.Activity; import android.arch.lifecycle.LifecycleOwner; import android.arch.lifecycle.Observer; @@ -11,7 +11,6 @@ import android.content.DialogInterface; import android.content.res.Configuration; import android.graphics.Color; -import android.os.Build; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.constraint.ConstraintLayout; @@ -22,12 +21,12 @@ import android.view.ViewGroup; import android.widget.Button; import android.widget.FrameLayout; -import android.widget.HorizontalScrollView; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.easefun.polyv.livecommon.module.data.IPLVLiveRoomDataManager; +import com.easefun.polyv.livecommon.module.data.PLVStatefulData; import com.easefun.polyv.livecommon.module.modules.beauty.viewmodel.PLVBeautyViewModel; import com.easefun.polyv.livecommon.module.modules.beauty.viewmodel.vo.PLVBeautyUiState; import com.easefun.polyv.livecommon.module.modules.streamer.contract.IPLVStreamerContract; @@ -35,15 +34,15 @@ import com.easefun.polyv.livecommon.module.utils.PLVDebounceClicker; import com.easefun.polyv.livecommon.module.utils.PLVLiveLocalActionHelper; import com.easefun.polyv.livecommon.module.utils.PLVToast; -import com.easefun.polyv.livecommon.ui.widget.PLVBeadWidget; import com.easefun.polyv.livecommon.ui.widget.PLVConfirmDialog; import com.easefun.polyv.livecommon.ui.widget.PLVOrientationSensibleLinearLayout; import com.easefun.polyv.livecommon.ui.widget.menudrawer.PLVMenuDrawer; -import com.easefun.polyv.livecommon.ui.widget.roundview.PLVRoundRectLayout; +import com.easefun.polyv.livescenes.model.PolyvLiveClassDetailVO; import com.easefun.polyv.streameralone.R; import com.easefun.polyv.streameralone.ui.widget.PLVSAConfirmDialog; import com.plv.foundationsdk.component.di.PLVDependManager; import com.plv.foundationsdk.component.kv.PLVAutoSaveKV; +import com.plv.foundationsdk.log.PLVCommonLog; import com.plv.foundationsdk.permission.PLVFastPermission; import com.plv.foundationsdk.permission.PLVOnPermissionCallback; import com.plv.foundationsdk.utils.PLVAppUtils; @@ -54,32 +53,25 @@ import com.plv.livescenes.access.PLVChannelFeatureManager; import com.plv.livescenes.access.PLVUserAbility; import com.plv.livescenes.access.PLVUserAbilityManager; +import com.plv.livescenes.chatroom.PLVChatApiRequestHelper; import com.plv.livescenes.linkmic.vo.PLVLinkMicDenoiseType; import com.plv.livescenes.streamer.config.PLVStreamerConfig; import com.plv.socket.user.PLVSocketUserConstant; -import com.plv.thirdpart.blankj.utilcode.util.ConvertUtils; import com.plv.thirdpart.blankj.utilcode.util.ScreenUtils; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; +import io.reactivex.functions.Consumer; +import okhttp3.ResponseBody; + /** * 开播设置布局 */ public class PLVSASettingLayout extends FrameLayout implements IPLVSASettingLayout, View.OnClickListener { // - // 设置配置布局左右间距 - private final static int SETTING_CONFIG_LAYOUT_HORIZON_MARGIN_PORT = ConvertUtils.dp2px(24); - private final static int SETTING_CONFIG_LAYOUT_HORIZON_MARGIN_LAND = ConvertUtils.dp2px(132); - // 开始直播按钮左右间距 - private final static int START_LIVE_BUTTON_HORIZON_MARGIN_PORT = ConvertUtils.dp2px(24); - private final static int START_LIVE_BUTTON_HORIZON_MARGIN_LAND = ConvertUtils.dp2px(144); - // 标题框最大显示行数 - private final static int LIVE_TITLE_MAX_LINES_PORT = Integer.MAX_VALUE; - private final static int LIVE_TITLE_MAX_LINES_LAND = 2; - //直播间数据管理器 private IPLVLiveRoomDataManager liveRoomDataManager; private String channelId; @@ -108,27 +100,24 @@ public class PLVSASettingLayout extends FrameLayout implements IPLVSASettingLayo private ConstraintLayout plvsaSettingConfigLy; private TextView plvsaSettingLiveTitleTv; private View plvsaSettingLiveTitleSplitView; - private HorizontalScrollView settingActionScrollContainer; + private View settingActionScrollContainer; private ImageView plvsaSettingCameraOrientIv; private ImageView plvsaSettingMirrorIv; private ImageView plvsaSettingBitrateIv; - private ImageView plvsaSettingMixIv; - private ImageView plvsaSettingScreenOrientationIv; private TextView plvsaSettingCameraOrientTv; private TextView plvsaSettingMirrorTv; private TextView plvsaSettingBitrateTv; - private TextView plvsaSettingMixTv; - private TextView plvsaSettingScreenOrientationTv; + private LinearLayout settingMixLayout; + private LinearLayout settingScreenOrientationLayout; private LinearLayout plvsaSettingBtnLl; - private PLVRoundRectLayout plvsaSettingBeautyLayout; - private ImageView plvsaSettingBeautyIv; + private LinearLayout plvsaSettingBeautyLayout; private Button plvsaSettingStartLiveBtn; private PLVOrientationSensibleLinearLayout settingPushResolutionRatioLl; private ImageView settingPushResolutionRatioIv; private TextView settingPushResolutionRatioTv; private LinearLayout settingDenoiseLayout; private LinearLayout settingExternalAudioInputLayout; - private PLVBeadWidget settingActionScrollIndicator; + private LinearLayout settingLiveReplaySwitchLayout; private String liveTitle; @@ -180,23 +169,20 @@ private void initView() { plvsaSettingCameraOrientIv = findViewById(R.id.plvsa_setting_camera_orient_iv); plvsaSettingMirrorIv = findViewById(R.id.plvsa_setting_mirror_iv); plvsaSettingBitrateIv = findViewById(R.id.plvsa_setting_bitrate_iv); - plvsaSettingMixIv = findViewById(R.id.plvsa_setting_mix_layout_iv); - plvsaSettingScreenOrientationIv = findViewById(R.id.plvsa_setting_screen_orientation_iv); plvsaSettingCameraOrientTv = findViewById(R.id.plvsa_setting_camera_orient_tv); plvsaSettingMirrorTv = findViewById(R.id.plvsa_setting_mirror_tv); plvsaSettingBitrateTv = findViewById(R.id.plvsa_setting_bitrate_tv); - plvsaSettingMixTv = findViewById(R.id.plvsa_setting_mix_layout_tv); - plvsaSettingScreenOrientationTv = findViewById(R.id.plvsa_setting_screen_orientation_tv); + settingMixLayout = findViewById(R.id.plvsa_setting_mix_layout); + settingScreenOrientationLayout = findViewById(R.id.plvsa_setting_screen_orientation_layout); plvsaSettingBtnLl = findViewById(R.id.plvsa_setting_btn_ll); plvsaSettingBeautyLayout = findViewById(R.id.plvsa_setting_beauty_layout); - plvsaSettingBeautyIv = findViewById(R.id.plvsa_setting_beauty_iv); plvsaSettingStartLiveBtn = findViewById(R.id.plvsa_setting_start_live_btn); settingPushResolutionRatioLl = findViewById(R.id.plvsa_setting_push_resolution_ratio_ll); settingPushResolutionRatioIv = findViewById(R.id.plvsa_setting_push_resolution_ratio_iv); settingPushResolutionRatioTv = findViewById(R.id.plvsa_setting_push_resolution_ratio_tv); settingDenoiseLayout = findViewById(R.id.plvsa_setting_denoise_layout); settingExternalAudioInputLayout = findViewById(R.id.plvsa_setting_external_audio_input_layout); - settingActionScrollIndicator = findViewById(R.id.plvsa_setting_action_scroll_indicator); + settingLiveReplaySwitchLayout = findViewById(R.id.plvsa_setting_live_replay_switch_layout); plvsaSettingClosePageIv.setOnClickListener(this); plvsaSettingBeautyLayout.setOnClickListener(this); @@ -207,36 +193,12 @@ private void initView() { plvsaSettingMirrorTv.setOnClickListener(this); plvsaSettingBitrateIv.setOnClickListener(this); plvsaSettingBitrateTv.setOnClickListener(this); - plvsaSettingMixIv.setOnClickListener(this); - plvsaSettingMixTv.setOnClickListener(this); - plvsaSettingScreenOrientationIv.setOnClickListener(this); - plvsaSettingScreenOrientationTv.setOnClickListener(this); + settingMixLayout.setOnClickListener(this); + settingScreenOrientationLayout.setOnClickListener(this); settingPushResolutionRatioLl.setOnClickListener(this); settingDenoiseLayout.setOnClickListener(this); settingExternalAudioInputLayout.setOnClickListener(this); - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - settingActionScrollContainer.setOnScrollChangeListener(new OnScrollChangeListener() { - @Override - public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) { - updateScrollContainerIndicator(); - } - }); - } - post(new Runnable() { - @Override - public void run() { - updateScrollContainerIndicator(); - } - }); - - if (PLVUserAbilityManager.myAbility().hasAbility(PLVUserAbility.STREAMER_ALLOW_CHANGE_MIX_LAYOUT)) { - plvsaSettingMixIv.setVisibility(VISIBLE); - plvsaSettingMixTv.setVisibility(VISIBLE); - } else { - plvsaSettingMixIv.setVisibility(GONE); - plvsaSettingMixTv.setVisibility(GONE); - } + settingLiveReplaySwitchLayout.setOnClickListener(this); initTitleInputLayout(); initBitrateLayout(); @@ -468,16 +430,31 @@ private void initStartLiveBtnText() { plvsaSettingStartLiveBtn.setText(isGuest() ? getContext().getString(R.string.plvsa_setting_enter_live) : getContext().getString(R.string.plv_streamer_start_live)); } - private void initPushResolutionRatioLayout() { + private void initButtonVisibility(IPLVLiveRoomDataManager liveRoomDataManager) { final boolean userAllowChangeRatio = PLVUserAbilityManager.myAbility().hasAbility(PLVUserAbility.STREAMER_ALONE_ALLOW_CHANGE_PUSH_RATIO); final boolean channelAllowChangeRatio = PLVChannelFeatureManager.onChannel(liveRoomDataManager.getConfig().getChannelId()).isFeatureSupport(PLVChannelFeature.STREAMER_ALONE_ALLOW_CHANGE_PUSH_RESOLUTION_RATIO); settingPushResolutionRatioLl.setShowOnLandscape(userAllowChangeRatio && channelAllowChangeRatio); + + final boolean userAllowChangeLiveReplay = PLVUserAbilityManager.myAbility().hasAbility(PLVUserAbility.STREAMER_ALLOW_CHANGE_REPLAY_OPEN); + settingLiveReplaySwitchLayout.setVisibility(userAllowChangeLiveReplay ? View.VISIBLE : View.GONE); + + final boolean showOrientationButton = PLVChannelFeatureManager.onChannel(liveRoomDataManager.getConfig().getChannelId()) + .getOrDefault(PLVChannelFeature.STREAMER_SETTING_SHOW_ORIENTATION_BUTTON, true); + settingScreenOrientationLayout.setVisibility(showOrientationButton ? View.VISIBLE : View.GONE); + + final boolean showMixLayoutButton = PLVChannelFeatureManager.onChannel(liveRoomDataManager.getConfig().getChannelId()) + .getOrDefault(PLVChannelFeature.STREAMER_SETTING_SHOW_MIX_LAYOUT_BUTTON, true); + if (PLVUserAbilityManager.myAbility().hasAbility(PLVUserAbility.STREAMER_ALLOW_CHANGE_MIX_LAYOUT) && showMixLayoutButton) { + settingMixLayout.setVisibility(View.VISIBLE); + } else { + settingMixLayout.setVisibility(View.GONE); + } } - private void setupDefaultPushResolution(IPLVLiveRoomDataManager liveRoomDataManager) { + private void initOrientation(IPLVLiveRoomDataManager liveRoomDataManager) { final boolean isDefaultLandscape = PLVChannelFeatureManager.onChannel(liveRoomDataManager.getConfig().getChannelId()) .getOrDefault(PLVChannelFeature.STREAMER_ALONE_DEFAULT_LANDSCAPE_RESOLUTION, false); - if (PLVScreenUtils.isLandscape(getContext()) ^ isDefaultLandscape) { + if (PLVScreenUtils.isLandscape(getContext()) != isDefaultLandscape) { changeScreenOrientation(); } } @@ -526,12 +503,13 @@ public void init(IPLVLiveRoomDataManager liveRoomDataManager) { titleInputLayout.initTitle(liveTitle); bitrateLayout.init(liveRoomDataManager); mixLayout.init(liveRoomDataManager); + initButtonVisibility(liveRoomDataManager); initBitrateMapIcon(); initStartLiveBtnText(); - initPushResolutionRatioLayout(); - updateOnOrientationChanged(PLVScreenUtils.isLandscape(getContext())); - setupDefaultPushResolution(liveRoomDataManager); + updatePushResolutionRatioOnOrientationChanged(PLVScreenUtils.isLandscape(getContext())); + initOrientation(liveRoomDataManager); + observeLiveRoomData(); } @Override @@ -693,39 +671,7 @@ public void onChanged(@Nullable PLVLinkMicConstant.PushResolutionRatio resolutio protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); final boolean isLandscape = newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE; - updateOnOrientationChanged(isLandscape); - post(new Runnable() { - @Override - public void run() { - updateScrollContainerIndicator(); - } - }); - } - - private void updateOnOrientationChanged(boolean isLandscape) { updatePushResolutionRatioOnOrientationChanged(isLandscape); - - MarginLayoutParams settingConfigLayoutParam = (MarginLayoutParams) plvsaSettingConfigLy.getLayoutParams(); - MarginLayoutParams settingButtonLayoutParam = (MarginLayoutParams) plvsaSettingBtnLl.getLayoutParams(); - int liveTitleMaxLines; - - if (isLandscape) { - settingConfigLayoutParam.width = ConvertUtils.dp2px(450); - settingButtonLayoutParam.width = ConvertUtils.dp2px(450); - settingConfigLayoutParam.leftMargin = settingConfigLayoutParam.rightMargin = SETTING_CONFIG_LAYOUT_HORIZON_MARGIN_LAND; - settingButtonLayoutParam.leftMargin = settingButtonLayoutParam.rightMargin = START_LIVE_BUTTON_HORIZON_MARGIN_LAND; - liveTitleMaxLines = LIVE_TITLE_MAX_LINES_LAND; - } else { - settingConfigLayoutParam.width = ViewGroup.LayoutParams.MATCH_PARENT; - settingButtonLayoutParam.width = ViewGroup.LayoutParams.MATCH_PARENT; - settingConfigLayoutParam.leftMargin = settingConfigLayoutParam.rightMargin = SETTING_CONFIG_LAYOUT_HORIZON_MARGIN_PORT; - settingButtonLayoutParam.leftMargin = settingButtonLayoutParam.rightMargin = START_LIVE_BUTTON_HORIZON_MARGIN_PORT; - liveTitleMaxLines = LIVE_TITLE_MAX_LINES_PORT; - } - - plvsaSettingConfigLy.setLayoutParams(settingConfigLayoutParam); - plvsaSettingBtnLl.setLayoutParams(settingButtonLayoutParam); - plvsaSettingLiveTitleTv.setMaxLines(liveTitleMaxLines); } private void updatePushResolutionRatioOnOrientationChanged(boolean isLandscape) { @@ -755,6 +701,7 @@ private void updatePushResolutionRatioOnOrientationChanged(boolean isLandscape) // // + @SuppressLint("CheckResult") @Override public void onClick(View v) { if (!PLVDebounceClicker.tryClick(this)) { @@ -783,11 +730,9 @@ public void onClick(View v) { } else if (id == R.id.plvsa_setting_bitrate_iv || id == R.id.plvsa_setting_bitrate_tv) { bitrateLayout.open(); - } else if (id == R.id.plvsa_setting_mix_layout_iv - || id == R.id.plvsa_setting_mix_layout_tv) { + } else if (id == settingMixLayout.getId()) { mixLayout.open(); - } else if (id == plvsaSettingScreenOrientationIv.getId() - || id == plvsaSettingScreenOrientationTv.getId()) { + } else if (id == settingScreenOrientationLayout.getId()) { changeScreenOrientation(); } else if (id == plvsaSettingBeautyLayout.getId()) { PLVDependManager.getInstance().get(PLVBeautyViewModel.class).showBeautyMenu(); @@ -797,10 +742,41 @@ public void onClick(View v) { denoisePreferenceLayout.open(); } else if (id == settingExternalAudioInputLayout.getId()) { externalAudioInputPreferenceLayout.open(); + } else if (id == settingLiveReplaySwitchLayout.getId()) { + settingLiveReplaySwitchLayout.setSelected(!settingLiveReplaySwitchLayout.isSelected()); + settingLiveReplaySwitchLayout.setEnabled(false); + PLVChatApiRequestHelper.getInstance().updatePlaybackSetting(liveRoomDataManager.getConfig().getChannelId(), !settingLiveReplaySwitchLayout.isSelected()) + .subscribe(new Consumer() { + @Override + public void accept(ResponseBody responseBody) throws Exception { + settingLiveReplaySwitchLayout.setEnabled(true); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + settingLiveReplaySwitchLayout.setEnabled(true); + PLVCommonLog.exception(throwable); + } + }); } } // + // + private void observeLiveRoomData() { + liveRoomDataManager.getClassDetailVO().observe((LifecycleOwner) getContext(), new Observer>() { + @Override + public void onChanged(@Nullable PLVStatefulData statefulData) { + liveRoomDataManager.getClassDetailVO().removeObserver(this); + if (statefulData != null && statefulData.getData() != null && statefulData.getData().getData() != null){ + boolean playbackEnabled = statefulData.getData().getData().isPlaybackEnabled(); + settingLiveReplaySwitchLayout.setSelected(!playbackEnabled); + } + } + }); + } + // + // /** @@ -875,20 +851,6 @@ private void updateBitrateIcon(int selectedBitrate) { } } - private void updateScrollContainerIndicator() { - int maxSize = settingActionScrollContainer.getChildAt(0).getWidth(); - if (maxSize <= 0) { - maxSize = 1; - } - int pageSize = settingActionScrollContainer.getWidth(); - if (pageSize <= 0) { - pageSize = 1; - } - int currentOffset = settingActionScrollContainer.getScrollX(); - settingActionScrollIndicator.setBeadCount(maxSize / pageSize + 1); - settingActionScrollIndicator.setCurrentSelectedIndex((int) (scaleToRange(currentOffset, 0F, maxSize - pageSize, 0F, maxSize / pageSize) + 0.5)); - } - private void changeScreenOrientation() { if (PLVScreenUtils.isPortrait(getContext())) { PLVScreenUtils.enterLandscape((Activity) getContext()); diff --git a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/statusbar/IPLVSAStatusBarLayout.java b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/statusbar/IPLVSAStatusBarLayout.java index 4b93b196..6b366325 100644 --- a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/statusbar/IPLVSAStatusBarLayout.java +++ b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/statusbar/IPLVSAStatusBarLayout.java @@ -30,12 +30,17 @@ public interface IPLVSAStatusBarLayout { */ void updateChannelName(String channelName); - /** - * 设置停止直播回调监听 - * - * @param onStopLiveListener - */ - void setOnStopLiveListener(PLVSAStatusBarLayout.OnStopLiveListener onStopLiveListener); + void setOnViewActionListener(PLVSAStatusBarLayout.OnViewActionListener onViewActionListener); + + void notifyLinkMicTypeChange(boolean isVideoLinkMic, boolean isOpenLinkMic); + + void openMemberLayoutAndHideUserRequestTips(); + + void closeMemberLayout(); + + void showUserRequestTips(); + + void hideUserRequestTips(); /** * 是否拦截返回事件 diff --git a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/statusbar/PLVSAStatusBarLayout.java b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/statusbar/PLVSAStatusBarLayout.java index 1bc7d678..aefda7cf 100644 --- a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/statusbar/PLVSAStatusBarLayout.java +++ b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/modules/statusbar/PLVSAStatusBarLayout.java @@ -1,5 +1,7 @@ package com.easefun.polyv.streameralone.modules.statusbar; +import static com.plv.foundationsdk.utils.PLVSugarUtil.nullable; + import android.arch.lifecycle.LifecycleOwner; import android.arch.lifecycle.Observer; import android.content.Context; @@ -24,11 +26,14 @@ import com.easefun.polyv.livecommon.ui.widget.roundview.PLVRoundImageView; import com.easefun.polyv.livecommon.ui.widget.roundview.PLVRoundRectLayout; import com.easefun.polyv.streameralone.R; +import com.easefun.polyv.streameralone.modules.liveroom.PLVSALinkMicRequestTipsLayout; +import com.easefun.polyv.streameralone.modules.liveroom.PLVSAMemberLayout; import com.easefun.polyv.streameralone.ui.widget.PLVSAConfirmDialog; import com.plv.foundationsdk.component.proxy.PLVDynamicProxy; import com.plv.foundationsdk.utils.PLVAppUtils; import com.plv.foundationsdk.utils.PLVNetworkUtils; import com.plv.foundationsdk.utils.PLVScreenUtils; +import com.plv.foundationsdk.utils.PLVSugarUtil; import com.plv.linkmic.PLVLinkMicConstant; import com.plv.linkmic.model.PLVNetworkStatusVO; import com.plv.socket.user.PLVSocketUserConstant; @@ -41,13 +46,12 @@ /** * 状态栏布局 */ -public class PLVSAStatusBarLayout extends FrameLayout implements IPLVSAStatusBarLayout { +public class PLVSAStatusBarLayout extends FrameLayout implements IPLVSAStatusBarLayout, View.OnClickListener { // private View rootView; private ImageView plvsaStatusBarCloseIv; - private LinearLayout plvsaStatusBarInfoLl; private PLVRoundRectLayout plvsaStatusBarChannelInfoRl; private ImageView plvsaStatusBarChannelInfoIv; private TextView plvsaStatusBarChannelInfoTv; @@ -55,6 +59,7 @@ public class PLVSAStatusBarLayout extends FrameLayout implements IPLVSAStatusBar private PLVRoundRectLayout plvsaStatusBarMemberCountRl; private ImageView plvsaStatusBarMemberCountIv; private TextView plvsaStatusBarMemberCountTv; + private View plvsaMemberLinkmicRequestTipsView; private PLVRoundRectLayout plvsaStatusBarStreamerTimeRl; private PLVRoundImageView plvsaStatusBarStreamerStatusIv; private TextView plvsaStatusBarStreamerTimeTv; @@ -67,9 +72,11 @@ public class PLVSAStatusBarLayout extends FrameLayout implements IPLVSAStatusBar private PLVRoundRectLayout plvsaStatusBarNotificationLayout; private TextView plvsaStatusBarNotificationLabel; private TextView plvsaStatusBarNotificationTv; - + // 有人申请连麦时 连麦提示条布局 + private PLVSALinkMicRequestTipsLayout linkMicRequestTipsLayout; private PLVSAChannelInfoLayout channelInfoLayout; - + //成员列表布局 + private PLVSAMemberLayout memberLayout; // 停止直播确认对话框 private PLVConfirmDialog stopLiveConfirmDialog; @@ -81,7 +88,7 @@ public class PLVSAStatusBarLayout extends FrameLayout implements IPLVSAStatusBar private boolean isOpenAudio = true; private boolean isOpenVideo = true; - private OnStopLiveListener stopLiveListener; + private OnViewActionListener onViewActionListener; //关闭直播提示的文案 private String closeContentString; @@ -108,13 +115,12 @@ public PLVSAStatusBarLayout(@NonNull Context context, @Nullable AttributeSet att private void initView() { rootView = LayoutInflater.from(getContext()).inflate(R.layout.plvsa_status_bar_layout, this); findView(); - initChannelInfoOnClickListener(); - initCloseIconOnClickListener(); + initOnClickListener(); + observeLinkmicRequestLayout(); } private void findView() { plvsaStatusBarCloseIv = (ImageView) findViewById(R.id.plvsa_status_bar_close_iv); - plvsaStatusBarInfoLl = (LinearLayout) findViewById(R.id.plvsa_status_bar_info_ll); plvsaStatusBarChannelInfoRl = (PLVRoundRectLayout) findViewById(R.id.plvsa_status_bar_channel_info_rl); plvsaStatusBarChannelInfoIv = (ImageView) findViewById(R.id.plvsa_status_bar_channel_info_iv); plvsaStatusBarChannelInfoTv = (TextView) findViewById(R.id.plvsa_status_bar_channel_info_tv); @@ -122,6 +128,7 @@ private void findView() { plvsaStatusBarMemberCountRl = (PLVRoundRectLayout) findViewById(R.id.plvsa_status_bar_member_count_rl); plvsaStatusBarMemberCountIv = (ImageView) findViewById(R.id.plvsa_status_bar_member_count_iv); plvsaStatusBarMemberCountTv = (TextView) findViewById(R.id.plvsa_status_bar_member_count_tv); + plvsaMemberLinkmicRequestTipsView = findViewById(R.id.plvsa_member_linkmic_request_tips_view); plvsaStatusBarStreamerTimeRl = (PLVRoundRectLayout) findViewById(R.id.plvsa_status_bar_streamer_time_rl); plvsaStatusBarStreamerStatusIv = (PLVRoundImageView) findViewById(R.id.plvsa_status_bar_streamer_status_iv); plvsaStatusBarStreamerTimeTv = (TextView) findViewById(R.id.plvsa_status_bar_streamer_time_tv); @@ -134,24 +141,28 @@ private void findView() { plvsaStatusBarNotificationLayout = (PLVRoundRectLayout) findViewById(R.id.plvsa_status_bar_notification_layout); plvsaStatusBarNotificationLabel = (TextView) findViewById(R.id.plvsa_status_bar_notification_label); plvsaStatusBarNotificationTv = (TextView) findViewById(R.id.plvsa_status_bar_notification_tv); + linkMicRequestTipsLayout = findViewById(R.id.plvsa_linkmic_request_layout); + + memberLayout = new PLVSAMemberLayout(getContext()); + } + + private void initOnClickListener() { + plvsaStatusBarChannelInfoRl.setOnClickListener(this); + plvsaStatusBarCloseIv.setOnClickListener(this); + plvsaStatusBarMemberCountRl.setOnClickListener(this); } - private void initChannelInfoOnClickListener() { - plvsaStatusBarChannelInfoRl.setOnClickListener(new OnClickListener() { + private void observeLinkmicRequestLayout() { + linkMicRequestTipsLayout.setOnTipsClickListener(new PLVSALinkMicRequestTipsLayout.OnTipsClickListener() { @Override - public void onClick(View v) { - if (channelInfoLayout != null) { - channelInfoLayout.open(); - } + public void onClickBar() { + linkMicRequestTipsLayout.hide(); } - }); - } - private void initCloseIconOnClickListener() { - plvsaStatusBarCloseIv.setOnClickListener(new OnClickListener() { @Override - public void onClick(View v) { - showStopLiveConfirmLayout(); + public void onClickNavBtn() { + linkMicRequestTipsLayout.hide(); + openMemberLayoutAndHideUserRequestTips(); } }); } @@ -165,8 +176,8 @@ private void showStopLiveConfirmLayout() { .setRightBtnListener(new OnClickListener() { @Override public void onClick(View v) { - if (stopLiveListener != null) { - stopLiveListener.onStopLive(); + if (onViewActionListener != null) { + onViewActionListener.onStopLive(); } stopLiveConfirmDialog.hide(); } @@ -203,6 +214,8 @@ private void initCloseTipContent(IPLVLiveRoomDataManager liveRoomDataManager) { @Override public void init(IPLVLiveRoomDataManager liveRoomDataManager) { this.liveRoomDataManager = liveRoomDataManager; + //初始化成员布局 + memberLayout.init(liveRoomDataManager); initTeacherName(liveRoomDataManager); initChannelInfoLayout(liveRoomDataManager); @@ -212,6 +225,9 @@ public void init(IPLVLiveRoomDataManager liveRoomDataManager) { @Override public void setOnlineCount(int onlineCount) { plvsaStatusBarMemberCountTv.setText(StringUtils.toWString(onlineCount).toUpperCase()); + if (memberLayout != null) { + memberLayout.updateOnlineCount(onlineCount); + } } @Override @@ -222,8 +238,45 @@ public void updateChannelName(String channelName) { } @Override - public void setOnStopLiveListener(OnStopLiveListener stopLiveListener) { - this.stopLiveListener = stopLiveListener; + public void setOnViewActionListener(OnViewActionListener onViewActionListener) { + this.onViewActionListener = onViewActionListener; + } + + @Override + public void notifyLinkMicTypeChange(boolean isVideoLinkMic, boolean isOpenLinkMic) { + if (memberLayout != null) { + memberLayout.notifyLinkMicTypeChange(isVideoLinkMic, isOpenLinkMic); + } + } + + @Override + public void openMemberLayoutAndHideUserRequestTips() { + if (memberLayout != null) { + memberLayout.open(); + } + hideUserRequestTips(); + } + + @Override + public void closeMemberLayout() { + if (memberLayout != null) { + memberLayout.closeAndHideWindow(); + } + } + + @Override + public void showUserRequestTips() { + if (memberLayout != null && memberLayout.isOpen()) { + return; + } + plvsaMemberLinkmicRequestTipsView.setVisibility(View.VISIBLE); + linkMicRequestTipsLayout.show(); + } + + @Override + public void hideUserRequestTips() { + plvsaMemberLinkmicRequestTipsView.setVisibility(View.INVISIBLE); + linkMicRequestTipsLayout.hide(); } @Override @@ -231,6 +284,9 @@ public boolean onBackPressed() { if (channelInfoLayout != null) { return channelInfoLayout.onBackPressed(); } + if (memberLayout != null) { + return memberLayout.onBackPressed(); + } return false; } @@ -245,7 +301,16 @@ public void destroy() { public IPLVStreamerContract.IStreamerView getStreamerView() { return PLVDynamicProxy.forClass(IPLVStreamerContract.IStreamerView.class) - .proxyAll(streamerView, statusBarPushDowngradeAlertLayout.streamerView); + .proxyAll( + streamerView, + statusBarPushDowngradeAlertLayout.streamerView, + nullable(new PLVSugarUtil.Supplier() { + @Override + public IPLVStreamerContract.IStreamerView get() { + return memberLayout.getStreamerView(); + } + }) + ); } private IPLVStreamerContract.IStreamerView streamerView = new PLVAbsStreamerView() { @@ -484,6 +549,25 @@ private void updateViewWithOrientation() { // + // + + @Override + public void onClick(View v) { + final int id = v.getId(); + if (id == plvsaStatusBarChannelInfoRl.getId()) { + if (channelInfoLayout != null) { + channelInfoLayout.open(); + } + } else if (id == plvsaStatusBarCloseIv.getId()) { + showStopLiveConfirmLayout(); + } else if (id == plvsaStatusBarMemberCountRl.getId()) { + openMemberLayoutAndHideUserRequestTips(); + linkMicRequestTipsLayout.hide(); + } + } + + // + // private static String trimStringLength(String oriString, int specLength) { @@ -504,10 +588,7 @@ private boolean isGuest(){ // - /** - * 停止直播回调,由上层停止直播 - */ - public interface OnStopLiveListener { + public interface OnViewActionListener { void onStopLive(); } diff --git a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/scenes/PLVSAStreamerAloneActivity.java b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/scenes/PLVSAStreamerAloneActivity.java index 88543ab5..70a58004 100644 --- a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/scenes/PLVSAStreamerAloneActivity.java +++ b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/scenes/PLVSAStreamerAloneActivity.java @@ -47,8 +47,8 @@ import com.easefun.polyv.streameralone.modules.beauty.PLVSABeautyLayout; import com.easefun.polyv.streameralone.modules.liveroom.IPLVSASettingLayout; import com.easefun.polyv.streameralone.modules.liveroom.PLVSACleanUpLayout; -import com.easefun.polyv.streameralone.modules.liveroom.PLVSALinkMicRequestTipsLayout; import com.easefun.polyv.streameralone.modules.liveroom.PLVSAMoreLayout; +import com.easefun.polyv.streameralone.modules.liveroom.PLVSANetworkDisconnectMaskLayout; import com.easefun.polyv.streameralone.modules.streamer.IPLVSAStreamerLayout; import com.easefun.polyv.streameralone.modules.streamer.PLVSAStreamerFinishLayout; import com.easefun.polyv.streameralone.modules.streamer.PLVSAStreamerFullscreenLayout; @@ -113,8 +113,6 @@ public class PLVSAStreamerAloneActivity extends PLVBaseActivity { private PLVSAStreamerFinishLayout streamerFinishLayout; // 摄像头上层的viewpager布局 private PLVNoInterceptTouchViewPager topLayerViewPager; - // 有人申请连麦时 连麦提示条布局 - private PLVSALinkMicRequestTipsLayout linkMicRequestTipsLayout; // 美颜布局 private IPLVSABeautyLayout beautyLayout; // 主页fragment @@ -126,6 +124,8 @@ public class PLVSAStreamerAloneActivity extends PLVBaseActivity { // 互动布局 private IPLVStreamerInteractLayout interactLayout; + private PLVSANetworkDisconnectMaskLayout networkDisconnectMaskLayout; + // // @@ -222,9 +222,9 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { observeViewPagerLayout(); observeStreamerLayout(); observeCleanUpLayout(); - observeLinkmicRequestLayout(); observeFullscreenLayout(); observeBeautyLayoutStatus(); + observeNetworkDisconnectLayout(); } private void setStatusBarColor() { @@ -360,6 +360,8 @@ private void initLiveRoomManager() { // 进行网络请求,获取直播详情数据 liveRoomDataManager.requestChannelDetail(); + // 进行网络请求,请求打赏配置 + liveRoomDataManager.requestRewardSetting(); } // @@ -371,10 +373,11 @@ private void initView() { cleanUpLayout = findViewById(R.id.plvsa_clean_up_layout); streamerFinishLayout = findViewById(R.id.plvsa_streamer_finish_layout); topLayerViewPager = findViewById(R.id.plvsa_top_layer_view_pager); - linkMicRequestTipsLayout = findViewById(R.id.plvsa_linkmic_request_layout); fullscreenLayout = findViewById(R.id.plvsa_fullscreen_view); maskGroup = findViewById(R.id.plvsa_mask_group); interactLayout = findViewById(R.id.plvsa_interact_layout); + networkDisconnectMaskLayout = findViewById(R.id.plvsa_network_disconnect_mask_layout); + interactLayout.init(liveRoomDataManager); //初始化推流和连麦布局 @@ -421,6 +424,13 @@ public void onShowSignInAction() { interactLayout.showSignIn(); } } + + @Override + public void onGiftEffectSwitch(boolean isOpen) { + if (homeFragment != null) { + homeFragment.changeGiftEffectSwitch(isOpen); + } + } }); } } @@ -645,11 +655,6 @@ public void onStopLive() { updateStopLiveLayout(); } - @Override - public void onClickToOpenMemberLayout() { - linkMicRequestTipsLayout.cancel(); - } - @Override public boolean showCleanUpLayout() { boolean success = false; @@ -699,17 +704,7 @@ public boolean isStreamerStartSuccess() { emptyFragment.setOnViewActionListener(new PLVSAEmptyFragment.OnViewActionListener() { @Override public void onViewCreated() { - streamerLayout.addOnUserRequestListener(new IPLVOnDataChangedListener() { - @Override - public void onChanged(@Nullable String s) { - if (s == null) { - return; - } - if (PLVUserAbilityManager.myAbility().hasRole(PLVUserRole.STREAMER_TEACHER)) { - linkMicRequestTipsLayout.show(); - } - } - }); + } @Override @@ -720,27 +715,6 @@ public void onStopLive() { } // - // - - private void observeLinkmicRequestLayout() { - linkMicRequestTipsLayout.setOnTipsClickListener(new PLVSALinkMicRequestTipsLayout.OnTipsClickListener() { - @Override - public void onClickBar() { - linkMicRequestTipsLayout.cancel(); - } - - @Override - public void onClickNavBtn() { - linkMicRequestTipsLayout.cancel(); - // homeFragment index=1 - topLayerViewPager.setCurrentItem(1); - homeFragment.openMemberLayoutAndHideUserRequestTips(); - } - }); - } - - // - // private void observeFullscreenLayout() { if (streamerLayout != null && fullscreenLayout != null) { @@ -760,6 +734,14 @@ public void onExitFullscreen(PLVLinkMicItemDataBean linkmicItem, PLVViewSwitcher } // + // + + private void observeNetworkDisconnectLayout() { + streamerLayout.getStreamerPresenter().registerView(networkDisconnectMaskLayout.streamerView); + } + + // + // private void checkStreamRecover() { diff --git a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/scenes/fragments/PLVSAStreamerHomeFragment.java b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/scenes/fragments/PLVSAStreamerHomeFragment.java index beaa9c28..86c5edf3 100644 --- a/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/scenes/fragments/PLVSAStreamerHomeFragment.java +++ b/polyvStreamerAloneScene/src/main/java/com/easefun/polyv/streameralone/scenes/fragments/PLVSAStreamerHomeFragment.java @@ -35,10 +35,10 @@ import com.easefun.polyv.streameralone.R; import com.easefun.polyv.streameralone.modules.chatroom.IPLVSAChatroomLayout; import com.easefun.polyv.streameralone.modules.chatroom.PLVSAChatroomLayout; +import com.easefun.polyv.streameralone.modules.chatroom.adapter.PLVSAMessageAdapter; import com.easefun.polyv.streameralone.modules.chatroom.widget.PLVSAGreetingView; import com.easefun.polyv.streameralone.modules.chatroom.widget.PLVSARewardGiftAnimView; import com.easefun.polyv.streameralone.modules.liveroom.PLVSACommodityControlLayout; -import com.easefun.polyv.streameralone.modules.liveroom.PLVSAMemberLayout; import com.easefun.polyv.streameralone.modules.liveroom.PLVSAMoreLayout; import com.easefun.polyv.streameralone.modules.statusbar.PLVSAStatusBarLayout; import com.easefun.polyv.streameralone.modules.streamer.widget.PLVSALinkMicControlButton; @@ -80,8 +80,6 @@ public class PLVSAStreamerHomeFragment extends PLVBaseFragment implements View.O private IPLVLiveRoomDataManager liveRoomDataManager; //更多布局 private PLVSAMoreLayout moreLayout; - //成员列表布局 - private PLVSAMemberLayout memberLayout; //状态栏布局 private PLVSAStatusBarLayout plvsaStatusBarLayout; //打赏布局 @@ -96,10 +94,8 @@ public class PLVSAStreamerHomeFragment extends PLVBaseFragment implements View.O private ConstraintLayout homeFragmentLayout; private TextView plvsaToolBarCallInputTv; private ImageView plvsaToolBarMoreIv; - private ImageView plvsaToolBarMemberIv; private PLVSALinkMicControlButton plvsaToolBarLinkmicIv; private ImageView plvsaToolBarLinkmicTypeIv; - private View plvsaToolBarMemberLinkmicRequestTipsView; private TextView plvsaToolBarLinkmicTypeTip; private ImageView toolBarCommodityControlIv; // 评论上墙布局 @@ -114,6 +110,7 @@ public class PLVSAStreamerHomeFragment extends PLVBaseFragment implements View.O private boolean isBeautyLayoutShowing = false; private boolean isVideoLinkMic = false; private boolean isOpenLinkMic = false; + private boolean isOpenGiftEffect = true; // // @@ -143,24 +140,20 @@ private void initView() { plvsaChatroomLayout = (PLVSAChatroomLayout) findViewById(R.id.plvsa_chatroom_layout); plvsaToolBarCallInputTv = (TextView) findViewById(R.id.plvsa_tool_bar_call_input_tv); plvsaToolBarMoreIv = (ImageView) findViewById(R.id.plvsa_tool_bar_more_iv); - plvsaToolBarMemberIv = (ImageView) findViewById(R.id.plvsa_tool_bar_member_iv); plvsaToolBarLinkmicIv = findViewById(R.id.plvsa_tool_bar_linkmic_iv); plvsaToolBarLinkmicTypeIv = (ImageView) findViewById(R.id.plvsa_tool_bar_linkmic_type_iv); - plvsaToolBarMemberLinkmicRequestTipsView = findViewById(R.id.plvsa_tool_bar_member_linkmic_request_tips_view); plvsaToolBarLinkmicTypeTip = findViewById(R.id.plvsa_tool_bar_linkmic_type_tip); toolBarCommodityControlIv = findViewById(R.id.plvsa_tool_bar_commodity_control_iv); toTopView = findViewById(R.id.plvsa_chatroom_to_top_view); plvsaToolBarCallInputTv.setOnClickListener(this); plvsaToolBarMoreIv.setOnClickListener(this); - plvsaToolBarMemberIv.setOnClickListener(this); plvsaToolBarLinkmicTypeIv.setOnClickListener(this); toolBarCommodityControlIv.setOnClickListener(this); initLinkMicControlWindow(); moreLayout = new PLVSAMoreLayout(view.getContext()); - memberLayout = new PLVSAMemberLayout(view.getContext()); commodityControlLayout = new PLVSACommodityControlLayout(view.getContext()); // 初始化评论上墙布局 @@ -181,8 +174,8 @@ private void initLinkMicControlWindow() { public void onLinkMicOpenStateChanged(boolean isVideoLinkMicType, boolean isOpenLinkMic) { PLVSAStreamerHomeFragment.this.isVideoLinkMic = isVideoLinkMicType; PLVSAStreamerHomeFragment.this.isOpenLinkMic = isOpenLinkMic; - if (memberLayout != null) { - memberLayout.notifyLinkMicTypeChange(isVideoLinkMicType, isOpenLinkMic); + if (plvsaStatusBarLayout != null) { + plvsaStatusBarLayout.notifyLinkMicTypeChange(isVideoLinkMicType, isOpenLinkMic); } if (onViewActionListener != null) { onViewActionListener.onLinkMicMediaTypeUpdate(isVideoLinkMicType, isOpenLinkMic); @@ -269,8 +262,6 @@ public void init(IPLVLiveRoomDataManager liveRoomDataManager) { plvsaStatusBarLayout.init(liveRoomDataManager); //初始化聊天室布局 plvsaChatroomLayout.init(liveRoomDataManager); - //初始化成员布局 - memberLayout.init(liveRoomDataManager); //初始化更多布局 moreLayout.init(liveRoomDataManager); commodityControlLayout.init(liveRoomDataManager); @@ -282,6 +273,17 @@ public void init(IPLVLiveRoomDataManager liveRoomDataManager) { updateLinkMicStrategy(liveRoomDataManager); } + public void changeGiftEffectSwitch(boolean isOpen) { + if (plvsaChatroomLayout != null) { + isOpenGiftEffect = isOpen; + if (isOpen) { + plvsaChatroomLayout.changeDisplayType(PLVSAMessageAdapter.DISPLAY_DATA_TYPE_FULL); + } else { + plvsaChatroomLayout.changeDisplayType(PLVSAMessageAdapter.DISPLAY_DATA_TYPE_REMOVE_REWARD); + } + } + } + public void chatroomLogin(){ plvsaChatroomLayout.loginAndLoadHistory(); } @@ -313,7 +315,7 @@ public void registerToTopView() { } public void updateUserRequestStatus() { - showUserRequestTips(); + plvsaStatusBarLayout.showUserRequestTips(); } public void updateLinkMicLayoutTypeVisibility(boolean isShow) { @@ -326,13 +328,10 @@ public void updateLinkMicLayoutTypeVisibility(boolean isShow) { plvsaToolBarLinkmicTypeIv.setVisibility(isShow ? View.VISIBLE : View.INVISIBLE); } - public void openMemberLayoutAndHideUserRequestTips() { - memberLayout.open(); - hideUserRequestTips(); - } - public void closeMemberLayout() { - memberLayout.closeAndHideWindow(); + if (plvsaStatusBarLayout != null) { + plvsaStatusBarLayout.closeMemberLayout(); + } } public IPLVStreamerContract.IStreamerView getStreamerView() { @@ -345,12 +344,6 @@ public IPLVStreamerContract.IStreamerView get() { return moreLayout.getStreamerView(); } }), - nullable(new PLVSugarUtil.Supplier() { - @Override - public IPLVStreamerContract.IStreamerView get() { - return memberLayout.getStreamerView(); - } - }), nullable(new PLVSugarUtil.Supplier() { @Override public IPLVStreamerContract.IStreamerView get() { @@ -368,7 +361,6 @@ public PLVSAMoreLayout getMoreLayout() { public boolean onBackPressed() { return plvsaChatroomLayout.onBackPressed() || moreLayout.onBackPressed() - || memberLayout.onBackPressed() || plvsaStatusBarLayout.onBackPressed(); } @@ -467,7 +459,6 @@ public void onChanged(@Nullable Integer integer) { return; } plvsaStatusBarLayout.setOnlineCount(integer); - memberLayout.updateOnlineCount(integer); } }); //监听聊天室用户的登录事件 @@ -487,7 +478,9 @@ public void onChanged(@Nullable PLVRewardEvent rewardEvent) { if (rewardEvent == null) { return; } - plvsaChatroomRewardLy.acceptRewardGiftMessage(rewardEvent); + if (isOpenGiftEffect) { + plvsaChatroomRewardLy.acceptRewardGiftMessage(rewardEvent); + } addRewardEventToChatList(rewardEvent); } }); @@ -559,8 +552,7 @@ private void addRewardEventToChatList(PLVRewardEvent rewardEvent) { // private void observeStatusBarLayout() { - //监听状态栏回调 - plvsaStatusBarLayout.setOnStopLiveListener(new PLVSAStatusBarLayout.OnStopLiveListener() { + plvsaStatusBarLayout.setOnViewActionListener(new PLVSAStatusBarLayout.OnViewActionListener() { @Override public void onStopLive() { if (onViewActionListener != null) { @@ -572,19 +564,6 @@ public void onStopLive() { // - // - private void showUserRequestTips() { - if (memberLayout != null && memberLayout.isOpen()) { - return; - } - plvsaToolBarMemberLinkmicRequestTipsView.setVisibility(View.VISIBLE); - } - - private void hideUserRequestTips() { - plvsaToolBarMemberLinkmicRequestTipsView.setVisibility(View.GONE); - } - // - // @Override public void onClick(final View v) { @@ -593,11 +572,6 @@ public void onClick(final View v) { plvsaChatroomLayout.callInputWindow(); } else if (id == R.id.plvsa_tool_bar_more_iv) { moreLayout.open(); - } else if (id == R.id.plvsa_tool_bar_member_iv) { - openMemberLayoutAndHideUserRequestTips(); - if (onViewActionListener != null) { - onViewActionListener.onClickToOpenMemberLayout(); - } } else if (id == R.id.plvsa_tool_bar_linkmic_type_iv) { plvsaToolBarLinkmicTypeTip.setVisibility(View.INVISIBLE); if (PLVDebounceClicker.tryClick(this, 800)) { @@ -641,8 +615,6 @@ public interface OnViewActionListener { void onStopLive(); - void onClickToOpenMemberLayout(); - boolean showCleanUpLayout(); /** diff --git a/polyvStreamerAloneScene/src/main/res/drawable-xhdpi/plvsa_gift_effect_close.png b/polyvStreamerAloneScene/src/main/res/drawable-xhdpi/plvsa_gift_effect_close.png new file mode 100644 index 0000000000000000000000000000000000000000..f55c4546dcf89295bba4fd2972f3abdab7648f30 GIT binary patch literal 866 zcmV-o1D*VdP)Px#1am@3R0s$N2z&@+hyVZs3`s;mRA_aA;TP8#AP6izKJiD9@9_^X zY0{)glfsq7bWXAa@BzRp06zg-XIa+9d}lI|T=G;M$;G+bHdrJ}1>CXLB=d8(Ggu@m z3m{3}lPo-Z79_7^y?y^%+bGy8?QjnO zB*oXPNj3p>OI=%DCgip$2T%sqZFL1N0v-NO+M06fa{#RwW;u_18%b{do&q5 zb-?d7gV7h;GAA_nmIZyCJY5}~_r3~Ng(rj>Z!qo!U0{8`SLbq1|(XOqkk}qJo#ClK*;B%H`*Gb;S zbjiGP2_i87iv*AjJx<(A3QqJCOQku0_ZT-9wgBF#BBO-<2;eP%*Yfdi06zeHi*{1;r+!}aH<~cNX|56C$tI?_oipFwm~Z1wHX3e@NkvYhbwxvodvK~_}}$xa*CTKEu^$L z)@}$~;{qq`Z^rx(+BwWh>g@b+Er5e>=&KoXNjJ??A>99(^%Vx~&62*9LC?e%qj|(a0 s@roja?Bw4@J}b`Iwn>vFO?saC3uUdE8Td1MGXMYp07*qoM6N<$f~C8LBLDyZ literal 0 HcmV?d00001 diff --git a/polyvStreamerAloneScene/src/main/res/drawable-xhdpi/plvsa_gift_effect_open.png b/polyvStreamerAloneScene/src/main/res/drawable-xhdpi/plvsa_gift_effect_open.png new file mode 100644 index 0000000000000000000000000000000000000000..a621840f45e94b69dad63ebe011334a05b371dbb GIT binary patch literal 1181 zcmV;O1Y-M%P)Px#1am@3R0s$N2z&@+hyVZtM@d9MRA_ zD~KW8IS|rXu2P;49O5DnU*~XvIFRPTfqf}Mz&2^F(;D0cE5&so-YTeyR9tby(f(3A z$@;Hdt)zAC(615f)0>@d=e;*GyD-;WbImnZdf6E*WNpWi0=Cq(WF>7X*(zu$+vT1DP;${MOS(!i*B|D~oea6-vW zdpLmeIJl`wuKGxmq|?gJ5^hjyG)vWz`Zm!Xlv|QzAU}znl)9g!c}~3t<*N8AZU+wF z>zP=Uv?%E$<0UyvvHjrKOH|Scu$k)V%tj-Z>R5nsIWF-A&qyJ#HY{a~+b$I*b|<|; zAOL>Hy`gI=J8RA@JDDjx)KNvP0P`6@UTKUsZljbs(aV)e zo4^C6n+rprIOt^bcdvbN-j+lGS`WbLQgr5t)8N~8g5Eh(=_Z;_y9Mh{Xs&2xLFWa3 zPkGchl45Kdfmv=lIA}kdS+z?iqyzol%)0iS|HVHAS?;7Au~^kjQ89ROw*s>P+$UWb z)z{zod&(1)L2y~$c?r0gx-l7=Zpa0FZxSWaM~Yw!8H z*S`5hDYh6Hq^qsPX8!O(hufw&92`w z6w-#H8JV~eZ@_r>2bI0gJW3lL3-7kC^}_w|tGbpbD4*)vgobzWA%m0jIW9-0QsF)0 z;}0Fk`ujO{er)jRdN-DFZFL2nJPx#1am@3R0s$N2z&@+hyVZr$Vo&&RA_kmTfqF1tf=NHcqq?;QF* zTKdnr(ohM>#NuGdy*?XCSX$HX>zO3|56MZ5qa}0IK4Gzp>qyTmt$_9=YGOe0*0HVk z5`EoQ}t^hpOnEfpxVJy)|GXN_Oy8!T0L^hr_BEeF-7X^v~Er6-VIJs%RNHPIXnX{>3 zYulnVg6=5^8+(i0si)oAltv5_eW#V2Oh;@1tkwHgL~@r-eGs?-usAl>g)A^fAeGP>uFo#8)ipSRg#sEg@@)Lju05>9%9W`Rdaqu9U%_19~y2M2ubL*}{ zf%k?s7bJHL#@dm*DEo&N2Ny33YBuihZ#lX!0&rK(WJm%xhETACS==`OZ`JD(hexgv zn&ewMTB38UuI`T2RBJysv>669gIf8zrhWQSq=?K-HbN4ZY2~q2zA^MkwV7OK_2Xa! z8e*9K+xvtfeWLSHq#ip*u7O@3{49vbiX;H&=fG55KREn4&7k^rGe7sL;bDM&(#nbQ zWd+Mj0{EiaXtG4t4cZ=qegow}D}OFOREX67m~)khz5oCK literal 0 HcmV?d00001 diff --git a/polyvStreamerAloneScene/src/main/res/drawable-xhdpi/plvsa_gift_reward_open.png b/polyvStreamerAloneScene/src/main/res/drawable-xhdpi/plvsa_gift_reward_open.png new file mode 100644 index 0000000000000000000000000000000000000000..6c90f9e1f052bb6ba7ba8e602c41261aad28a901 GIT binary patch literal 1037 zcmV+o1oHcdP)Px#1am@3R0s$N2z&@+hyVZsw@E}nRA_pOe0#Uk*?hG*`2Wb)lirNr}O`3F`fZGsVk&gPVP~D>0m)a>9A9pFgX+`i z4b)mF$!fv|NvabZvOOd#9L)jA+ZKJ_r}VF#mWHvA^iu}dXE*sYdcqnR{T`i>q+v*^ zjDhx9@3r@7+&GKI8A~%T-9<-HCb@0dHn)rZFb#ns5|I28fC6x7Ow+$bBqaG9KqtfO zClPVOMGFc}4#{dj6USBnRC3%W5Rt_c+YfWt4FNRA%~hL4<{|Ql8%KExwtbR;h-{Cl z^ehbI9l&Yer&ZVpoM{SyvrZv!*0B+&PkInjK&MsM#KC0%HH_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H|y}_4=o<;>ig9zgh8vZTX0xc>(M?(*_WQ2Auw>8U4SXBR%W+}e^T zdMmY=v#HNbT}5CyI8Xr-OOr4GpiOz<$)8~nk7y=e-&6rIdP{M*1;P{d75#3ly$ASomNJB)XiMtaR zYb;;}l!|S~L#D01AlE=+-Dw{Gt=$mjR;`S2FB>DW6}tasJzST~x&pG5dm^*_$Q$^r z(MJ2v3{+cpLib+ztre`ty@w#QZg(|OT9=v!PGByed={wzL<5CNs1;W3Dm%N`a+`Hi z(0Ed)^zCBH`I~jMvvV|6n4d!S866S6`Y<`2?(9P8n--7$(vPcG3)lO4GnWQijmrcU zwCOVuCyyOurp>x>v6Z`Q2|8E3Qn&?uzFN$}WJ!k^Y?e%I$luJVw(dj&g-Z2ucw%^g b=Z${>1GpN?b%y`L00000NkvXXu0mjfRcTdv literal 0 HcmV?d00001 diff --git a/polyvStreamerAloneScene/src/main/res/drawable-xhdpi/plvsa_live_room_setting_beauty_icon.png b/polyvStreamerAloneScene/src/main/res/drawable-xhdpi/plvsa_live_room_setting_beauty_icon.png index b4fa97c5618ea47fbe606a865f13570b96cd8e63..e182159e7b3ae6f255f293c1fafaa7d9f40e4013 100644 GIT binary patch literal 1927 zcmV;22YC32P)Px#1am@3R0s$N2z&@+hyVZwF-b&0RCt{2-Mw$zWE=LoxfX;36apELni2vM zOKI6)0s03N!Nx$PG9tBL3Vd_M>WvOVEEH~s>q6|?|SxTB#ZA^Q;7u)wd z47D%MJ@-71AHUq4?L1%UQSTC;&;I0hkNwy_7cem~F)=YQF)=YQF)=aG$=IkDAVEaS zPKUk}5t29TD9f8U_`F~zS2r;}2zpvYX z1~l8HKwjOs!PcqjQngxri&DDHtp5R1ZT!bv*4Sw$08DtEx2%IrDW$e;e}#f#ccJ(9 z_fHc-{uWf*`jaP5K0_~JSex+MaRA31$GM}6&221m*>5YcZQDM}Rdiooym;{~4iRm zWjdi7NC0KavSxYcr%#`L4K;3McX#(fyH=OoIb|UBsd}Kn%j-U^=pFe;8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h$ z2eywtErP4PVtHVBo^cGW=nGb0pR=ue(wzLxwRrUw_4$TzxvrNPn{4!m;hVqAQj{R| zZA|A`LRjoxn`8^~2t$>fRPa;~ij>JNe~aSTzlDWm3PqZ%oCvY|6Ur@D0bOk8Z}{bw zyPAs&@%kbwgkxm_P=~$VB>C4ee3kd>X|YukZ^R6&PO+JVj!thMBz}Lf@%QZcca@_N z;M@nyLC@OeAQUnoVm}VOnIsEN`eZHS6o{4nMgN2(Y}5A5KUV$X&IencgTETv3HWrU zM(P(i;*BV$9QosnK?rGveo84b_v}5mK6qlOz~jHmt-uKKLJsEru`v literal 0 HcmV?d00001 diff --git a/polyvStreamerAloneScene/src/main/res/drawable/plvsa_gift_effect_selector.xml b/polyvStreamerAloneScene/src/main/res/drawable/plvsa_gift_effect_selector.xml new file mode 100644 index 00000000..fb846fcc --- /dev/null +++ b/polyvStreamerAloneScene/src/main/res/drawable/plvsa_gift_effect_selector.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/polyvStreamerAloneScene/src/main/res/drawable/plvsa_gift_reward_selector.xml b/polyvStreamerAloneScene/src/main/res/drawable/plvsa_gift_reward_selector.xml new file mode 100644 index 00000000..479c7f0a --- /dev/null +++ b/polyvStreamerAloneScene/src/main/res/drawable/plvsa_gift_reward_selector.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/polyvStreamerAloneScene/src/main/res/drawable/plvsa_live_replay_selector.xml b/polyvStreamerAloneScene/src/main/res/drawable/plvsa_live_replay_selector.xml new file mode 100644 index 00000000..1254fdf0 --- /dev/null +++ b/polyvStreamerAloneScene/src/main/res/drawable/plvsa_live_replay_selector.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/polyvStreamerAloneScene/src/main/res/layout/plvsa_streamer_alone_activity.xml b/polyvStreamerAloneScene/src/main/res/layout/plvsa_streamer_alone_activity.xml index ebb5c8a8..bf13eee3 100644 --- a/polyvStreamerAloneScene/src/main/res/layout/plvsa_streamer_alone_activity.xml +++ b/polyvStreamerAloneScene/src/main/res/layout/plvsa_streamer_alone_activity.xml @@ -45,12 +45,6 @@ android:overScrollMode="never" android:visibility="invisible" /> - - - + + + + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="wrap_content" + android:layout_height="wrap_content"> - + app:rectRadius="16dp" + app:triangleHeight="6dp" + app:triangleWidth="11dp" + app:trianglePosition="top" + app:triangleMarginType="center"> + android:orientation="horizontal" + android:paddingVertical="4dp"> + android:textSize="14sp" />