From b377d01ca33eec0576db1cee03a262d49fbbb8cd Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 24 Aug 2022 11:10:27 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E7=A4=BC?= =?UTF-8?q?=E7=89=A9=EF=BC=8C=E5=9D=90=E9=AA=91=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/dialog/EffectsSettingsDialog.java | 6 ++-- .../yunbao/common/manager/IMLoginManager.java | 20 +++++++++++++ .../live/activity/LiveAudienceActivity.java | 1 + .../live/dialog/SidebarLiveAudience.java | 14 ++++----- .../live/presenter/LiveGiftAnimPresenter.java | 8 ++--- .../presenter/LiveRoomCheckLivePresenter.java | 6 ++-- .../live/views/LiveAudienceViewHolder.java | 3 ++ .../res/layout/view_sidebar_live_audience.xml | 4 +-- .../layout/view_sidebar_live_audience_top.xml | 29 ++++++++++++------- .../yunbao/main/activity/SearchActivity.java | 2 +- 10 files changed, 59 insertions(+), 34 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/dialog/EffectsSettingsDialog.java b/common/src/main/java/com/yunbao/common/dialog/EffectsSettingsDialog.java index f2de3925d..d8436eee9 100644 --- a/common/src/main/java/com/yunbao/common/dialog/EffectsSettingsDialog.java +++ b/common/src/main/java/com/yunbao/common/dialog/EffectsSettingsDialog.java @@ -61,7 +61,8 @@ public class EffectsSettingsDialog extends AbsDialogFragment { ImgLoader.display(getContext(), R.mipmap.special_icon_on, specialSwitch); } //更新特效开关 - IMLoginManager.get(getContext()).upDataUserInfo(userInfo.setGiftEffect(giftEffect)); + IMLoginManager.get(getContext()).setGiftEffect(giftEffect); + IMLoginManager.get(getContext()).upDataUserInfo(userInfo.setGiftEffect(giftEffect)); } ); //坐骑特效开关 @@ -73,7 +74,8 @@ public class EffectsSettingsDialog extends AbsDialogFragment { ImgLoader.display(getContext(), R.mipmap.special_icon_on, specialMountSwitch); } //更新特效开关 - IMLoginManager.get(getContext()).upDataUserInfo(userInfo.setMountEffect(mountEffect)); + IMLoginManager.get(getContext()).setMountEffect(mountEffect); + IMLoginManager.get(getContext()).upDataUserInfo(userInfo.setMountEffect(mountEffect)); } ); } 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 019a2ba8d..04afb4d85 100644 --- a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java +++ b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java @@ -27,6 +27,8 @@ public class IMLoginManager extends BaseCacheManager { private IMLoginModel userInfo; private final static String isNewUserGif = "isNewUserGif"; private final static String isNewUserOne = "isNewUserOne"; + private final static String GiftEffect = "giftEffect"; + private final static String MountEffect = "mountEffect"; //暂时缓存token private String token = ""; @@ -85,6 +87,8 @@ public class IMLoginManager extends BaseCacheManager { if (userInfo != null) token = userInfo.getToken(); } + userInfo.setGiftEffect(getBoolean(GiftEffect, false)); + userInfo.setMountEffect(getBoolean(MountEffect, false)); return userInfo; } @@ -108,6 +112,8 @@ public class IMLoginManager extends BaseCacheManager { if (userInfo != null && !TextUtils.isEmpty(userInfo.getToken())) { token = userInfo.getToken(); } + userInfo.setGiftEffect(getBoolean(GiftEffect, false)); + userInfo.setMountEffect(getBoolean(MountEffect, false)); if (netHandler == null) { netHandler = new Handler(); } @@ -124,6 +130,8 @@ public class IMLoginManager extends BaseCacheManager { if (!TextUtils.isEmpty(token)) { userInfo.setToken(token); } + userInfo.setGiftEffect(getBoolean(GiftEffect, false)); + userInfo.setMountEffect(getBoolean(MountEffect, false)); put(KEY_USER_INFO, new Gson().toJson(userInfo)); //兼容老模块(之后要把用户维护的类更换掉) SpUtil.getInstance().setStringValue(SpUtil.USER_INFO, new Gson().toJson(userInfo)); @@ -139,11 +147,23 @@ public class IMLoginManager extends BaseCacheManager { if (!TextUtils.isEmpty(token)) { userInfo.setToken(token); } + userInfo.setGiftEffect(getBoolean(GiftEffect, false)); + userInfo.setMountEffect(getBoolean(MountEffect, false)); + deleteByKey(KEY_USER_INFO); put(KEY_USER_INFO, new Gson().toJson(userInfo)); //兼容老模块(之后要把用户维护的类更换掉) SpUtil.getInstance().setStringValue(SpUtil.USER_INFO, new Gson().toJson(userInfo)); } + public void setGiftEffect(boolean giftEffect) { + put(GiftEffect, giftEffect); + } + + public void setMountEffect(boolean mountEffect) { + + put(MountEffect, mountEffect); + } + /** * 重新请求管理员身份信息 */ 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 05da0f2ab..16d2c1061 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -294,6 +294,7 @@ public class LiveAudienceActivity extends LiveActivity { public void onSuccess(int code, String msg, String[] info) { if (code == 0 && info.length > 0) { LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class); + LiveRoomCheckLivePresenter.isRoom = true; LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, (liveBean1, liveType, liveTypeVal, liveSdk) -> { //主播正在直播 if (liveBean1 == null) { diff --git a/live/src/main/java/com/yunbao/live/dialog/SidebarLiveAudience.java b/live/src/main/java/com/yunbao/live/dialog/SidebarLiveAudience.java index 6385c8aca..6bebc9b88 100644 --- a/live/src/main/java/com/yunbao/live/dialog/SidebarLiveAudience.java +++ b/live/src/main/java/com/yunbao/live/dialog/SidebarLiveAudience.java @@ -1,6 +1,5 @@ package com.yunbao.live.dialog; -import android.os.Build; import android.os.Bundle; import android.view.Display; import android.view.Gravity; @@ -136,12 +135,12 @@ public class SidebarLiveAudience extends AbsDialogFragment { @Override protected void setWindowAttributes(Window window) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); - window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); - window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); - window.setStatusBarColor(0); - } + + window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); + window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); + window.setStatusBarColor(0); + window.setWindowAnimations(com.yunbao.common.R.style.RightLeftToAnim); WindowManager.LayoutParams params = window.getAttributes(); params.width = DeviceUtils.getScreenWidth(getActivity()) / 3 * 2; @@ -151,7 +150,6 @@ public class SidebarLiveAudience extends AbsDialogFragment { } - /** * 前往直播间 */ diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java index 07d8bde0b..dac8c0ccf 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java @@ -859,12 +859,6 @@ public class LiveGiftAnimPresenter { AllMsgTextRender.render(mContext, mGifGiftTipAllServer, mTempGifGiftBean.getGiftIcon(), mTempGifGiftBean.getUserNiceName(), mAncherName, mTempGifGiftBean.getGiftName(), 1, mWindowManager, ""); - //下载横幅前面的动画 -// ConfigBean configBean = CommonAppConfig.getInstance().getConfig(); -// String testUrl = configBean.getAllServerGiftIcon(); -// if (!testUrl.isEmpty() && testUrl != null) -// GifCacheUtil.getFile(Constants.GIF_GIFT_PREFIX + GIFTFRONT_ID, testUrl, "1", mDownloadIconCallback); - } } @@ -1224,6 +1218,7 @@ public class LiveGiftAnimPresenter { */ private void playSVGA(SVGAVideoEntity svgaVideoEntity) { if (mSVGAImageView != null) { + mSVGAImageView.setVisibility(View.VISIBLE); SVGARect rect = svgaVideoEntity.getVideoSize(); resizeSvgaImageView(rect.getWidth(), rect.getHeight()); mSvgaPlayTime = System.currentTimeMillis(); @@ -1239,6 +1234,7 @@ public class LiveGiftAnimPresenter { public void onFinished() { mSVGAImageView.clear(); mSVGAImageView.setVisibility(View.GONE); + mShowGif = false; } @Override diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveRoomCheckLivePresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveRoomCheckLivePresenter.java index 5c816a916..14be245be 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveRoomCheckLivePresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveRoomCheckLivePresenter.java @@ -32,7 +32,7 @@ public class LiveRoomCheckLivePresenter { private ActionListener mActionListener; private int mLiveSdk; //搜索页面不提示密码 - public static boolean isSearch = false; + public static boolean isRoom = false; public LiveRoomCheckLivePresenter(Context context, ActionListener actionListener) { mContext = context; @@ -102,7 +102,7 @@ public class LiveRoomCheckLivePresenter { * 前往密码房间 */ private void forwardPwdRoom() { - if (!isSearch) { + if (!isRoom) { DialogUitl.showSimpleInputDialog(mContext, WordUtil.getString(R.string.live_input_password), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { @@ -121,7 +121,7 @@ public class LiveRoomCheckLivePresenter { }); }else { enterLiveRoom(); - isSearch = false; + isRoom = false; } } diff --git a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java index 4ea8cb93e..0c81c8b10 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -126,6 +126,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { private void svga_new_user_gif() { + svga_new_user_gif.setVisibility(View.VISIBLE); new SVGAParser(mContext).decodeFromAssets("free_gift_tip.svga", new SVGAParser.ParseCompletion() { @Override public void onComplete(SVGAVideoEntity videoItem) { @@ -142,6 +143,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { } private void svga_new_user_double() { + svga_new_user_double.setVisibility(View.VISIBLE); new SVGAParser(mContext).decodeFromAssets("double_click_tip.svga", new SVGAParser.ParseCompletion() { @Override public void onComplete(SVGAVideoEntity videoItem) { @@ -159,6 +161,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { } private void svga_new_user_follow() { + svga_new_user_follow.setVisibility(View.VISIBLE); new SVGAParser(mContext).decodeFromAssets("live_follow_tip.svga", new SVGAParser.ParseCompletion() { @Override public void onComplete(SVGAVideoEntity videoItem) { diff --git a/live/src/main/res/layout/view_sidebar_live_audience.xml b/live/src/main/res/layout/view_sidebar_live_audience.xml index ca028ef11..bf238c7d0 100644 --- a/live/src/main/res/layout/view_sidebar_live_audience.xml +++ b/live/src/main/res/layout/view_sidebar_live_audience.xml @@ -26,9 +26,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - android:paddingStart="8dp" - android:paddingTop="10dp" - android:paddingEnd="8dp"> + android:paddingTop="56dp"> - + + + + + 0) { LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class); - LiveRoomCheckLivePresenter.isSearch = true; + LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, (liveBean1, liveType, liveTypeVal, liveSdk) -> { if (liveBean1 == null) { return; From 97d7f23daf18c19af682299ac74890260f35b07a Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 24 Aug 2022 11:33:58 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E7=BD=91=E7=BB=9C=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E6=8F=90=E7=A4=BA=E5=8E=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/live/activity/LiveAudienceActivity.java | 2 -- .../java/com/yunbao/live/dialog/LiveInputDialogFragment.java | 2 -- live/src/main/java/com/yunbao/live/dialog/LiveTotalDialog.java | 1 - live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java | 1 - .../main/java/com/yunbao/main/adapter/SearchResultsAdapter.java | 1 - .../java/com/yunbao/main/fragment/SearchRecommendFragment.java | 1 - .../com/yunbao/main/views/SearchRecommendBodyViewHolder.java | 1 - 7 files changed, 9 deletions(-) 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 16d2c1061..42bac001d 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -214,7 +214,6 @@ public class LiveAudienceActivity extends LiveActivity { @Override public void onError(String error) { - ToastUtil.show(error); } }); @@ -236,7 +235,6 @@ public class LiveAudienceActivity extends LiveActivity { @Override public void onError(String error) { - ToastUtil.show(error); } }); } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java index 6861b079c..53207a66d 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java @@ -199,7 +199,6 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O @Override public void onError(String error) { - ToastUtil.show(error); } }); break; @@ -327,7 +326,6 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O @Override public void onError(String error) { - ToastUtil.show(error); } }); } 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 38efe3e37..5d0e6170b 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveTotalDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveTotalDialog.java @@ -64,7 +64,6 @@ public class LiveTotalDialog extends AbsDialogFragment { @Override public void onError(String error) { - ToastUtil.show(error); } }); //粉丝团 diff --git a/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java index 3a71e5530..48d23e9ea 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java @@ -240,7 +240,6 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList @Override public void onError(String error) { - ToastUtil.show(error); } }); }); diff --git a/main/src/main/java/com/yunbao/main/adapter/SearchResultsAdapter.java b/main/src/main/java/com/yunbao/main/adapter/SearchResultsAdapter.java index e89a8ef19..93df73152 100644 --- a/main/src/main/java/com/yunbao/main/adapter/SearchResultsAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/SearchResultsAdapter.java @@ -61,7 +61,6 @@ public class SearchResultsAdapter extends RecyclerView.Adapter { @Override public void onError(String error) { - ToastUtil.show(error); } }); } diff --git a/main/src/main/java/com/yunbao/main/fragment/SearchRecommendFragment.java b/main/src/main/java/com/yunbao/main/fragment/SearchRecommendFragment.java index b67d2f076..f0b0e53da 100644 --- a/main/src/main/java/com/yunbao/main/fragment/SearchRecommendFragment.java +++ b/main/src/main/java/com/yunbao/main/fragment/SearchRecommendFragment.java @@ -85,7 +85,6 @@ public class SearchRecommendFragment extends BaseFragment { @Override public void onError(String error) { - ToastUtil.show(error); } }); } diff --git a/main/src/main/java/com/yunbao/main/views/SearchRecommendBodyViewHolder.java b/main/src/main/java/com/yunbao/main/views/SearchRecommendBodyViewHolder.java index e1a5b0953..1cc45937b 100644 --- a/main/src/main/java/com/yunbao/main/views/SearchRecommendBodyViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/SearchRecommendBodyViewHolder.java @@ -53,7 +53,6 @@ public class SearchRecommendBodyViewHolder extends RecyclerView.ViewHolder { @Override public void onError(String error) { - ToastUtil.show(error); } }); } From 83aa1caf2b1d8d5e84927af935a76c070983a829 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 24 Aug 2022 11:40:11 +0800 Subject: [PATCH 3/9] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=96=B0=E4=BA=BA=E7=89=B9=E6=83=A0=E6=9C=AA=E6=8D=95=E8=8E=B7?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/live/views/LiveAudienceViewHolder.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java index 0c81c8b10..91059625f 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -61,6 +61,7 @@ import org.greenrobot.eventbus.ThreadMode; import java.util.Locale; import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.functions.Consumer; import io.reactivex.schedulers.Schedulers; /** @@ -374,11 +375,11 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { .observeOn(AndroidSchedulers.mainThread()) .subscribe(stringResponseModel -> { NewPeopleInfo peopleInfo = stringResponseModel.getData().getInfo(); - if(peopleInfo.getIsShow()){ + if (peopleInfo.getIsShow()) { liveNewPeople.setVisibility(View.VISIBLE); - newPeopleUrl=peopleInfo.getLink(); + newPeopleUrl = peopleInfo.getLink(); } - }).isDisposed(); + }, throwable -> throwable.printStackTrace()).isDisposed(); } @Override From 0b78fad8bb26d67878ef4d358bf56bfdab86ec64 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 24 Aug 2022 11:41:44 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E7=BD=91=E7=BB=9C=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E6=8F=90=E7=A4=BA=E5=8E=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/yunbao/common/manager/IMLoginManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 04afb4d85..2f9abb3a2 100644 --- a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java +++ b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java @@ -86,9 +86,10 @@ public class IMLoginManager extends BaseCacheManager { getString(KEY_USER_INFO), IMLoginModel.class); if (userInfo != null) token = userInfo.getToken(); + userInfo.setGiftEffect(getBoolean(GiftEffect, false)); + userInfo.setMountEffect(getBoolean(MountEffect, false)); } - userInfo.setGiftEffect(getBoolean(GiftEffect, false)); - userInfo.setMountEffect(getBoolean(MountEffect, false)); + return userInfo; } From 14581ffebce16d8c631e380bfb0093ef3bea562e Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 24 Aug 2022 11:45:55 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E7=BD=91=E7=BB=9C=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E6=8F=90=E7=A4=BA=E5=8E=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/common/manager/IMLoginManager.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 2f9abb3a2..b4d4c4add 100644 --- a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java +++ b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java @@ -84,10 +84,12 @@ public class IMLoginManager extends BaseCacheManager { if (null == userInfo) { userInfo = new Gson().fromJson( getString(KEY_USER_INFO), IMLoginModel.class); - if (userInfo != null) + if (userInfo != null){ token = userInfo.getToken(); - userInfo.setGiftEffect(getBoolean(GiftEffect, false)); - userInfo.setMountEffect(getBoolean(MountEffect, false)); + userInfo.setGiftEffect(getBoolean(GiftEffect, false)); + userInfo.setMountEffect(getBoolean(MountEffect, false)); + } + } return userInfo; @@ -150,7 +152,6 @@ public class IMLoginManager extends BaseCacheManager { } userInfo.setGiftEffect(getBoolean(GiftEffect, false)); userInfo.setMountEffect(getBoolean(MountEffect, false)); - deleteByKey(KEY_USER_INFO); put(KEY_USER_INFO, new Gson().toJson(userInfo)); //兼容老模块(之后要把用户维护的类更换掉) SpUtil.getInstance().setStringValue(SpUtil.USER_INFO, new Gson().toJson(userInfo)); From c1ee03ccbd9a8e47aadd42d5d19b3b4ef80e6faf Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 24 Aug 2022 13:25:44 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=89=B9=E6=95=88=E7=9A=84=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/dialog/EffectsSettingsDialog.java | 13 +++++-------- .../yunbao/common/manager/IMLoginManager.java | 18 +++++++++--------- .../presenter/LiveEnterRoomAnimPresenter.java | 2 +- .../live/presenter/LiveGiftAnimPresenter.java | 2 +- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/dialog/EffectsSettingsDialog.java b/common/src/main/java/com/yunbao/common/dialog/EffectsSettingsDialog.java index d8436eee9..64db85b8b 100644 --- a/common/src/main/java/com/yunbao/common/dialog/EffectsSettingsDialog.java +++ b/common/src/main/java/com/yunbao/common/dialog/EffectsSettingsDialog.java @@ -7,7 +7,6 @@ import android.view.WindowManager; import android.widget.ImageView; import com.yunbao.common.R; -import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.views.weight.ViewClicksAntiShake; @@ -37,11 +36,10 @@ public class EffectsSettingsDialog extends AbsDialogFragment { @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - IMLoginModel userInfo = IMLoginManager.get(getContext()).getUserInfo(); specialSwitch = (ImageView) findViewById(R.id.special_switch); specialMountSwitch = (ImageView) findViewById(R.id.special_mount_switch); - giftEffect = userInfo.isGiftEffect(); - mountEffect = userInfo.isMountEffect(); + giftEffect = IMLoginManager.get(getActivity()).isGiftEffect(); + mountEffect = IMLoginManager.get(getActivity()).isMountEffect(); if (giftEffect) { ImgLoader.display(getContext(), R.mipmap.special_icon_off, specialSwitch); } else { @@ -61,8 +59,8 @@ public class EffectsSettingsDialog extends AbsDialogFragment { ImgLoader.display(getContext(), R.mipmap.special_icon_on, specialSwitch); } //更新特效开关 - IMLoginManager.get(getContext()).setGiftEffect(giftEffect); - IMLoginManager.get(getContext()).upDataUserInfo(userInfo.setGiftEffect(giftEffect)); + IMLoginManager.get(getContext()).setGiftEffect(giftEffect); + } ); //坐骑特效开关 @@ -74,8 +72,7 @@ public class EffectsSettingsDialog extends AbsDialogFragment { ImgLoader.display(getContext(), R.mipmap.special_icon_on, specialMountSwitch); } //更新特效开关 - IMLoginManager.get(getContext()).setMountEffect(mountEffect); - IMLoginManager.get(getContext()).upDataUserInfo(userInfo.setMountEffect(mountEffect)); + IMLoginManager.get(getContext()).setMountEffect(mountEffect); } ); } 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 b4d4c4add..84b5d37dc 100644 --- a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java +++ b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java @@ -84,10 +84,8 @@ public class IMLoginManager extends BaseCacheManager { if (null == userInfo) { userInfo = new Gson().fromJson( getString(KEY_USER_INFO), IMLoginModel.class); - if (userInfo != null){ + if (userInfo != null) { token = userInfo.getToken(); - userInfo.setGiftEffect(getBoolean(GiftEffect, false)); - userInfo.setMountEffect(getBoolean(MountEffect, false)); } } @@ -115,8 +113,6 @@ public class IMLoginManager extends BaseCacheManager { if (userInfo != null && !TextUtils.isEmpty(userInfo.getToken())) { token = userInfo.getToken(); } - userInfo.setGiftEffect(getBoolean(GiftEffect, false)); - userInfo.setMountEffect(getBoolean(MountEffect, false)); if (netHandler == null) { netHandler = new Handler(); } @@ -133,8 +129,6 @@ public class IMLoginManager extends BaseCacheManager { if (!TextUtils.isEmpty(token)) { userInfo.setToken(token); } - userInfo.setGiftEffect(getBoolean(GiftEffect, false)); - userInfo.setMountEffect(getBoolean(MountEffect, false)); put(KEY_USER_INFO, new Gson().toJson(userInfo)); //兼容老模块(之后要把用户维护的类更换掉) SpUtil.getInstance().setStringValue(SpUtil.USER_INFO, new Gson().toJson(userInfo)); @@ -150,8 +144,6 @@ public class IMLoginManager extends BaseCacheManager { if (!TextUtils.isEmpty(token)) { userInfo.setToken(token); } - userInfo.setGiftEffect(getBoolean(GiftEffect, false)); - userInfo.setMountEffect(getBoolean(MountEffect, false)); put(KEY_USER_INFO, new Gson().toJson(userInfo)); //兼容老模块(之后要把用户维护的类更换掉) SpUtil.getInstance().setStringValue(SpUtil.USER_INFO, new Gson().toJson(userInfo)); @@ -166,6 +158,14 @@ public class IMLoginManager extends BaseCacheManager { put(MountEffect, mountEffect); } + public boolean isMountEffect() { + return getBoolean(MountEffect, false); + } + + public boolean isGiftEffect() { + return getBoolean(GiftEffect, false); + } + /** * 重新请求管理员身份信息 */ diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveEnterRoomAnimPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveEnterRoomAnimPresenter.java index 46b6a4096..4442d32ba 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveEnterRoomAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveEnterRoomAnimPresenter.java @@ -414,7 +414,7 @@ public class LiveEnterRoomAnimPresenter { colocNow = "#" + car.getCar_colour(); playText = car.getUser_nicename() + mContext.getResources().getString(R.string.enter_room); } - if (IMLoginManager.get(mContext).getUserInfo().isMountEffect()){ + if (IMLoginManager.get(mContext).isMountEffect()){ GifCacheUtil.getFile(Constants.GIF_CAR_PREFIX + id, url1, "0", mDownloadGifCallback); } diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java index dac8c0ccf..9e2dcb816 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java @@ -796,7 +796,7 @@ public class LiveGiftAnimPresenter { } } else { if ((bean.getGifUrl().contains("svga") || bean.getGifUrl().contains("gif")) && - IMLoginManager.get(mContext).getUserInfo().isGiftEffect()) { + IMLoginManager.get(mContext).isGiftEffect()) { //同一直播间,玩家自己送礼物,也能看到全服通知 //同一直播间,其他玩家也能看到全服通知 From 112125bd69a65a7bf9242b07ef5fb185fb806fa6 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 24 Aug 2022 14:27:32 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=9D=90=E9=AA=91=E7=89=B9=E6=95=88=E7=9A=84=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presenter/LiveEnterRoomAnimPresenter.java | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveEnterRoomAnimPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveEnterRoomAnimPresenter.java index 4442d32ba..71090e1d6 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveEnterRoomAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveEnterRoomAnimPresenter.java @@ -24,6 +24,7 @@ import android.widget.MediaController; import android.widget.RelativeLayout; import android.widget.TextView; +import com.opensource.svgaplayer.SVGACallback; import com.opensource.svgaplayer.SVGAImageView; import com.opensource.svgaplayer.SVGAParser; import com.opensource.svgaplayer.SVGAVideoEntity; @@ -313,10 +314,35 @@ public class LiveEnterRoomAnimPresenter { } } else { if (mSVGImageView != null) { + mSVGImageView.setVisibility(View.VISIBLE); SVGARect rect = svgaVideoEntity.getVideoSize(); mSVGImageView.setVideoItem(svgaVideoEntity); mSVGImageView.setLoops(1); mSVGImageView.startAnimation(); + mSVGImageView.setCallback(new SVGACallback() { + @Override + public void onPause() { + + } + + @Override + public void onFinished() { + mSVGImageView.clear(); + mSVGImageView.setVisibility(View.GONE); + mIsAnimating = false; + + } + + @Override + public void onRepeat() { + + } + + @Override + public void onStep(int i, double v) { + + } + }); } } mIsAnimating = false; @@ -414,8 +440,10 @@ public class LiveEnterRoomAnimPresenter { colocNow = "#" + car.getCar_colour(); playText = car.getUser_nicename() + mContext.getResources().getString(R.string.enter_room); } - if (IMLoginManager.get(mContext).isMountEffect()){ + if (IMLoginManager.get(mContext).isMountEffect()) { GifCacheUtil.getFile(Constants.GIF_CAR_PREFIX + id, url1, "0", mDownloadGifCallback); + } else { + mIsAnimating = false; } } From 5f2fdd70520168f4b7e062c9917cda7d80292cce Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 24 Aug 2022 15:03:26 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=20=E4=BE=A7?= =?UTF-8?q?=E8=BE=B9=E6=A0=8F=E4=BC=98=E5=85=88=E5=8A=A0=E8=BD=BD=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=BE=A7=E8=BE=B9=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../live/activity/LiveAudienceActivity.java | 38 +++++++++++++++++++ .../live/dialog/SidebarLiveAudience.java | 15 +++++++- .../res/layout/view_sidebar_live_audience.xml | 2 +- .../layout/view_sidebar_live_audience_top.xml | 1 + 4 files changed, 54 insertions(+), 2 deletions(-) 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 42bac001d..1cfce84e9 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -26,6 +26,7 @@ import com.yunbao.common.HtmlConfig; import com.yunbao.common.bean.AnchorRecommendItemModel; import com.yunbao.common.bean.AnchorRecommendModel; import com.yunbao.common.bean.IMLoginModel; +import com.yunbao.common.bean.SlideInfoModel; import com.yunbao.common.bean.UserBean; import com.yunbao.common.dialog.EffectsSettingsDialog; import com.yunbao.common.dialog.LiveChargeDialogFragment; @@ -272,6 +273,7 @@ public class LiveAudienceActivity extends LiveActivity { }); + getDrawer(); } private void loadData(ViewGroup viewGroup, int currentItem) { @@ -699,6 +701,8 @@ public class LiveAudienceActivity extends LiveActivity { //从右边打开侧边栏 SidebarLiveAudience sidebarLiveAudience = new SidebarLiveAudience(); bundle.putString("Avatar", mLiveBean.getAvatar()); + bundle.putString("banner", GsonUtils.toJson(slideInfoModels)); + bundle.putString("list", GsonUtils.toJson(list)); sidebarLiveAudience.setArguments(bundle); sidebarLiveAudience.show(getSupportFragmentManager(), "SidebarLiveAudience"); // manager.openDrawer(); @@ -856,5 +860,39 @@ public class LiveAudienceActivity extends LiveActivity { context.startActivity(intent); } + /** + * 获取侧边栏数据 + */ + private List slideInfoModels = new ArrayList<>(); + private List list = new ArrayList<>(); + + private void getDrawer() { + //侧边栏轮播 + MainNetManager.get(mContext) + .getHot(1, new com.yunbao.common.http.base.HttpCallback>() { + @Override + public void onSuccess(List data) { + slideInfoModels = data; + } + + @Override + public void onError(String error) { + + } + }); + //推荐位 + MainNetManager.get(mContext) + .anchorRecommend("10", new com.yunbao.common.http.base.HttpCallback() { + @Override + public void onSuccess(AnchorRecommendModel anchorRecommendModel) { + list = anchorRecommendModel.getList(); + + } + + @Override + public void onError(String error) { + } + }); + } } diff --git a/live/src/main/java/com/yunbao/live/dialog/SidebarLiveAudience.java b/live/src/main/java/com/yunbao/live/dialog/SidebarLiveAudience.java index 6bebc9b88..3cddb178c 100644 --- a/live/src/main/java/com/yunbao/live/dialog/SidebarLiveAudience.java +++ b/live/src/main/java/com/yunbao/live/dialog/SidebarLiveAudience.java @@ -11,6 +11,8 @@ import android.widget.ImageView; import androidx.recyclerview.widget.GridLayoutManager; import com.alibaba.fastjson.JSON; +import com.blankj.utilcode.util.GsonUtils; +import com.google.gson.reflect.TypeToken; import com.yunbao.common.bean.AnchorRecommendItemModel; import com.yunbao.common.bean.AnchorRecommendModel; import com.yunbao.common.bean.SlideInfoModel; @@ -29,6 +31,7 @@ import com.yunbao.live.bean.LiveBean; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; +import java.util.ArrayList; import java.util.List; /** @@ -42,6 +45,8 @@ public class SidebarLiveAudience extends AbsDialogFragment { //侧边栏适配器 private SidebarAdapter sidebarAdapter; + private List slideInfoModels = new ArrayList<>(); + private List list = new ArrayList<>(); @Override protected int getLayoutId() { @@ -60,8 +65,13 @@ public class SidebarLiveAudience extends AbsDialogFragment { sidebarBack = (ImageView) findViewById(R.id.sidebar_back); if (bundle != null) { String avatar = bundle.getString("Avatar"); + slideInfoModels = GsonUtils.fromJson(bundle.getString("banner"), new TypeToken>() { + }.getType()); + list = GsonUtils.fromJson(bundle.getString("list"), new TypeToken>() { + }.getType()); //侧边栏背景 ImgLoader.displayBlurLive(mContext, avatar, sidebarBack); + } sidebarList = (CommonRefreshView) findViewById(R.id.sidebarList); GridLayoutManager gridLayoutManager = new GridLayoutManager(mContext, 2, GridLayoutManager.VERTICAL, false); @@ -84,6 +94,10 @@ public class SidebarLiveAudience extends AbsDialogFragment { sidebarAdapter = new SidebarAdapter(mContext, mDisplay.getHeight()); sidebarAdapter.setHasStableIds(true); sidebarList.setRecyclerViewAdapter(sidebarAdapter); + if (sidebarAdapter != null) { + sidebarAdapter.addData(list); + sidebarAdapter.setData(slideInfoModels); + } sidebarList.setDataHelperNew(new CommonRefreshView.DataHelperNew() { @Override public void loadData(int p) { @@ -97,7 +111,6 @@ public class SidebarLiveAudience extends AbsDialogFragment { .anchorRecommend("10", new com.yunbao.common.http.base.HttpCallback() { @Override public void onSuccess(AnchorRecommendModel anchorRecommendModel) { - if (getActivity().isFinishing()) return; //侧边栏 MainNetManager.get(getActivity()) .getHot(1, new com.yunbao.common.http.base.HttpCallback>() { diff --git a/live/src/main/res/layout/view_sidebar_live_audience.xml b/live/src/main/res/layout/view_sidebar_live_audience.xml index bf238c7d0..633315de9 100644 --- a/live/src/main/res/layout/view_sidebar_live_audience.xml +++ b/live/src/main/res/layout/view_sidebar_live_audience.xml @@ -26,7 +26,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - android:paddingTop="56dp"> + android:paddingTop="26dp"> From 84596b0191479da700a1af2af1ed35e58b98b730 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 24 Aug 2022 15:45:32 +0800 Subject: [PATCH 9/9] =?UTF-8?q?update:=E6=B4=BB=E5=8A=A8=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E7=9A=84=E5=BC=B9=E7=AA=97=E6=94=B9=E4=B8=BAActivity=20fix:?= =?UTF-8?q?=E4=BF=AE=E5=A4=8DZhuangBanActivity.java=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E7=9A=84xml=E8=B5=84=E6=BA=90=E5=86=B2=E7=AA=81=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/common/activity/AbsActivity.java | 6 ++ .../live/activity/LiveAudienceActivity.java | 9 ++- .../live/activity/ZhuangBanActivity.java | 22 +++--- .../live/dialog/LiveHDDialogFragment.java | 36 +++++++--- .../live/views/LiveAudienceViewHolder.java | 2 +- .../res/layout/activity_zhuang_ban_new.xml | 69 +++++++++++++++++++ 6 files changed, 122 insertions(+), 22 deletions(-) create mode 100644 live/src/main/res/layout/activity_zhuang_ban_new.xml diff --git a/common/src/main/java/com/yunbao/common/activity/AbsActivity.java b/common/src/main/java/com/yunbao/common/activity/AbsActivity.java index a3ac74556..aa49fd96f 100644 --- a/common/src/main/java/com/yunbao/common/activity/AbsActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/AbsActivity.java @@ -38,6 +38,7 @@ public abstract class AbsActivity extends AppCompatActivity { protected String mTag; protected Activity mContext; protected List mLifeCycleListeners; + protected boolean isFullWindow; @Override public Resources getResources() { @@ -51,6 +52,11 @@ public abstract class AbsActivity extends AppCompatActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { + isFullWindow=getIntent().getBooleanExtra("isFull",false); + if(isFullWindow){ + getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); + getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); + } super.onCreate(savedInstanceState); mTag = this.getClass().getSimpleName(); setStatusBar(); 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 1cfce84e9..903b70d5e 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -827,11 +827,10 @@ public class LiveAudienceActivity extends LiveActivity { url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid; Log.i("tag", url); - Bundle bundle1 = new Bundle(); - bundle1.putString("url", url); - liveHDDialogFragment = new LiveHDDialogFragment(true); - liveHDDialogFragment.setArguments(bundle1); - liveHDDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); + Intent intent=new Intent(mContext,ZhuangBanActivity.class); + intent.putExtra("url", url); + intent.putExtra("isFull",true); + mContext.startActivity(intent); break; } diff --git a/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java b/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java index 8e6ecadb9..8cfc7ae1d 100644 --- a/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java @@ -1,5 +1,9 @@ package com.yunbao.live.activity; +import static com.yunbao.common.CommonAppContext.logger; +import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics; +import static com.yunbao.common.utils.RouteUtil.PATH_COIN; + import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; @@ -7,7 +11,6 @@ import android.content.Intent; import android.net.Uri; import android.os.Build; import android.provider.MediaStore; -import androidx.annotation.RequiresApi; import android.text.TextUtils; import android.util.Log; import android.view.View; @@ -18,9 +21,12 @@ import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; +import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.ProgressBar; +import androidx.annotation.RequiresApi; + import com.adjust.sdk.Adjust; import com.adjust.sdk.AdjustEvent; import com.alibaba.android.arouter.launcher.ARouter; @@ -40,10 +46,6 @@ import com.yunbao.live.R; import java.net.MalformedURLException; import java.net.URL; -import static com.yunbao.common.CommonAppContext.logger; -import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics; -import static com.yunbao.common.utils.RouteUtil.PATH_COIN; - public class ZhuangBanActivity extends AbsActivity { private ProgressBar mProgressBar; @@ -53,10 +55,11 @@ public class ZhuangBanActivity extends AbsActivity { private ValueCallback mValueCallback; private ValueCallback mValueCallback2; private SVGAImageView svga; + private FrameLayout title; @Override protected int getLayoutId() { - return R.layout.activity_zhuang_ban; + return R.layout.activity_zhuang_ban_new; } @Override @@ -66,9 +69,12 @@ public class ZhuangBanActivity extends AbsActivity { LinearLayout rootView = (LinearLayout) findViewById(R.id.rootView); mProgressBar = (ProgressBar) findViewById(R.id.progressbar); svga = (SVGAImageView) findViewById(R.id.svga); - + title=findViewById(R.id.ft_title); + if (isFullWindow){ + title.setVisibility(View.GONE); + } mWebView = new WebView(mContext); - LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); params.topMargin = DpUtil.dp2px(1); mWebView.setLayoutParams(params); mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java index 59dd56382..80fb75167 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java @@ -1,16 +1,20 @@ package com.yunbao.live.dialog; -import android.app.Dialog; +import static com.yunbao.common.CommonAppContext.logger; +import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics; +import static com.yunbao.common.utils.RouteUtil.PATH_COIN; + import android.graphics.Color; -import android.graphics.drawable.ColorDrawable; import android.os.Build; import android.os.Bundle; import android.text.TextUtils; -import android.util.DisplayMetrics; import android.util.Log; +import android.view.Display; import android.view.Gravity; import android.view.View; +import android.view.ViewGroup; import android.view.Window; +import android.view.WindowInsets; import android.view.WindowManager; import android.webkit.JavascriptInterface; import android.webkit.WebSettings; @@ -20,7 +24,6 @@ import android.webkit.WebViewClient; import com.adjust.sdk.Adjust; import com.adjust.sdk.AdjustEvent; import com.alibaba.android.arouter.launcher.ARouter; -import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.bean.JsWishBean; import com.yunbao.common.dialog.AbsDialogFragment; @@ -29,10 +32,6 @@ import com.yunbao.live.R; import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveAudienceActivity; -import static com.yunbao.common.CommonAppContext.logger; -import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics; -import static com.yunbao.common.utils.RouteUtil.PATH_COIN; - public class LiveHDDialogFragment extends AbsDialogFragment { private WebView mWebView; @@ -73,7 +72,24 @@ public class LiveHDDialogFragment extends AbsDialogFragment { WindowManager.LayoutParams params = window.getAttributes(); params.width = WindowManager.LayoutParams.MATCH_PARENT; if(isFullWindow){ + Display display=null; + window.setLayout(WindowManager.LayoutParams.MATCH_PARENT,WindowManager.LayoutParams.MATCH_PARENT); + if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.R) { + display= requireContext().getDisplay(); + window.getInsetsController().hide(WindowInsets.Type.statusBars()); + window.getInsetsController().hide(WindowInsets.Type.navigationBars()); + }else { + display=window.getWindowManager().getDefaultDisplay(); + window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); + } + window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT); + window.getDecorView().setBackgroundColor(Color.parseColor("#10000000")); params.height = WindowManager.LayoutParams.MATCH_PARENT; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + window.getDecorView().setMinimumHeight(display.getMode().getPhysicalHeight()); + window.getDecorView().setMinimumWidth(display.getMode().getPhysicalWidth()); + } + window.getDecorView().setPadding(10,-10,0,0); }else { params.height = WindowManager.LayoutParams.WRAP_CONTENT; } @@ -192,6 +208,10 @@ public class LiveHDDialogFragment extends AbsDialogFragment { dismiss(); ((LiveAudienceActivity) mContext).openGiftWindow(); } + @JavascriptInterface + public void androidGoBack(){ + dismiss(); + } } /** diff --git a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java index 91059625f..24c2f8dac 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -379,7 +379,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { liveNewPeople.setVisibility(View.VISIBLE); newPeopleUrl = peopleInfo.getLink(); } - }, throwable -> throwable.printStackTrace()).isDisposed(); + }, Throwable::printStackTrace).isDisposed(); } @Override diff --git a/live/src/main/res/layout/activity_zhuang_ban_new.xml b/live/src/main/res/layout/activity_zhuang_ban_new.xml new file mode 100644 index 000000000..1fcf37766 --- /dev/null +++ b/live/src/main/res/layout/activity_zhuang_ban_new.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file