From 72dd63355edcaa88e21256ae2555acf6699e6d46 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Thu, 6 Oct 2022 13:06:46 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B4=E6=92=AD=E9=97=B4=E6=BB=91=E5=8A=A8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/dialog/SlideSettingsDialog.java | 83 ++++++++++++++++++ .../yunbao/common/manager/IMLoginManager.java | 19 ++++ .../src/main/res/layout/view_live_total.xml | 22 +++++ .../main/res/layout/view_slide_settings.xml | 42 +++++++++ .../mipmap-xxhdpi/live_more_icon_sliding.png | Bin 0 -> 9357 bytes common/src/main/res/values/strings.xml | 2 + .../yunbao/live/activity/LiveActivity.java | 6 +- .../live/activity/LiveAudienceActivity.java | 70 +++++++++------ .../yunbao/live/dialog/LiveTotalDialog.java | 7 +- .../yunbao/live/event/LiveAudienceEvent.java | 4 +- 10 files changed, 219 insertions(+), 36 deletions(-) create mode 100644 common/src/main/java/com/yunbao/common/dialog/SlideSettingsDialog.java create mode 100644 common/src/main/res/layout/view_slide_settings.xml create mode 100644 common/src/main/res/mipmap-xxhdpi/live_more_icon_sliding.png diff --git a/common/src/main/java/com/yunbao/common/dialog/SlideSettingsDialog.java b/common/src/main/java/com/yunbao/common/dialog/SlideSettingsDialog.java new file mode 100644 index 000000000..99538ac1b --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/SlideSettingsDialog.java @@ -0,0 +1,83 @@ +package com.yunbao.common.dialog; + +import android.os.Bundle; +import android.view.Gravity; +import android.view.Window; +import android.view.WindowManager; +import android.widget.ImageView; + +import com.yunbao.common.R; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.manager.IMLoginManager; +import com.yunbao.common.views.weight.ViewClicksAntiShake; + +/** + * 滑动设置 + */ +public class SlideSettingsDialog extends AbsDialogFragment { + private ImageView slideSwitch; + private boolean slide; + + @Override + protected int getLayoutId() { + return R.layout.view_slide_settings; + } + + @Override + protected int getDialogStyle() { + return R.style.dialog2; + } + + @Override + protected boolean canCancel() { + return true; + } + + + @Override + protected void setWindowAttributes(Window window) { + window.setWindowAnimations(R.style.bottomToTopAnim); + WindowManager.LayoutParams params = window.getAttributes(); + params.width = WindowManager.LayoutParams.MATCH_PARENT; + params.height = WindowManager.LayoutParams.WRAP_CONTENT; + params.gravity = Gravity.BOTTOM; + window.setAttributes(params); + } + + @Override + public void onActivityCreated(Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + slideSwitch = (ImageView) findViewById(R.id.slide_switch); + slide = IMLoginManager.get(getActivity()).isSlide(); + if (slide) { + ImgLoader.display(getContext(), R.mipmap.special_icon_on, slideSwitch); + } else { + ImgLoader.display(getContext(), R.mipmap.special_icon_off, slideSwitch); + } + //滑动设置 + ViewClicksAntiShake.clicksAntiShake(slideSwitch, () -> { + slide = !slide; + if (slide) { + ImgLoader.display(getContext(), R.mipmap.special_icon_on, slideSwitch); + } else { + ImgLoader.display(getContext(), R.mipmap.special_icon_off, slideSwitch); + } + //滑动设置 + IMLoginManager.get(getContext()).initSlide(slide); + if (callBack != null) { + callBack.initSlide(slide); + } + }); + } + + private SlideSettingsCallBack callBack; + + public SlideSettingsDialog setCallBack(SlideSettingsCallBack callBack) { + this.callBack = callBack; + return this; + } + + public interface SlideSettingsCallBack { + void initSlide(boolean slide); + } +} diff --git a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java index 576350fb8..ef6fc179c 100644 --- a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java +++ b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java @@ -30,6 +30,7 @@ public class IMLoginManager extends BaseCacheManager { private final static String GiftEffect = "giftEffect"; private final static String MountEffect = "mountEffect"; private final static String IS_CHAT = "isChat"; + private final static String IS_SLIDE = "isSlide"; /** * @param isChat 是否隐藏聊天列表 is_chat 1:开启 0:关闭 @@ -38,6 +39,24 @@ public class IMLoginManager extends BaseCacheManager { put(IS_CHAT, isChat); } + /** + * 设置直播间是否滚动 + * + * @param isSlide 滚动 + */ + public void initSlide(boolean isSlide) { + put(IS_SLIDE, isSlide); + } + + /** + * 获取之比肩是否滚动 + * + * @return + */ + public boolean isSlide() { + return getBoolean(IS_SLIDE, true); + } + /** * 是否隐藏聊天列表 * diff --git a/common/src/main/res/layout/view_live_total.xml b/common/src/main/res/layout/view_live_total.xml index 5e7855974..5ffcfb799 100644 --- a/common/src/main/res/layout/view_live_total.xml +++ b/common/src/main/res/layout/view_live_total.xml @@ -245,6 +245,28 @@ android:textSize="12sp" /> + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/mipmap-xxhdpi/live_more_icon_sliding.png b/common/src/main/res/mipmap-xxhdpi/live_more_icon_sliding.png new file mode 100644 index 0000000000000000000000000000000000000000..a5eaa1edd9ee70ef8df988b7e6f98ddc864ce2fd GIT binary patch literal 9357 zcma)Cg;x|^8y~u5X{DEL5LCLBl193u1nH7ckXT@8Bm_ki5RmSc?(SAXq*J7k=DY8I z@Xa}}d(Q68oqOkbesw2OOGAkWpBf*6AR^_b^4j1vEonJ@+vkp1qQmf2NZ3StU9ue&uZVeUfa%!zmW!o|%_li{Gtpid#B8 z97^ipBe!9XsTpTX${{Uq;^dT%WGei1`R{y0}_(Si89|Zg))$6IVv(xhITiK3inwr{ zL&~Co4CYm$+ATlSn8)FRDydjmwo!9tXj#pc7n{M{R#X84Z6p@zz%idsIdnwN;6vm~ zBDQE0zR9)UP{2{INDw*rf0L8{wqQdYdlX39wrG@Y@)p5E*z%L-uB!gnj7~MryS~r* zilfmA+!Nj!x@>s-Lka3wN7t9&Mxo--A0iz|5X9ZwOdQ?2>IJS4>X@$BH$$HU-wZvY zHfS0)5_y_6MFpWR{h?VBjpK}1^856RK`rnU4H<@;>4FRQ%B>ognb(7(CSZu}LWux9 zY>OAD_;-eR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md5E>?fBaw6M10(^WkMI|NM zRLQp=C;fapeLlRd?HDWK<>65ie|z>PB}X-RagB+X&@>)I@M0&sKSmdU-V9~TpR4K)V8#7)?Lct}(cs4i1jg5FGm@e{zk} zuYN#dcljH=G5JBT6l`z^G}i(S!0Xt4UV8dwAg%&$!HxIdmu zLHgFV6Q>%`Wn(T_dl45$FR5bI8gOGt$vG3zC%2+Jc2!a73nSSeK#oyuVaf{s%oylP zU?!52lfwaJO{{BRknA{^Z~Jr`o$JpyXJ8 zSJbNet3vPgqaI<%k|2x+e}|SJ$1GtIY@?U})8-7Y)_Hhns2Bue#hhjW4vVdU=GQb+-drmH*k0xKt^2!Y$KnpTc=tbLBnC_to<_v*v1+&?wa4fj)P#ChQHVR@qfJh8Q zsNVVv;k9z>p*Jn~QZ!?!UWS;!-)O9w1?v_@gpTyHK>a<-7cSo zmm{>l(H)Q{%M}l_M2@}xCVnhnLc_i3ko(~#r0>~E1XGF$Bh+*bDlxRQ5C4FMN#<@$ ztVl{qeaIDLf(zF;a@SecegI)E@{k~EbyLW9IOWk_lOVFoBoDiTDk0oedx0~n7PdIK z2K@R%(!(M(2wnPDmt`95fHtFo4*CTyJjW(X?+KK7SBj2nj|gkrfu#DJu#$;$$ZasR z1nn%v^{-F3o#*v(sTDtd3XP6jk;zXY2?M^t1Jd3l?H_8h85=HccYsmqxeDgTqbhw{(VY^2fj{_gi!T8nTNtgx5qBKYq9i-%Z58 zN?HbO#8&<*u{QGUZ&}4;{gR@bCX$&*@y;pM@c#f%@d_mX literal 0 HcmV?d00001 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 99bf1b7c7..676a36515 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -912,6 +912,8 @@ 订单查询中 订单无异常 登錄失效,請重新登錄 + 滑動設置 + 上下滑動切換直播間 diff --git a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java index e9215006a..230613930 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java @@ -152,7 +152,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); mCoinName = CommonAppConfig.getInstance().getCoinName(); mIsAnchor = this instanceof LiveAnchorActivity; - mPageContainer = (ViewGroup) findViewById(R.id.page_container); + mPageContainer = findViewById(R.id.page_container); EventBus.getDefault().register(this); mDialogFragmentSet = new HashSet<>(); //解压 美颜模型 @@ -270,7 +270,6 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL @Override public void onEnterRoom(LiveEnterRoomBean bean) { if (mLiveRoomViewHolder != null) { - LiveUserGiftBean u = bean.getUserBean(); if (!bean.getUserBean().getCar().getWords().equals("")) { bean.getLiveChatBean().setContent(bean.getUserBean().getCar().getWords()); } @@ -285,9 +284,6 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL */ @Override public void onLeaveRoom(UserBean bean) { - if (mLiveRoomViewHolder != null) { -// mLiveRoomViewHolder.removeUser(bean.getId()); - } if (mLiveLinkMicPresenter != null) { mLiveLinkMicPresenter.onAudienceLeaveRoom(bean); } 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 1cb2b35f2..d09ee190c 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -1,5 +1,7 @@ package com.yunbao.live.activity; +import static com.yunbao.live.views.LivePlayRyViewHolder.Micing; + import android.annotation.SuppressLint; import android.content.Context; import android.content.Intent; @@ -35,6 +37,7 @@ import com.yunbao.common.bean.SlideInfoModel; import com.yunbao.common.bean.UserBean; import com.yunbao.common.dialog.EffectsSettingsDialog; import com.yunbao.common.dialog.LiveChargeDialogFragment; +import com.yunbao.common.dialog.SlideSettingsDialog; import com.yunbao.common.event.FollowEvent; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.CommonHttpConsts; @@ -80,8 +83,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import static com.yunbao.live.views.LivePlayRyViewHolder.Micing; - /** * Created by cxf on 2018/10/10. * 看直播 @@ -160,6 +161,9 @@ public class LiveAudienceActivity extends LiveActivity { private void initView() { // 竖直滑动 ViewPager verticalViewPager = findViewById(R.id.view_pager); + + verticalViewPager.setEnableScroll(IMLoginManager.get(mContext).isSlide()); + } public void setBackIndex(int backIndex) { @@ -197,7 +201,9 @@ public class LiveAudienceActivity extends LiveActivity { manager.micIngTypeTwo(mLiveBean, mLiveType, mLiveTypeVal); } else { - verticalViewPager.setEnableScroll(true); + if (IMLoginManager.get(mContext).isSlide()){ + verticalViewPager.setEnableScroll(true); + } mCurrentItem = position; Log.e(TAG, "mCurrentItem:" + mCurrentItem); if (mCurrentItem == itemModelList.size() - 1) { @@ -331,19 +337,17 @@ public class LiveAudienceActivity extends LiveActivity { * 打开礼物窗口 */ public void openGiftWindow() { - new Handler(Looper.getMainLooper()).post(new Runnable() { - public void run() { - if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream)) { - return; - } - LiveGiftDialogFragment fragment = new LiveGiftDialogFragment(); - fragment.setLiveGuardInfo(mLiveGuardInfo); - Bundle bundle = new Bundle(); - bundle.putString(Constants.LIVE_UID, mLiveUid); - bundle.putString(Constants.LIVE_STREAM, mStream); - fragment.setArguments(bundle); - fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment"); + new Handler(Looper.getMainLooper()).post(() -> { + if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream)) { + return; } + LiveGiftDialogFragment fragment = new LiveGiftDialogFragment(); + fragment.setLiveGuardInfo(mLiveGuardInfo); + Bundle bundle = new Bundle(); + bundle.putString(Constants.LIVE_UID, mLiveUid); + bundle.putString(Constants.LIVE_STREAM, mStream); + fragment.setArguments(bundle); + fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment"); }); } @@ -365,20 +369,18 @@ public class LiveAudienceActivity extends LiveActivity { if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream)) { return; } - new Handler(Looper.getMainLooper()).post(new Runnable() { - public void run() { - LiveGiftDialogFragment fragment = new LiveGiftDialogFragment(); - fragment.setLiveGuardInfo(mLiveGuardInfo); - Bundle bundle = new Bundle(); - bundle.putString(Constants.LIVE_UID, mLiveUid); - bundle.putString(Constants.LIVE_STREAM, mStream); - bundle.putString(Constants.LIVE_WISH_GIFTID, giftId); - if (for_by.equals("1")) { - bundle.putString("by", "1"); - } - fragment.setArguments(bundle); - fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment"); + new Handler(Looper.getMainLooper()).post(() -> { + LiveGiftDialogFragment fragment = new LiveGiftDialogFragment(); + fragment.setLiveGuardInfo(mLiveGuardInfo); + Bundle bundle = new Bundle(); + bundle.putString(Constants.LIVE_UID, mLiveUid); + bundle.putString(Constants.LIVE_STREAM, mStream); + bundle.putString(Constants.LIVE_WISH_GIFTID, giftId); + if (for_by.equals("1")) { + bundle.putString("by", "1"); } + fragment.setArguments(bundle); + fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment"); }); } @@ -485,6 +487,7 @@ public class LiveAudienceActivity extends LiveActivity { super.onPause(); manager.onPause(); } + /** * 点亮 */ @@ -815,6 +818,16 @@ public class LiveAudienceActivity extends LiveActivity { manager.onChat(chatBean, 1); break; + case SLIDE_SETTINGS: + SlideSettingsDialog slideSettingsDialog = new SlideSettingsDialog(); + slideSettingsDialog.show(getSupportFragmentManager(), "SlideSettingsDialog"); + slideSettingsDialog.setCallBack(new SlideSettingsDialog.SlideSettingsCallBack() { + @Override + public void initSlide(boolean slide) { + verticalViewPager.setEnableScroll(slide); + } + }); + break; } @@ -890,7 +903,6 @@ public class LiveAudienceActivity extends LiveActivity { } - /** * 获取侧边栏数据 */ diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveTotalDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveTotalDialog.java index b680d8eea..2dd565291 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveTotalDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveTotalDialog.java @@ -9,13 +9,13 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.yunbao.common.R; -import com.yunbao.live.adapter.FunGamesAdapter; import com.yunbao.common.bean.ActiveModel; import com.yunbao.common.dialog.AbsDialogFragment; import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.views.weight.ViewClicksAntiShake; +import com.yunbao.live.adapter.FunGamesAdapter; import com.yunbao.live.bean.LiveBean; import com.yunbao.live.event.LiveAudienceEvent; @@ -144,6 +144,11 @@ public class LiveTotalDialog extends AbsDialogFragment { .setType(LiveAudienceEvent.LiveAudienceType.ONLINE)); dismiss(); }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.slide_settings_layout), () -> { + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.SLIDE_SETTINGS)); + dismiss(); + }); } @Override diff --git a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java index 58b195025..eee6cca27 100644 --- a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java +++ b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java @@ -130,7 +130,9 @@ public class LiveAudienceEvent extends BaseModel { NOTICE(18, "系统通知"), ONLINE(19, "在线客服"), TRUMPET_NOTIFY(20, "全服喇叭"), - RECOMMEND_CARD_NOTIFY(21, "贵族推荐通知"); + RECOMMEND_CARD_NOTIFY(21, "贵族推荐通知"), + SLIDE_SETTINGS(22, "滑動設置") + ; private int type; private String name;