调整画质选择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 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();

View File

@ -708,26 +708,10 @@ 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 {
if (selectClarity == PLAY_MODEL || PLAY_MODEL == PLAY_MODEL_DEF) return;
switchStream(srcUrl, selectClarity);
showToast();
}
}
private void showToast() {
DialogUitl.showToast(mContext, " 設置成功\n" +

View File

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

View File

@ -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);