From 70b05b85d799cfb9fb42ecf88627fe9774beb0fd Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 30 Nov 2022 17:37:20 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=9B=B4=E6=92=AD=E9=97=B4=E9=97=AA?= =?UTF-8?q?=E7=83=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/drawable/loading_00000.png | Bin .../src/main/res/drawable/loading_00001.png | Bin .../src/main/res/drawable/loading_00002.png | Bin .../src/main/res/drawable/loading_00003.png | Bin .../src/main/res/drawable/loading_00004.png | Bin .../src/main/res/drawable/loading_00005.png | Bin .../src/main/res/drawable/loading_00006.png | Bin .../src/main/res/drawable/loading_00007.png | Bin .../src/main/res/drawable/loading_00008.png | Bin .../src/main/res/drawable/loading_00009.png | Bin .../src/main/res/drawable/loading_00010.png | Bin .../src/main/res/drawable/loading_00011.png | Bin .../src/main/res/drawable/loading_00012.png | Bin .../src/main/res/drawable/loading_00013.png | Bin .../src/main/res/drawable/loading_00014.png | Bin .../src/main/res/drawable/loading_00015.png | Bin .../main/res/drawable/loading_animation.xml | 54 ++++++++++++++++++ .../live/adapter/VerticalPagerAdapter.java | 4 +- .../live/views/LivePlayRyViewHolder.java | 16 +++--- .../live/views/PortraitLiveManager.java | 26 +++++---- .../res/layout/activity_live_audience.xml | 4 +- 21 files changed, 84 insertions(+), 20 deletions(-) rename {live => common}/src/main/res/drawable/loading_00000.png (100%) rename {live => common}/src/main/res/drawable/loading_00001.png (100%) rename {live => common}/src/main/res/drawable/loading_00002.png (100%) rename {live => common}/src/main/res/drawable/loading_00003.png (100%) rename {live => common}/src/main/res/drawable/loading_00004.png (100%) rename {live => common}/src/main/res/drawable/loading_00005.png (100%) rename {live => common}/src/main/res/drawable/loading_00006.png (100%) rename {live => common}/src/main/res/drawable/loading_00007.png (100%) rename {live => common}/src/main/res/drawable/loading_00008.png (100%) rename {live => common}/src/main/res/drawable/loading_00009.png (100%) rename {live => common}/src/main/res/drawable/loading_00010.png (100%) rename {live => common}/src/main/res/drawable/loading_00011.png (100%) rename {live => common}/src/main/res/drawable/loading_00012.png (100%) rename {live => common}/src/main/res/drawable/loading_00013.png (100%) rename {live => common}/src/main/res/drawable/loading_00014.png (100%) rename {live => common}/src/main/res/drawable/loading_00015.png (100%) create mode 100644 common/src/main/res/drawable/loading_animation.xml diff --git a/live/src/main/res/drawable/loading_00000.png b/common/src/main/res/drawable/loading_00000.png similarity index 100% rename from live/src/main/res/drawable/loading_00000.png rename to common/src/main/res/drawable/loading_00000.png diff --git a/live/src/main/res/drawable/loading_00001.png b/common/src/main/res/drawable/loading_00001.png similarity index 100% rename from live/src/main/res/drawable/loading_00001.png rename to common/src/main/res/drawable/loading_00001.png diff --git a/live/src/main/res/drawable/loading_00002.png b/common/src/main/res/drawable/loading_00002.png similarity index 100% rename from live/src/main/res/drawable/loading_00002.png rename to common/src/main/res/drawable/loading_00002.png diff --git a/live/src/main/res/drawable/loading_00003.png b/common/src/main/res/drawable/loading_00003.png similarity index 100% rename from live/src/main/res/drawable/loading_00003.png rename to common/src/main/res/drawable/loading_00003.png diff --git a/live/src/main/res/drawable/loading_00004.png b/common/src/main/res/drawable/loading_00004.png similarity index 100% rename from live/src/main/res/drawable/loading_00004.png rename to common/src/main/res/drawable/loading_00004.png diff --git a/live/src/main/res/drawable/loading_00005.png b/common/src/main/res/drawable/loading_00005.png similarity index 100% rename from live/src/main/res/drawable/loading_00005.png rename to common/src/main/res/drawable/loading_00005.png diff --git a/live/src/main/res/drawable/loading_00006.png b/common/src/main/res/drawable/loading_00006.png similarity index 100% rename from live/src/main/res/drawable/loading_00006.png rename to common/src/main/res/drawable/loading_00006.png diff --git a/live/src/main/res/drawable/loading_00007.png b/common/src/main/res/drawable/loading_00007.png similarity index 100% rename from live/src/main/res/drawable/loading_00007.png rename to common/src/main/res/drawable/loading_00007.png diff --git a/live/src/main/res/drawable/loading_00008.png b/common/src/main/res/drawable/loading_00008.png similarity index 100% rename from live/src/main/res/drawable/loading_00008.png rename to common/src/main/res/drawable/loading_00008.png diff --git a/live/src/main/res/drawable/loading_00009.png b/common/src/main/res/drawable/loading_00009.png similarity index 100% rename from live/src/main/res/drawable/loading_00009.png rename to common/src/main/res/drawable/loading_00009.png diff --git a/live/src/main/res/drawable/loading_00010.png b/common/src/main/res/drawable/loading_00010.png similarity index 100% rename from live/src/main/res/drawable/loading_00010.png rename to common/src/main/res/drawable/loading_00010.png diff --git a/live/src/main/res/drawable/loading_00011.png b/common/src/main/res/drawable/loading_00011.png similarity index 100% rename from live/src/main/res/drawable/loading_00011.png rename to common/src/main/res/drawable/loading_00011.png diff --git a/live/src/main/res/drawable/loading_00012.png b/common/src/main/res/drawable/loading_00012.png similarity index 100% rename from live/src/main/res/drawable/loading_00012.png rename to common/src/main/res/drawable/loading_00012.png diff --git a/live/src/main/res/drawable/loading_00013.png b/common/src/main/res/drawable/loading_00013.png similarity index 100% rename from live/src/main/res/drawable/loading_00013.png rename to common/src/main/res/drawable/loading_00013.png diff --git a/live/src/main/res/drawable/loading_00014.png b/common/src/main/res/drawable/loading_00014.png similarity index 100% rename from live/src/main/res/drawable/loading_00014.png rename to common/src/main/res/drawable/loading_00014.png diff --git a/live/src/main/res/drawable/loading_00015.png b/common/src/main/res/drawable/loading_00015.png similarity index 100% rename from live/src/main/res/drawable/loading_00015.png rename to common/src/main/res/drawable/loading_00015.png diff --git a/common/src/main/res/drawable/loading_animation.xml b/common/src/main/res/drawable/loading_animation.xml new file mode 100644 index 000000000..4a98f36b8 --- /dev/null +++ b/common/src/main/res/drawable/loading_animation.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/java/com/yunbao/live/adapter/VerticalPagerAdapter.java b/live/src/main/java/com/yunbao/live/adapter/VerticalPagerAdapter.java index 6edabd64f..e7e24200a 100644 --- a/live/src/main/java/com/yunbao/live/adapter/VerticalPagerAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/VerticalPagerAdapter.java @@ -55,7 +55,6 @@ public class VerticalPagerAdapter extends androidx.viewpager.widget.PagerAdapter ImageView ivLoading = view.findViewById(R.id.iv_loading); AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground(); frameAnimation.start(); -// ImgLoader.displayGif(mContext, R.drawable.live_loading, ivLoading); view.setId(position); container.addView(view); return view; @@ -63,6 +62,7 @@ public class VerticalPagerAdapter extends androidx.viewpager.widget.PagerAdapter @Override public void destroyItem(ViewGroup container, int position, Object object) { - container.removeView(container.findViewById(position)); + +// container.removeView(container.findViewById(position)); } } diff --git a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java index ac4f8f9f0..8b36ffa7d 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java @@ -32,6 +32,7 @@ import com.tencent.live2.V2TXLivePlayer; import com.tencent.live2.V2TXLivePlayerObserver; import com.tencent.live2.impl.V2TXLivePlayerImpl; import com.tencent.rtmp.ui.TXCloudVideoView; +import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpClient; import com.yunbao.common.utils.DialogUitl; @@ -164,13 +165,14 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { public void hideCover() { // if (mCover != null) { // if (mCover.getVisibility()==View.VISIBLE){ -// new Handler().postDelayed(new Runnable() { -// @Override -// public void run() { -// mCover.setVisibility(View.GONE); -// mLoading2.setVisibility(View.GONE); -// } -// },200); +//// new Handler().postDelayed(new Runnable() { +//// @Override +//// public void run() { +//// +//// } +//// },200); +// mCover.setVisibility(View.GONE); +// mLoading2.setVisibility(View.GONE); // } // // 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 49358a932..05706b47e 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -6,6 +6,7 @@ import android.app.Activity; import android.app.Dialog; import android.content.Intent; import android.content.res.Configuration; +import android.graphics.drawable.AnimationDrawable; import android.os.CountDownTimer; import android.os.Handler; import android.text.TextUtils; @@ -59,7 +60,6 @@ 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; @@ -125,7 +125,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe private ImageView btnSmallScreen; private Intent mIntent; //直播间背景 - private ImageView liveBack; + private ImageView liveBack, ivBg, ivLoading; private View mask; //侧滑布局 @@ -183,6 +183,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe private boolean isEnterRoom = false; private boolean kick = false; + private View loading; + public PortraitLiveManager setQuitF(boolean quitF) { isQuitF = quitF; return this; @@ -204,6 +206,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe playContainer = mRootContainer.findViewById(R.id.play_container); mViewPager = mRootContainer.findViewById(R.id.viewPager); btnSmallScreen = mRootContainer.findViewById(R.id.btn_small_screen); + loading = mRootContainer.findViewById(R.id.loading); + ivBg = mRootContainer.findViewById(R.id.iv_bg); + ivLoading = mRootContainer.findViewById(R.id.iv_loading); mSecondPage = (ViewGroup) LayoutInflater.from(mContext).inflate(R.layout.view_audience_page, mViewPager, false); mContainerWrap = mSecondPage.findViewById(R.id.container_wrap); mContainer = mSecondPage.findViewById(R.id.container); @@ -253,6 +258,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe .setParametersModel(openParametersModel .setmLiveType(mLiveType) .setmLiveTypeVal(mLiveTypeVal))); + loading.setVisibility(View.VISIBLE); + ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), ivBg); + AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground(); + frameAnimation.start(); if (mLivePlayViewHolder == null) { mLivePlayViewHolder = new LivePlayRyViewHolder(mContext, playContainer, 1); mLiveRoomViewHolder = new LiveRoomViewHolder(false, 1, mContext, mContainer, mSecondPage.findViewById(R.id.gift_gif), mSecondPage.findViewById(R.id.gift_svga), mContainerWrap, mContext.getWindowManager()); @@ -279,8 +288,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe LivePlayRyViewHolder.leave.setVisibility(View.GONE); } //直播间背景 + ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), liveBack, 400, 600); - //ImageLoadUtils.loadUrlToBlur(mContext,mLiveBean.getAvatar(),400,600,liveBack); + mask.setVisibility(View.VISIBLE); mLivePlayViewHolder.setLiveBean(mLiveBean); mLivePlayViewHolder.setCover(mLiveBean.getAvatar()); @@ -333,12 +343,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe public void onSuccess(EnterRoomNewModel data) { mLivePlayViewHolder.setLiveBeanLandscape(data.getLiveInfo().getLandscape()); //是否热度卡加成 - liveHandler.postDelayed(new Runnable() { - @Override - public void run() { - mLiveRoomViewHolder.getIsHot(data.getIsUseHotCard()); - } - }, 700); + liveHandler.postDelayed(() -> mLiveRoomViewHolder.getIsHot(data.getIsUseHotCard()), 700); isEnterRoom = true; //延时1秒发送 @@ -547,6 +552,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.showPrizePoolLevel(String.valueOf(giftPrizePoolLevel)); } } + liveHandler.postDelayed(() -> loading.setVisibility(View.GONE),700); } @@ -874,7 +880,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe @Override public void onCancel() { - // ((LiveAudienceActivity) mContext).setEnableScroll(true); + // ((LiveAudienceActivity) mContext).setEnableScroll(true); } }); diff --git a/live/src/main/res/layout/activity_live_audience.xml b/live/src/main/res/layout/activity_live_audience.xml index dbdb835bb..352e09a8e 100644 --- a/live/src/main/res/layout/activity_live_audience.xml +++ b/live/src/main/res/layout/activity_live_audience.xml @@ -1,6 +1,5 @@ @@ -53,6 +52,9 @@ android:visibility="gone" /> + \ No newline at end of file From 637fedcbe63d56627779ccb80e3b3d52c779a64b Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 30 Nov 2022 18:33:55 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=A4=9A=E4=BA=BA?= =?UTF-8?q?=E8=BF=9E=E9=BA=A6=E5=88=97=E8=A1=A8=E4=B8=80=E7=9B=B4=E5=88=B7?= =?UTF-8?q?=E6=96=B0=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/dialog/LiveMicAnchorDialogFragment.java | 1 + 1 file changed, 1 insertion(+) diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveMicAnchorDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveMicAnchorDialogFragment.java index 2f504339a..237aec02a 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveMicAnchorDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveMicAnchorDialogFragment.java @@ -271,6 +271,7 @@ public class LiveMicAnchorDialogFragment extends AbsDialogFragment implements Vi bean.setType(AnchorUserMicInfoAdapter.TYPE_MIC_INVITE); data.add(bean); } + mRefreshView.setNotLoadMore(); } else { data = JSON.parseArray(obj.getString("userlist"), MicUserBean.class); for (MicUserBean bean : data) { From 210749ebd3ad766db5a9c6d50c94e7798f31e326 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 30 Nov 2022 18:34:18 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=A4=9A=E4=BA=BA?= =?UTF-8?q?=E8=BF=9E=E9=BA=A6=E4=B8=8B=E9=BA=A6=E9=BB=91=E5=B1=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/yunbao/live/views/LivePlayRyViewHolder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java index ac4f8f9f0..1907a1d72 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java @@ -248,7 +248,8 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { .postDelayed(() -> { mPlayer.stopPlay(); int val = mPlayer.startPlay(purl); - // ToastUtil.show("强制播放" + val); + // ToastUtil.show("强制播放" + val); + Log.i(TAG, "强制播放: " + val); }, 100); } } @@ -705,6 +706,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { mPlayer.startPlay(purl); } ry_view.removeAllViews(); + ry_view.getLayoutParams().height = ViewGroup.LayoutParams.WRAP_CONTENT; onPrepared(); rcrtcRoom = null; MicStatusManager.getInstance().clear();