From d320373b0726657326f75eca929fd06b4b43246f Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Sun, 2 Apr 2023 14:22:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A0=8F=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9E=E6=92=AD=E6=94=BE=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/event/CustomDrawerPopupEvent.java | 22 ++++ .../common/views/CustomDrawerPopupView.java | 24 +++- .../common/views/PlaySettingPopupView.java | 55 +++++++++ .../main/res/layout/custom_drawer_popup.xml | 36 +++++- common/src/main/res/layout/view_more_menu.xml | 6 +- .../src/main/res/layout/view_play_setting.xml | 105 ++++++++++++++++++ .../src/main/res/mipmap-xxhdpi/icon_bfsz.png | Bin 0 -> 1991 bytes common/src/main/res/values/strings.xml | 1 + .../live/activity/LiveAudienceActivity.java | 2 +- 9 files changed, 241 insertions(+), 10 deletions(-) create mode 100644 common/src/main/java/com/yunbao/common/views/PlaySettingPopupView.java create mode 100644 common/src/main/res/layout/view_play_setting.xml create mode 100644 common/src/main/res/mipmap-xxhdpi/icon_bfsz.png diff --git a/common/src/main/java/com/yunbao/common/event/CustomDrawerPopupEvent.java b/common/src/main/java/com/yunbao/common/event/CustomDrawerPopupEvent.java index 21b3826a2..c9279d3e6 100644 --- a/common/src/main/java/com/yunbao/common/event/CustomDrawerPopupEvent.java +++ b/common/src/main/java/com/yunbao/common/event/CustomDrawerPopupEvent.java @@ -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; diff --git a/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java b/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java index b028c4975..2b793f583 100644 --- a/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java +++ b/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java @@ -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(); } }); @@ -235,10 +249,18 @@ public class CustomDrawerPopupView extends DrawerPopupView { dismiss(); callBack.reportLayout(); } - if(event.isEffects()){ + if (event.isEffects()) { dismiss(); callBack.effectsSetting(); } + if (event.isSmallWindow()) { + dismiss(); + callBack.floatSetting(); + } + if (event.isQualitySelection()) { + dismiss(); + callBack.changeVideo(); + } } if (event.isRefresh()) { diff --git a/common/src/main/java/com/yunbao/common/views/PlaySettingPopupView.java b/common/src/main/java/com/yunbao/common/views/PlaySettingPopupView.java new file mode 100644 index 000000000..bf5ad1bc2 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/views/PlaySettingPopupView.java @@ -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)); + } + }); + + + } +} diff --git a/common/src/main/res/layout/custom_drawer_popup.xml b/common/src/main/res/layout/custom_drawer_popup.xml index 840cacee0..5e987738f 100644 --- a/common/src/main/res/layout/custom_drawer_popup.xml +++ b/common/src/main/res/layout/custom_drawer_popup.xml @@ -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"> + + + + + + + + android:orientation="vertical" + android:visibility="gone"> diff --git a/common/src/main/res/layout/view_more_menu.xml b/common/src/main/res/layout/view_more_menu.xml index 3e788164f..505522dce 100644 --- a/common/src/main/res/layout/view_more_menu.xml +++ b/common/src/main/res/layout/view_more_menu.xml @@ -1,7 +1,7 @@ + + android:orientation="vertical" + android:visibility="gone"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/mipmap-xxhdpi/icon_bfsz.png b/common/src/main/res/mipmap-xxhdpi/icon_bfsz.png new file mode 100644 index 0000000000000000000000000000000000000000..bc115ec6f3b65132132a6af733bc11173b530115 GIT binary patch literal 1991 zcmV;&2RQhNP)Px+fk{L`RCr$Poh`H-H4w*VG-%MEL4yX5rs$$u-Rf4izStH^s~@`6MHk)r>f!uL z_MBzO$7GUh^0LV}PrdBj-1%iDlgVT*(`rLYfQKI48XPS^gHM75XaO2r0)r24Y0v^R zxC90t-qN52XmAM(KD<*jNJKs(qA!W)tHI@w8r}yY`pC@hQXOmkzZoD0Tmj6H2S7b! zW|+ZhtqLG#&K^!^$}ED0HodSs=zFFZkTYqIi3p}`wSOg04N?)HOgJBj=qZ zwpcO)eSnCB)@PHM%K{`KUlY+2k30~9kGb3fiLmWZoa^md0^Tw+!eLo07Z7&Qk34TM zy*z8Ax1@8#iTc3IcXPi+E})Qu@S2&iHeJ5Cb;uViHCdTjfG+PK>}RHky!6dfX2x+$ zR$G9w#HH)J0O{n^t=DA$i3pq$?9k!X|4l@QR8&2&Y(a5)Kn@H%9$yv^k~E%;3~FjX zierpz(pNbUTN;!hfygE=^eITxfHoB!ie(H@)pc485)s6)Qm2$YA>q^(8a2fFG$kMr z!7(z9(5B=6=# zToTYGeMO?i9#j`6;?jU1eHW0#@rE|G1t$XDUiOJ*&f2q^MDxYsA_rZcOq@?pie!zW zHr+o1(&aVi2rDCL|CDp91<0dL8BRp=qxl6WvM?x|2vcrA&RVnpC8Xt?2<)qTE_w6Z zy#+`yog)b@3y?y7|LbD$;zI9n#}(N4`r>-c9fhSq0W!`}fN4WmDAceY^6pbC6D#2U zuYFK~tKB?3d1=s&j!RnqRe3-5l$#d|kS*ME3LF=Ty0(c+H~~lNhkz-WmAUL@=9i16{M0X|<|Jg{%F`hXdpwL5M%N;{sf}+#0~(E>c!)HbvnLEf8Nn zKx%fBJ|v*So?l^S zjb=hKtDe|S2`G{<0vQ*V3`o@EF&9qqsq?IWVi&=x9C;^h16FgprvsD_T-8(6gu_r} zB1{D+kxXAbER%@9S8*6-0~ETY2lH-nt5a@XB%cqD7Q5Zk0BYq{D*(kJ@WonG3sCoJ zSBbR;rIDK*e<$4TqO~X&P^h4vsTNvlcINzFL_+4R*sV^D!@1oE$of)^i}qZ(fDl;@ z{cyw`YqU8f0L}j+Ye6-aH#Uw)jfe99x#)0ck5P38t$}hlmIx)CG>bIvA`7vId69X| z(jW&YSkJ&3-^zvI>z{BEiWlq97!&5r9P``WX8{z;zUi$+u^;;=c6kF6Bla5>#jbre zAg4v4kUPu?1kuc6N~{Ahm)De+rg&edqI|LT;N4b0F)gaTW6v>xXGWS^Z&J;G5?X|R zcd78<#syC^T^@+HJ7maqjOO<$yt7m{`+QnA{g#5>T#?diGy{dP-mM?gdC8q@G不使用 使用 心願 + 播放設置 diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index afc7c8c8a..07f4f76fc 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -144,7 +144,7 @@ public class LiveAudienceActivity extends LiveActivity { private LiveBean mLiveBean; //当前直播间下标 private int mCurrentItem, mCurrentPage; - private static PortraitLiveManager manager; + private static PortraitLiveManager manager; private int mLastPosition = -1; private ViewGroup mViewGroup;