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;