调整画质选择UI逻辑

This commit is contained in:
zlzw 2023-01-03 11:35:34 +08:00
parent a1d95d6a94
commit 76055543c3
4 changed files with 7 additions and 22 deletions

View File

@ -31,6 +31,7 @@ public class LiveClarityCustomPopup extends BottomPopupView implements View.OnCl
private ImageView titleSDImg, titleHDImg, titleFHDImg; private ImageView titleSDImg, titleHDImg, titleFHDImg;
private TextView titleSDText, titleHDText, titleFHDText; private TextView titleSDText, titleHDText, titleFHDText;
private int banSelect; private int banSelect;
private boolean isUser = false;
public int getSelectClarity() { public int getSelectClarity() {
return selectClarity; return selectClarity;
@ -42,6 +43,7 @@ public class LiveClarityCustomPopup extends BottomPopupView implements View.OnCl
if (selectClarity == -1) { if (selectClarity == -1) {
selectClarity = 0; selectClarity = 0;
} }
this.isUser = true;
this.selectClarity = selectClarity; this.selectClarity = selectClarity;
} }
@ -99,7 +101,7 @@ public class LiveClarityCustomPopup extends BottomPopupView implements View.OnCl
//高清 //高清
ViewClicksAntiShake.clicksAntiShake(lineHd, () -> { ViewClicksAntiShake.clicksAntiShake(lineHd, () -> {
String memorg = formateFileSize(Long.parseLong(DeviceUtils.getMemory(getContext()))); 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 = 1;
selectClarity(selectClarity); selectClarity(selectClarity);
dismiss(); dismiss();

View File

@ -708,25 +708,9 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
@Override @Override
public void onDismiss(BasePopupView popupView) { public void onDismiss(BasePopupView popupView) {
int selectClarity = liveClarityCustomPopup.getSelectClarity(); int selectClarity = liveClarityCustomPopup.getSelectClarity();
if (selectClarity == PLAY_MODEL) return; if (selectClarity == PLAY_MODEL || PLAY_MODEL == PLAY_MODEL_DEF) return;
if (selectClarity == 2) { switchStream(srcUrl, selectClarity);
new DialogUitl.Builder(mContext) showToast();
.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();
}
} }
private void showToast() { private void showToast() {

View File

@ -71,7 +71,6 @@ public abstract class LiveRoomPlayViewHolder extends AbsViewHolder implements IL
} }
public void setLiveEnterRoomNewModel(EnterRoomNewModel data) { public void setLiveEnterRoomNewModel(EnterRoomNewModel data) {
data.setClarityType(2);
this.roomModel = data; this.roomModel = data;
} }

View File

@ -357,7 +357,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
landscape = data.getLiveInfo().getLandscape(); landscape = data.getLiveInfo().getLandscape();
mLivePlayViewHolder.setLiveBeanLandscape(landscape); mLivePlayViewHolder.setLiveBeanLandscape(landscape);
mLivePlayViewHolder.setLiveEnterRoomNewModel(data); 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); liveHandler.postDelayed(() -> mLiveRoomViewHolder.getIsHot(data.getIsUseHotCard()), 700);