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/common/src/main/java/com/yunbao/common/dialog/EffectsSettingsDialog.java b/common/src/main/java/com/yunbao/common/dialog/EffectsSettingsDialog.java index f2de3925d..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,7 +59,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); + } ); //坐骑特效开关 @@ -73,7 +72,7 @@ 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); } ); } 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..84b5d37dc 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 = ""; @@ -82,9 +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(); + } + } + return userInfo; } @@ -144,6 +149,23 @@ public class IMLoginManager extends BaseCacheManager { 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); + } + + public boolean isMountEffect() { + return getBoolean(MountEffect, false); + } + + public boolean isGiftEffect() { + return getBoolean(GiftEffect, false); + } + /** * 重新请求管理员身份信息 */ 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..903b70d5e 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; @@ -214,7 +215,6 @@ public class LiveAudienceActivity extends LiveActivity { @Override public void onError(String error) { - ToastUtil.show(error); } }); @@ -236,7 +236,6 @@ public class LiveAudienceActivity extends LiveActivity { @Override public void onError(String error) { - ToastUtil.show(error); } }); } @@ -274,6 +273,7 @@ public class LiveAudienceActivity extends LiveActivity { }); + getDrawer(); } private void loadData(ViewGroup viewGroup, int currentItem) { @@ -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) { @@ -700,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(); @@ -824,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; } @@ -857,5 +859,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/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/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/dialog/SidebarLiveAudience.java b/live/src/main/java/com/yunbao/live/dialog/SidebarLiveAudience.java index 6385c8aca..3cddb178c 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; @@ -12,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; @@ -30,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; /** @@ -43,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() { @@ -61,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); @@ -85,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) { @@ -98,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>() { @@ -136,12 +148,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 +163,6 @@ public class SidebarLiveAudience extends AbsDialogFragment { } - /** * 前往直播间 */ 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..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).getUserInfo().isMountEffect()){ + if (IMLoginManager.get(mContext).isMountEffect()) { GifCacheUtil.getFile(Constants.GIF_CAR_PREFIX + id, url1, "0", mDownloadGifCallback); + } else { + mIsAnimating = false; } } 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..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()) { //同一直播间,玩家自己送礼物,也能看到全服通知 //同一直播间,其他玩家也能看到全服通知 @@ -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..24c2f8dac 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; /** @@ -126,6 +127,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 +144,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 +162,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) { @@ -371,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::printStackTrace).isDisposed(); } @Override 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/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 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..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,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="26dp"> - + + + + + 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; 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); } }); }