diff --git a/common/src/main/java/com/yunbao/common/views/weight/LiveFloatView.java b/common/src/main/java/com/yunbao/common/views/weight/LiveFloatView.java index 47abc6d2a..251818e8e 100644 --- a/common/src/main/java/com/yunbao/common/views/weight/LiveFloatView.java +++ b/common/src/main/java/com/yunbao/common/views/weight/LiveFloatView.java @@ -73,8 +73,8 @@ public class LiveFloatView implements Function1 { CardView layout = magnetView.findViewById(R.id.layout); RelativeLayout.LayoutParams cardParams = (RelativeLayout.LayoutParams) layout.getLayoutParams(); if (mLiveBean.getLandscape() == 1) { - cardParams.height = DpUtil.dp2px(130); - cardParams.width = DpUtil.dp2px(230); + cardParams.height = DpUtil.dp2px(190); + cardParams.width = DpUtil.dp2px(255); } else { cardParams.height = DpUtil.dp2px(224); cardParams.width = DpUtil.dp2px(126); @@ -91,8 +91,8 @@ public class LiveFloatView implements Function1 { Log.e("视频流有", "videoWidth:" + videoWidth + " videoHeight:" + videoHeight); if (mLiveBean.getLandscape() != 1){ if (videoWidth > 720) { - cardParams.height = DpUtil.dp2px(130); - cardParams.width = DpUtil.dp2px(230); + cardParams.height = DpUtil.dp2px(190); + cardParams.width = DpUtil.dp2px(255); } else { cardParams.height = DpUtil.dp2px(224); cardParams.width = DpUtil.dp2px(126); @@ -206,8 +206,8 @@ public class LiveFloatView implements Function1 { CardView layout = view.findViewById(R.id.layout); RelativeLayout.LayoutParams cardParams = (RelativeLayout.LayoutParams) layout.getLayoutParams(); if (mLiveBean.getLandscape() == 1) { - cardParams.height = DpUtil.dp2px(130); - cardParams.width = DpUtil.dp2px(230); + cardParams.height = DpUtil.dp2px(190); + cardParams.width = DpUtil.dp2px(255); } else { cardParams.height = DpUtil.dp2px(224); cardParams.width = DpUtil.dp2px(126); @@ -224,8 +224,8 @@ public class LiveFloatView implements Function1 { Log.e("视频流有", "videoWidth:" + videoWidth + " videoHeight:" + videoHeight); if (mLiveBean.getLandscape() != 1){ if (videoWidth > 720) { - cardParams.height = DpUtil.dp2px(130); - cardParams.width = DpUtil.dp2px(230); + cardParams.height = DpUtil.dp2px(190); + cardParams.width = DpUtil.dp2px(255); } else { cardParams.height = DpUtil.dp2px(224); cardParams.width = DpUtil.dp2px(126); diff --git a/common/src/main/java/com/yunbao/common/views/weight/LiveLoadingViewHolder.java b/common/src/main/java/com/yunbao/common/views/weight/LiveLoadingViewHolder.java new file mode 100644 index 000000000..ba9ef0aa9 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/views/weight/LiveLoadingViewHolder.java @@ -0,0 +1,68 @@ +package com.yunbao.common.views.weight; + +import android.app.Activity; +import android.graphics.drawable.AnimationDrawable; +import android.view.Gravity; +import android.view.View; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.RelativeLayout; + +import com.lzf.easyfloat.EasyFloat; +import com.lzf.easyfloat.enums.ShowPattern; +import com.lzf.easyfloat.interfaces.FloatCallbacks; +import com.lzf.easyfloat.interfaces.OnInvokeView; +import com.yunbao.common.R; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.utils.DeviceUtils; + +import kotlin.Unit; +import kotlin.jvm.functions.Function1; + +public class LiveLoadingViewHolder implements Function1 { + private String TAG = "LiveLoadingViewHolder"; + private Activity mContext; + private String url; + + public void builderSystemFloat(Activity mContext, String url) { + this.mContext = mContext; + this.url = url; + EasyFloat.with(mContext) + .setTag(TAG) + .setLayout(R.layout.layout_portrait_live_item, new LiveOnInvokeView()) + .setShowPattern(ShowPattern.CURRENT_ACTIVITY) + .setFilter() + .setGravity(Gravity.CENTER) + .setAnimator(null) + .setMatchParent(true,true) + .registerCallback(this) + .show(); + } + + /** + * loading + */ + private class LiveOnInvokeView implements OnInvokeView { + + @Override + public void invoke(View view) { + + RelativeLayout layout = view.findViewById(R.id.layout); + FrameLayout.LayoutParams cardParams = (FrameLayout.LayoutParams) layout.getLayoutParams(); + cardParams.width = DeviceUtils.getScreenWidth(mContext); + cardParams.height = DeviceUtils.getScreenHeight(mContext); + layout.setLayoutParams(cardParams); + ImageView ivBg = view.findViewById(R.id.iv_bg); + ImgLoader.displayBlurLive(mContext, url, ivBg); + // 加载动画 + ImageView ivLoading = view.findViewById(R.id.iv_loading); + AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground(); + frameAnimation.start(); + } + } + + @Override + public Unit invoke(FloatCallbacks.Builder builder) { + return null; + } +} diff --git a/live/src/main/res/layout/layout_portrait_live_item.xml b/common/src/main/res/layout/layout_portrait_live_item.xml similarity index 93% rename from live/src/main/res/layout/layout_portrait_live_item.xml rename to common/src/main/res/layout/layout_portrait_live_item.xml index f6a4bce29..87df8f2ca 100644 --- a/live/src/main/res/layout/layout_portrait_live_item.xml +++ b/common/src/main/res/layout/layout_portrait_live_item.xml @@ -1,6 +1,6 @@ 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 a03b431e5..069533611 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -144,6 +144,7 @@ public class LiveAudienceActivity extends LiveActivity { private Handler liveHandler = new Handler(); private ImageView voicePress; private View titleLine; + private boolean liveIndex = true; @Override public T findViewById(@IdRes int id) { @@ -301,7 +302,7 @@ public class LiveAudienceActivity extends LiveActivity { @Override public void run() { AnchorRecommendItemModel data = itemModelList.get(mCurrentPage); - if (mCurrentPage==0){ + if (mCurrentPage == 0&&liveIndex) { View rootView = manager.getRootView(); if (rootView.getParent() != null && rootView.getParent() instanceof ViewGroup) { ((ViewGroup) (rootView.getParent())).removeView(rootView); @@ -313,11 +314,12 @@ public class LiveAudienceActivity extends LiveActivity { //加载完页面后再后台静默下载礼物svga downloadAllGift(); over(); - }else { + + } else { new LiveRoomCheckLivePresenter(mContext, data.getUid(), data.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() { @Override public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) { - + liveIndex =false; try { mLiveSDK = Integer.parseInt(liveSdk); mLiveTypeVal = Integer.parseInt(liveTypeVal); @@ -754,7 +756,7 @@ public class LiveAudienceActivity extends LiveActivity { if (liveBean == null) { return; } - if(MicStatusManager.getInstance().isMic(liveUid)){ + if (MicStatusManager.getInstance().isMic(liveUid)) { MicStatusManager.getInstance().showDownMicDialog(mContext); return; } @@ -1053,7 +1055,7 @@ public class LiveAudienceActivity extends LiveActivity { break; case LIVE_ROOM_EXCEPTION: //主播未直播时自动下滑至下一个直播间 - mCurrentPage = mCurrentPage+1; + mCurrentPage = mCurrentPage + 1; liveHandler.post(liveRunnable); break; case REFRESH_THE_LIVEl_PAGE: diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index cfcbe1164..804a8901b 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -2988,6 +2988,19 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis }); } + /** + * 获取是否有热度卡加成 + */ + public static void getIsHot(String isUseHotCard) { + + if ("1".equals(isUseHotCard)) { + ft_hot_add.setVisibility(View.VISIBLE); + } else { + ft_hot_add.setVisibility(View.GONE); + } + + } + public void resetUserListWidth(int width) { ViewGroup.LayoutParams params = mUserRecyclerView.getLayoutParams(); params.width = width; @@ -3169,7 +3182,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (taskModel != null) { GiftModel giftModel = newPeopleTask.getGift(); - if (giftModel!=null){ + if (giftModel != null) { RewardAllModel rewardOne = newPeopleTask.getRewardOne(); String gold = rewardOne.getGold(); String experience = rewardOne.getExperience(); @@ -3580,7 +3593,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .setMicIng(2) .setBean(liveBean).setLiveType(liveType).setLiveTypeVal(Integer.parseInt(liveTypeVal))); } else { - if(MicStatusManager.getInstance().isMic(liveUid)){ + if (MicStatusManager.getInstance().isMic(liveUid)) { MicStatusManager.getInstance().showDownMicDialog(mContext); return; } diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index c0b649b35..fd0f568cb 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -59,6 +59,7 @@ import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.formatBigNum; import com.yunbao.common.views.weight.LiveFloatView; +import com.yunbao.common.views.weight.LiveLoadingViewHolder; import com.yunbao.live.R; import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveAudienceActivity; @@ -257,7 +258,13 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveLinkMicPresenter.setLiveSdk(mLiveSDK); mLiveLinkMicAnchorPresenter.setLiveSdk(mLiveSDK); } - + //去除主播离开画面 + if (LivePlayKsyViewHolder.leave != null) { + LivePlayKsyViewHolder.leave.setVisibility(View.GONE); + } + if (LivePlayRyViewHolder.leave != null) { + LivePlayRyViewHolder.leave.setVisibility(View.GONE); + } //直播间背景 ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), liveBack, 400, 600); //ImageLoadUtils.loadUrlToBlur(mContext,mLiveBean.getAvatar(),400,600,liveBack); @@ -304,6 +311,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe @Override public void onSuccess(EnterRoomNewModel data) { mLivePlayViewHolder.setLiveBeanLandscape(data.getLiveInfo().getLandscape()); + //是否热度卡加成 + mLiveRoomViewHolder.getIsHot(data.getIsUseHotCard()); isEnterRoom = true; //延时1秒发送 liveHandler.postDelayed(sendFIm, 700); @@ -334,7 +343,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe bannerModel.setStart(false); bannerModel.setLink(model.getLink()); bannerModel.setImageUrl(model.getImg()); - bannerBeans.add(bannerModel); + if (TextUtils.equals(model.getIsHidden(),"0")){ + bannerBeans.add(bannerModel); + } + } } @@ -503,6 +515,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.showPrizePoolLevel(String.valueOf(giftPrizePoolLevel)); } } + } @Override