侧边栏修改,新增播放设置

This commit is contained in:
18401019693 2023-04-02 14:22:30 +08:00
parent 326bb5ae7f
commit d320373b07
9 changed files with 241 additions and 10 deletions

View File

@ -23,6 +23,28 @@ public class CustomDrawerPopupEvent extends BaseModel {
private boolean refresh = false;
//特效設置
private boolean effects = false;
//小窗播放
private boolean smallWindow = false;
//畫質選擇
private boolean qualitySelection = false;
public boolean isSmallWindow() {
return smallWindow;
}
public CustomDrawerPopupEvent setSmallWindow(boolean smallWindow) {
this.smallWindow = smallWindow;
return this;
}
public boolean isQualitySelection() {
return qualitySelection;
}
public CustomDrawerPopupEvent setQualitySelection(boolean qualitySelection) {
this.qualitySelection = qualitySelection;
return this;
}
public boolean isRefresh() {
return refresh;

View File

@ -146,6 +146,20 @@ public class CustomDrawerPopupView extends DrawerPopupView {
.popupPosition(PopupPosition.Top)
.asCustom(new MoreMenuPopupView(mContext))
.show();
}
});
//播放设置
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_play_setting), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.more_menu));
builder.hasShadowBg(false)
.isDestroyOnDismiss(true)
.isLightStatusBar(false)
.popupPosition(PopupPosition.Top)
.asCustom(new PlaySettingPopupView(mContext))
.show();
}
});
@ -239,6 +253,14 @@ public class CustomDrawerPopupView extends DrawerPopupView {
dismiss();
callBack.effectsSetting();
}
if (event.isSmallWindow()) {
dismiss();
callBack.floatSetting();
}
if (event.isQualitySelection()) {
dismiss();
callBack.changeVideo();
}
}
if (event.isRefresh()) {

View File

@ -0,0 +1,55 @@
package com.yunbao.common.views;
import android.content.Context;
import androidx.annotation.NonNull;
import com.lxj.xpopup.core.AttachPopupView;
import com.yunbao.common.R;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
public class PlaySettingPopupView extends AttachPopupView {
public PlaySettingPopupView(@NonNull Context context) {
super(context);
}
@Override
protected int getImplLayoutId() {
return R.layout.view_play_setting;
}
@Override
protected void onCreate() {
//特效设置
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.effects_settings_layout), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true).setEffects(true));
}
});
//小窗播放
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.float_settings_layout), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true).setSmallWindow(true));
}
});
//畫質選擇
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.system_notice), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true).setQualitySelection(true));
}
});
}
}

View File

@ -46,7 +46,7 @@
android:id="@+id/slide_settings_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginStart="24dp"
android:gravity="center"
android:orientation="vertical">
@ -68,7 +68,7 @@
android:id="@+id/share_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginStart="24dp"
android:gravity="center"
android:orientation="vertical">
@ -92,7 +92,8 @@
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:gravity="center"
android:orientation="vertical">
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:layout_width="26dp"
@ -109,13 +110,36 @@
</LinearLayout>
<LinearLayout
android:visibility="visible"
android:id="@+id/live_play_setting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible">
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:src="@mipmap/icon_bfsz" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_play_setting"
android:textColor="#FF9A9A9A"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/system_notice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:gravity="center"
android:orientation="vertical">
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:layout_width="26dp"
@ -135,7 +159,7 @@
android:id="@+id/online"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginStart="24dp"
android:gravity="center"
android:orientation="vertical">

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="220dp"
android:layout_width="170dp"
android:layout_height="62dp"
app:cardBackgroundColor="#0F0B14"
app:cardCornerRadius="4dp"
@ -11,13 +11,15 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical">
<LinearLayout
android:id="@+id/effects_settings_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:gravity="center"
android:orientation="vertical">
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:layout_width="26dp"

View File

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="170dp"
android:layout_height="62dp"
app:cardBackgroundColor="#0F0B14"
app:cardCornerRadius="4dp"
app:cardElevation="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical">
<LinearLayout
android:id="@+id/effects_settings_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:src="@mipmap/live_more_icon_special_new" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/effects_settings"
android:textColor="#FF9A9A9A"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/float_settings_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:src="@mipmap/live_more_icon_fenestrule_new" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/small_window"
android:textColor="#FF9A9A9A"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/system_notice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:src="@mipmap/live_more_icon_hd" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/image_quality_selection"
android:textColor="#FF9A9A9A"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/report_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:src="@mipmap/live_more_icon_report" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/report"
android:textColor="#FF9A9A9A"
android:textSize="10sp" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -1113,5 +1113,6 @@
<string name="live_use_discount_no">不使用</string>
<string name="live_use_discount_yes">使用</string>
<string name="live_use_wish">心願</string>
<string name="live_play_setting">播放設置</string>
</resources>