From 76055543c31b7fd02a5f63319d82483fb3c21ae6 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 3 Jan 2023 11:35:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=94=BB=E8=B4=A8=E9=80=89?= =?UTF-8?q?=E6=8B=A9UI=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/views/LiveClarityCustomPopup.java | 4 +++- .../live/views/LivePlayRyViewHolder.java | 22 +++---------------- .../live/views/LiveRoomPlayViewHolder.java | 1 - .../live/views/PortraitLiveManager.java | 2 +- 4 files changed, 7 insertions(+), 22 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/views/LiveClarityCustomPopup.java b/common/src/main/java/com/yunbao/common/views/LiveClarityCustomPopup.java index 66c537258..4a589f89a 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveClarityCustomPopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveClarityCustomPopup.java @@ -31,6 +31,7 @@ public class LiveClarityCustomPopup extends BottomPopupView implements View.OnCl private ImageView titleSDImg, titleHDImg, titleFHDImg; private TextView titleSDText, titleHDText, titleFHDText; private int banSelect; + private boolean isUser = false; public int getSelectClarity() { return selectClarity; @@ -42,6 +43,7 @@ public class LiveClarityCustomPopup extends BottomPopupView implements View.OnCl if (selectClarity == -1) { selectClarity = 0; } + this.isUser = true; this.selectClarity = selectClarity; } @@ -99,7 +101,7 @@ public class LiveClarityCustomPopup extends BottomPopupView implements View.OnCl //高清 ViewClicksAntiShake.clicksAntiShake(lineHd, () -> { String memorg = formateFileSize(Long.parseLong(DeviceUtils.getMemory(getContext()))); - if (Double.parseDouble(memorg) > 7 && netAverage > 100) { + if ((Double.parseDouble(memorg) > 7 && netAverage > 100) || isUser) { selectClarity = 1; selectClarity(selectClarity); dismiss(); diff --git a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java index 62d157f9e..45788c763 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java @@ -708,25 +708,9 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { @Override public void onDismiss(BasePopupView popupView) { int selectClarity = liveClarityCustomPopup.getSelectClarity(); - if (selectClarity == PLAY_MODEL) return; - if (selectClarity == 2) { - new DialogUitl.Builder(mContext) - .setTitle("超高清提示") - .setContent("在網速不穩定的情況下,選擇超高清將會有可能導致直播間畫面卡頓,是否確認選擇?") - .setConfrimString("堅持選擇") - .setCancelString("返回") - .setClickCallback(new DialogUitl.SimpleCallback() { - @Override - public void onConfirmClick(Dialog dialog, String content) { - switchStream(srcUrl, selectClarity); - dialog.dismiss(); - showToast(); - } - }).build().show(); - } else { - switchStream(srcUrl, selectClarity); - showToast(); - } + if (selectClarity == PLAY_MODEL || PLAY_MODEL == PLAY_MODEL_DEF) return; + switchStream(srcUrl, selectClarity); + showToast(); } private void showToast() { diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomPlayViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomPlayViewHolder.java index 78df9fb2f..420351b89 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomPlayViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomPlayViewHolder.java @@ -71,7 +71,6 @@ public abstract class LiveRoomPlayViewHolder extends AbsViewHolder implements IL } public void setLiveEnterRoomNewModel(EnterRoomNewModel data) { - data.setClarityType(2); this.roomModel = data; } diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index 63aa213a2..0b480f961 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -357,7 +357,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe landscape = data.getLiveInfo().getLandscape(); mLivePlayViewHolder.setLiveBeanLandscape(landscape); mLivePlayViewHolder.setLiveEnterRoomNewModel(data); - mLivePlayViewHolder.switchStream(mLiveBean.getPull(), data.getClarityType() - 1); + mLivePlayViewHolder.switchStream(mLiveBean.getPull(), (data.getClarityType() - 1)==2?1:(data.getClarityType() - 1)); //是否热度卡加成 liveHandler.postDelayed(() -> mLiveRoomViewHolder.getIsHot(data.getIsUseHotCard()), 700);