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 c6f57b255..3c3071e54 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -29,7 +29,6 @@ import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.UserBean; import com.yunbao.common.dialog.EffectsSettingsDialog; import com.yunbao.common.dialog.LiveChargeDialogFragment; -import com.yunbao.live.dialog.LiveTotalDialog; import com.yunbao.common.http.CommonHttpConsts; import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; @@ -52,6 +51,7 @@ import com.yunbao.live.dialog.LiveGiftDialogFragment; import com.yunbao.live.dialog.LiveGuardDialogFragment; import com.yunbao.live.dialog.LiveHDDialogFragment; import com.yunbao.live.dialog.LiveMicUserDialogFragment; +import com.yunbao.live.dialog.LiveTotalDialog; import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience; import com.yunbao.live.dialog.SidebarLiveAudience; import com.yunbao.live.event.LinkMicTxAccEvent; @@ -63,6 +63,7 @@ import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; import com.yunbao.live.socket.SocketSendBean; import com.yunbao.live.utils.LiveImDeletUtil; import com.yunbao.live.views.LiveRoomPlayViewHolder; +import com.yunbao.live.views.LoadingView; import com.yunbao.live.views.PortraitLiveManager; import org.greenrobot.eventbus.Subscribe; @@ -119,6 +120,7 @@ public class LiveAudienceActivity extends LiveActivity { private int mLastPosition = -1; private ViewGroup mViewGroup; + private LoadingView loadingView; @Override @@ -160,7 +162,8 @@ public class LiveAudienceActivity extends LiveActivity { private void initView() { // 竖直滑动 ViewPager verticalViewPager = findViewById(R.id.view_pager); - + loadingView = findViewById(R.id.loading); + loadingView.show(); } public void setBackIndex(int backIndex) { @@ -202,6 +205,7 @@ public class LiveAudienceActivity extends LiveActivity { } mPagerAdapter = new VerticalPagerAdapter(itemModelList, mContext); verticalViewPager.setAdapter(mPagerAdapter); + loadingView.hide(); } @Override 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 df43c3bbd..ec4a699e1 100644 --- a/live/src/main/java/com/yunbao/live/dialog/SidebarLiveAudience.java +++ b/live/src/main/java/com/yunbao/live/dialog/SidebarLiveAudience.java @@ -134,7 +134,7 @@ public class SidebarLiveAudience extends AbsDialogFragment { @Override protected void setWindowAttributes(Window window) { - + getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.setWindowAnimations(com.yunbao.common.R.style.RightLeftToAnim); WindowManager.LayoutParams params = window.getAttributes(); params.width = DeviceUtils.getScreenWidth(getActivity()) / 3 * 2; diff --git a/live/src/main/java/com/yunbao/live/views/LoadingView.java b/live/src/main/java/com/yunbao/live/views/LoadingView.java new file mode 100644 index 000000000..6f8d7209c --- /dev/null +++ b/live/src/main/java/com/yunbao/live/views/LoadingView.java @@ -0,0 +1,61 @@ +package com.yunbao.live.views; + +import android.content.Context; +import android.graphics.drawable.AnimationDrawable; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.FrameLayout; +import android.widget.ImageView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.yunbao.live.R; + + +public class LoadingView extends FrameLayout { + + private Context mContext; + private ImageView mIvLoading; + + public LoadingView(@NonNull Context context) { + super(context); + init(context); + } + + public LoadingView(@NonNull Context context, @Nullable AttributeSet attrs) { + super(context, attrs); + init(context); + } + + public LoadingView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(context); + } + + private void init(Context context) { + this.mContext = context; + View view = LayoutInflater.from(mContext).inflate(R.layout.layout_portrait_live_item, this, true); + mIvLoading = view.findViewById(R.id.iv_loading); + } + + + public void show() { + // 加载动画 + ImageView ivLoading = mIvLoading.findViewById(R.id.iv_loading); + AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground(); + frameAnimation.start(); + + setVisibility(VISIBLE); + } + + public void hide() { + // 加载动画 + ImageView ivLoading = mIvLoading.findViewById(R.id.iv_loading); + AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground(); + frameAnimation.stop(); + setVisibility(GONE); + } + +} diff --git a/live/src/main/res/layout/activity_live_detail.xml b/live/src/main/res/layout/activity_live_detail.xml index 4eedf5c79..bf7edf6a4 100644 --- a/live/src/main/res/layout/activity_live_detail.xml +++ b/live/src/main/res/layout/activity_live_detail.xml @@ -9,5 +9,10 @@ android:layout_height="match_parent" android:overScrollMode="never" /> + \ No newline at end of file