update 清晰度切换
This commit is contained in:
@@ -28,6 +28,8 @@ public class EnterRoomNewModel extends BaseModel {
|
||||
private String isUseHotCard = "";//是否使用热度卡
|
||||
@SerializedName("liveRoomActivity")
|
||||
private List<LiveRoomActivityModel> liveRoomActivityModels = new ArrayList<>();//活动列表
|
||||
@SerializedName("clarityType")
|
||||
private int clarityType;
|
||||
|
||||
public List<LiveRoomActivityModel> getLiveRoomActivityModels() {
|
||||
return liveRoomActivityModels;
|
||||
@@ -109,4 +111,12 @@ public class EnterRoomNewModel extends BaseModel {
|
||||
this.isUseHotCard = isUseHotCard;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getClarityType() {
|
||||
return clarityType;
|
||||
}
|
||||
|
||||
public void setClarityType(int clarityType) {
|
||||
this.clarityType = clarityType;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.InputFilter;
|
||||
import android.text.InputType;
|
||||
import android.text.Spanned;
|
||||
@@ -68,6 +70,20 @@ public class DialogUitl {
|
||||
}
|
||||
return dialog;
|
||||
}
|
||||
public static void showToast(Context context,String content,long delayMillis){
|
||||
Dialog dialog = new Dialog(context, R.style.dialog);
|
||||
dialog.setContentView(R.layout.dialog_toast);
|
||||
dialog.setCancelable(false);
|
||||
dialog.setCanceledOnTouchOutside(false);
|
||||
if (!TextUtils.isEmpty(content)) {
|
||||
TextView titleView = (TextView) dialog.findViewById(R.id.text);
|
||||
if (titleView != null) {
|
||||
titleView.setText(content);
|
||||
}
|
||||
}
|
||||
dialog.show();
|
||||
new Handler(Looper.getMainLooper()).postDelayed(dialog::dismiss,delayMillis);
|
||||
}
|
||||
|
||||
|
||||
public static Dialog loadingDialog(Context context) {
|
||||
|
||||
@@ -2,13 +2,17 @@ package com.yunbao.common.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
public class LiveClarityCustomPopup extends BottomPopupView implements View.OnClickListener {
|
||||
@@ -17,6 +21,8 @@ public class LiveClarityCustomPopup extends BottomPopupView implements View.OnCl
|
||||
private int selectClarity = 1;
|
||||
private RelativeLayout lineSd, lineHd, lineFhd;
|
||||
private ImageView iconSd, iconHd, iconFhd;
|
||||
private ImageView titleSDImg, titleHDImg, titleFHDImg;
|
||||
private TextView titleSDText, titleHDText, titleFHDText;
|
||||
private int banSelect;
|
||||
|
||||
public int getSelectClarity() {
|
||||
@@ -25,8 +31,12 @@ public class LiveClarityCustomPopup extends BottomPopupView implements View.OnCl
|
||||
|
||||
public LiveClarityCustomPopup(@NonNull Context context, int selectClarity, int banSelect) {
|
||||
super(context);
|
||||
this.selectClarity = selectClarity;
|
||||
this.banSelect = banSelect;
|
||||
if (selectClarity == -1) {
|
||||
selectClarity = 0;
|
||||
}
|
||||
this.selectClarity = selectClarity;
|
||||
ToastUtil.show("ban "+banSelect);
|
||||
}
|
||||
|
||||
public LiveClarityCustomPopup(@NonNull Context context, int selectClarity) {
|
||||
@@ -67,6 +77,12 @@ public class LiveClarityCustomPopup extends BottomPopupView implements View.OnCl
|
||||
iconSd = findViewById(R.id.icon_sd);
|
||||
iconHd = findViewById(R.id.icon_hd);
|
||||
iconFhd = findViewById(R.id.icon_fhd);
|
||||
titleSDImg = findViewById(R.id.sd);
|
||||
titleHDImg = findViewById(R.id.hd);
|
||||
titleFHDImg = findViewById(R.id.fhd);
|
||||
titleSDText = findViewById(R.id.sd_text);
|
||||
titleHDText = findViewById(R.id.hd_text);
|
||||
titleFHDText = findViewById(R.id.fhd_text);
|
||||
selectClarity(selectClarity);
|
||||
//流畅
|
||||
ViewClicksAntiShake.clicksAntiShake(lineSd, () -> {
|
||||
@@ -90,8 +106,14 @@ public class LiveClarityCustomPopup extends BottomPopupView implements View.OnCl
|
||||
if (banSelect == BAN_720) {
|
||||
lineFhd.setEnabled(false);
|
||||
lineHd.setEnabled(false);
|
||||
titleHDImg.setImageAlpha(40);
|
||||
titleFHDImg.setImageAlpha(40);
|
||||
titleHDText.setAlpha(0.2f);
|
||||
titleFHDText.setAlpha(0.2f);
|
||||
} else if (banSelect == BAN_1080) {
|
||||
lineFhd.setEnabled(false);
|
||||
titleFHDText.setAlpha(0.2f);
|
||||
titleFHDImg.setImageAlpha(20);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
android:src="@mipmap/icon_sd" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sd_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/sd"
|
||||
@@ -79,6 +80,7 @@
|
||||
android:src="@mipmap/icon_hd" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/hd_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/hd"
|
||||
@@ -116,6 +118,7 @@
|
||||
android:src="@mipmap/icon_fhd" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fhd_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/fhd"
|
||||
|
||||
18
common/src/main/res/layout/dialog_toast.xml
Normal file
18
common/src/main/res/layout/dialog_toast.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_loading_dialog"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/loading"
|
||||
android:textColor="@color/white"
|
||||
android:layout_margin="15dp"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user