直播间的滚动

This commit is contained in:
18401019693 2022-08-20 15:33:41 +08:00
parent 3ae14ed506
commit 18d62e5d56
32 changed files with 4663 additions and 1015 deletions

View File

@ -0,0 +1,31 @@
package com.yunbao.common.views.weight;
import android.content.Context;
import android.util.AttributeSet;
import androidx.drawerlayout.widget.DrawerLayout;
//解决直播间冲突
public class MyDrawerLayout extends DrawerLayout {
public MyDrawerLayout(Context context) {
super(context);
}
public MyDrawerLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MyDrawerLayout(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
widthMeasureSpec = MeasureSpec.makeMeasureSpec(
MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.EXACTLY);
heightMeasureSpec = MeasureSpec.makeMeasureSpec(
MeasureSpec.getSize(heightMeasureSpec), MeasureSpec.EXACTLY);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1109,9 +1109,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
mLiveContributeViewHolder.addToParent(); mLiveContributeViewHolder.addToParent();
} }
mLiveContributeViewHolder.show(); mLiveContributeViewHolder.show();
if (CommonAppConfig.LIVE_ROOM_SCROLL && !mIsAnchor) {
((LiveAudienceActivity) this).setScrollFrozen(true);
}
} }
/** /**
@ -1124,9 +1122,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
mLiveMedalRankViewHolder.addToParent(); mLiveMedalRankViewHolder.addToParent();
} }
mLiveMedalRankViewHolder.show(); mLiveMedalRankViewHolder.show();
if (CommonAppConfig.LIVE_ROOM_SCROLL && !mIsAnchor) {
((LiveAudienceActivity) this).setScrollFrozen(true);
}
} }

View File

@ -0,0 +1,63 @@
package com.yunbao.live.adapter;
import android.app.Activity;
import android.graphics.drawable.AnimationDrawable;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.yunbao.common.bean.AnchorRecommendItemModel;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.live.R;
import java.util.ArrayList;
import java.util.List;
public class VerticalPagerAdapter extends androidx.viewpager.widget.PagerAdapter {
List<AnchorRecommendItemModel> liveBeans = new ArrayList<>();
private Activity mContext;
private int mPosition;
public VerticalPagerAdapter(List<AnchorRecommendItemModel> liveBeans, Activity mContext) {
this.liveBeans = liveBeans;
this.mContext = mContext;
}
@Override
public int getCount() {
return liveBeans.size();
}
@Override
public boolean isViewFromObject(View view, Object object) {
return view == object;
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
Log.e("LiveAudienceActivity", "VerticalPagerAdapter:" + position);
View view = LayoutInflater.from(container.getContext()).inflate(R.layout.layout_portrait_live_item, null);
// 背景
AnchorRecommendItemModel liveItemBean = liveBeans.get(position);
ImageView ivBg = view.findViewById(R.id.iv_bg);
ImgLoader.displayBlurLive(mContext, liveItemBean.getAvatar(), ivBg);
// 加载动画
ImageView ivLoading = view.findViewById(R.id.iv_loading);
AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground();
frameAnimation.start();
view.setId(position);
container.addView(view);
return view;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView(container.findViewById(position));
}
}

View File

@ -18,11 +18,11 @@ import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.http.LiveHttpUtil;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import static com.yunbao.live.activity.LiveAudienceActivity.countDownTimer;
import static com.yunbao.live.views.LiveRoomViewHolder.follow; import static com.yunbao.live.views.LiveRoomViewHolder.follow;
import static com.yunbao.live.views.LiveRoomViewHolder.mLiveUid; import static com.yunbao.live.views.LiveRoomViewHolder.mLiveUid;
@ -142,7 +142,7 @@ public class BlowkissDialog extends AbsDialogFragment {
ToastUtil.show(msg); ToastUtil.show(msg);
} }
}); });
countDownTimer.cancel(); ((LiveAudienceActivity) mContext).getCountDownTimer().cancel();
dismiss(); dismiss();
} }
}); });

View File

@ -65,8 +65,8 @@ public class LiveMoreDialogFragment extends AbsDialogFragment {
} else if (((LiveAudienceActivity) mContext).pkInfo != null && ((LiveAudienceActivity) mContext).pkInfo.getIntValue("ifpk") == 0 && ((LiveAudienceActivity) mContext).anyway.equals("1") && LiveRoomViewHolder.d_pk_view.getVisibility() != View.VISIBLE) { } else if (((LiveAudienceActivity) mContext).pkInfo != null && ((LiveAudienceActivity) mContext).pkInfo.getIntValue("ifpk") == 0 && ((LiveAudienceActivity) mContext).anyway.equals("1") && LiveRoomViewHolder.d_pk_view.getVisibility() != View.VISIBLE) {
((LiveAudienceActivity) mContext).btnSmallScreen.setVisibility(View.VISIBLE); ((LiveAudienceActivity) mContext).btnSmallScreen.setVisibility(View.VISIBLE);
((LiveAudienceActivity) mContext).mViewPager.setCurrentItem(0); LiveAudienceActivity.setCurrentItem(0);
((LiveAudienceActivity) mContext).mLivePlayViewHolder.fullScreen(); LiveAudienceActivity.getmLivePlayViewHolder().fullScreen();
} else { } else {
Toast.makeText(mContext, "当前模式不能全屏", Toast.LENGTH_SHORT).show(); Toast.makeText(mContext, "当前模式不能全屏", Toast.LENGTH_SHORT).show();
} }

View File

@ -5,8 +5,6 @@ import android.view.Gravity;
import android.view.View; import android.view.View;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
@ -24,18 +22,14 @@ import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.http.LiveHttpUtil;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import static com.yunbao.live.activity.LiveAudienceActivity.countDownTimer;
import static com.yunbao.live.views.LiveRoomViewHolder.follow;
import static com.yunbao.live.views.LiveRoomViewHolder.mLiveUid;
public class NewUserDialog extends AbsDialogFragment { public class NewUserDialog extends AbsDialogFragment {
int gif = 0; int gif = 0;
@ -108,7 +102,8 @@ public class NewUserDialog extends AbsDialogFragment {
JSONObject obj = old_obj.getJSONObject("reward_all"); JSONObject obj = old_obj.getJSONObject("reward_all");
gold.setText(obj.getString("gold")); gold.setText(obj.getString("gold"));
exp.setText(obj.getString("experience")); exp.setText(obj.getString("experience"));
}}); }
});
TextView btn_confirm = (TextView) mRootView.findViewById(R.id.btn_confirm); TextView btn_confirm = (TextView) mRootView.findViewById(R.id.btn_confirm);
@ -129,7 +124,7 @@ public class NewUserDialog extends AbsDialogFragment {
EventBus.getDefault().post("showBanner"); EventBus.getDefault().post("showBanner");
EventBus.getDefault().post("svga_new_user_gif"); EventBus.getDefault().post("svga_new_user_gif");
IMLoginManager.get(mContext).setNewUserGif(true); IMLoginManager.get(mContext).setNewUserGif(true);
countDownTimer.cancel(); ((LiveAudienceActivity) mContext).getCountDownTimer().cancel();
dismiss(); dismiss();
} }
}); });

View File

@ -1002,8 +1002,8 @@ public class LiveLinkMicPkPresenter implements View.OnClickListener {
mLiveLinkMicPkViewHolder = new LiveLinkMicPkViewHolder(mContext, mPkContainer); mLiveLinkMicPkViewHolder = new LiveLinkMicPkViewHolder(mContext, mPkContainer);
mLiveLinkMicPkViewHolder.addToParent(); mLiveLinkMicPkViewHolder.addToParent();
mLiveLinkMicPkViewHolder.setIsAnchor(mIsAnchor); mLiveLinkMicPkViewHolder.setIsAnchor(mIsAnchor);
if (LiveAudienceActivity.mLivePlayViewHolder != null) { if (LiveAudienceActivity.getmLivePlayViewHolder() != null) {
LiveAudienceActivity.mLivePlayViewHolder.setPkview(); LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
} }
} }
@ -1081,8 +1081,8 @@ public class LiveLinkMicPkPresenter implements View.OnClickListener {
public void run() { public void run() {
try { try {
Thread.sleep(4000); Thread.sleep(4000);
if (LiveAudienceActivity.mLivePlayViewHolder != null) { if ( LiveAudienceActivity.getmLivePlayViewHolder() != null) {
LiveAudienceActivity.mLivePlayViewHolder.setPkEndview(); LiveAudienceActivity.getmLivePlayViewHolder().setPkEndview();
} }
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -32,8 +32,8 @@ import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.bean.LivePKUserListBean; import com.yunbao.live.bean.LivePKUserListBean;
import com.yunbao.live.custom.ProgressTextView; import com.yunbao.live.custom.ProgressTextView;
import com.yunbao.live.interfaces.ILiveLinkMicViewHolder; import com.yunbao.live.interfaces.ILiveLinkMicViewHolder;
@ -53,7 +53,6 @@ import cn.rongcloud.rtc.api.RCRTCRemoteUser;
import cn.rongcloud.rtc.api.callback.IRCRTCOtherRoomEventsListener; import cn.rongcloud.rtc.api.callback.IRCRTCOtherRoomEventsListener;
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback; import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
import cn.rongcloud.rtc.api.callback.IRCRTCResultDataCallback; import cn.rongcloud.rtc.api.callback.IRCRTCResultDataCallback;
import cn.rongcloud.rtc.api.stream.RCRTCAudioInputStream;
import cn.rongcloud.rtc.api.stream.RCRTCInputStream; import cn.rongcloud.rtc.api.stream.RCRTCInputStream;
import cn.rongcloud.rtc.api.stream.RCRTCVideoInputStream; import cn.rongcloud.rtc.api.stream.RCRTCVideoInputStream;
import cn.rongcloud.rtc.api.stream.RCRTCVideoStreamConfig; import cn.rongcloud.rtc.api.stream.RCRTCVideoStreamConfig;
@ -74,10 +73,10 @@ import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK;
import static com.yunbao.live.activity.LiveRyAnchorActivity.isDRPK; import static com.yunbao.live.activity.LiveRyAnchorActivity.isDRPK;
import static com.yunbao.live.views.AbsRyLivePushViewHolder.mPreView; import static com.yunbao.live.views.AbsRyLivePushViewHolder.mPreView;
import static com.yunbao.live.views.AbsRyLivePushViewHolder.mPreView1; import static com.yunbao.live.views.AbsRyLivePushViewHolder.mPreView1;
import static com.yunbao.live.views.LivePushRyViewHolder.rcrtcLiveInfo;
import static com.yunbao.live.views.LivePushRyViewHolder.rtcRoom;
import static com.yunbao.live.views.LivePushRyViewHolder.contexts; import static com.yunbao.live.views.LivePushRyViewHolder.contexts;
import static com.yunbao.live.views.LivePushRyViewHolder.dr_pk_view; import static com.yunbao.live.views.LivePushRyViewHolder.dr_pk_view;
import static com.yunbao.live.views.LivePushRyViewHolder.rcrtcLiveInfo;
import static com.yunbao.live.views.LivePushRyViewHolder.rtcRoom;
//import cn.rongcloud.rtc.jni.video.RCRect; //import cn.rongcloud.rtc.jni.video.RCRect;
@ -1788,8 +1787,8 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
mLiveLinkMicPkViewHolder = new LiveLinkMicPkViewHolder(mContext, mPkContainer); mLiveLinkMicPkViewHolder = new LiveLinkMicPkViewHolder(mContext, mPkContainer);
mLiveLinkMicPkViewHolder.addToParent(); mLiveLinkMicPkViewHolder.addToParent();
mLiveLinkMicPkViewHolder.setIsAnchor(mIsAnchor); mLiveLinkMicPkViewHolder.setIsAnchor(mIsAnchor);
if (LiveAudienceActivity.mLivePlayViewHolder != null) { if (LiveAudienceActivity.getmLivePlayViewHolder() != null) {
LiveAudienceActivity.mLivePlayViewHolder.setPkview(); LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
} }
} }
@ -1903,8 +1902,8 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
public void run() { public void run() {
// try { // try {
// Thread.sleep(4000); // Thread.sleep(4000);
if (LiveAudienceActivity.mLivePlayViewHolder != null) { if ( LiveAudienceActivity.getmLivePlayViewHolder() != null) {
LiveAudienceActivity.mLivePlayViewHolder.setPkEndview(); LiveAudienceActivity.getmLivePlayViewHolder().setPkEndview();
} }
// } catch (InterruptedException e) { // } catch (InterruptedException e) {
// e.printStackTrace(); // e.printStackTrace();

View File

@ -171,7 +171,7 @@ public class SocketClient {
LiveRoomViewHolder.d_pk_view.setVisibility(View.GONE); LiveRoomViewHolder.d_pk_view.setVisibility(View.GONE);
//創建了多人房間 //創建了多人房間
} else if (action3 == 9) { } else if (action3 == 9) {
LiveAudienceActivity.mLivePlayViewHolder.setPkview(); LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
} }
break; break;
case Constants.SOCKET_ALL_SERVER_NOTIFY://全服通知 case Constants.SOCKET_ALL_SERVER_NOTIFY://全服通知

View File

@ -242,7 +242,7 @@ public class SocketRyClient {
} }
LiveRoomViewHolder.UpPkBar(map.getJSONArray("userlist"), mLiveUid, map.getIntValue("drpk_time")); LiveRoomViewHolder.UpPkBar(map.getJSONArray("userlist"), mLiveUid, map.getIntValue("drpk_time"));
if (LiveRyAnchorActivity.mLivePushViewHolder == null) { if (LiveRyAnchorActivity.mLivePushViewHolder == null) {
LiveAudienceActivity.mLivePlayViewHolder.setPkview(); LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
} }
} else if (action3 == 5) { } else if (action3 == 5) {
@ -256,17 +256,17 @@ public class SocketRyClient {
leaveDRRoom(); leaveDRRoom();
isDRPK = 0; isDRPK = 0;
} else { } else {
LiveAudienceActivity.mLivePlayViewHolder.setPkEndview(); LiveAudienceActivity.getmLivePlayViewHolder().setPkEndview();
} }
//創建了多人房間 //創建了多人房間
} else if (action3 == 3) { } else if (action3 == 3) {
if (LiveAudienceActivity.mLivePlayViewHolder != null) { if ( LiveAudienceActivity.getmLivePlayViewHolder() != null) {
LiveAudienceActivity.mLivePlayViewHolder.setPkview(); LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
} }
isDRPK = 1; isDRPK = 1;
} else if (action3 == 10) { } else if (action3 == 10) {
if (!map.getString("uid").equals(CommonAppConfig.getInstance().getUid())) { if (!map.getString("uid").equals(CommonAppConfig.getInstance().getUid())) {
LiveAudienceActivity.mLivePlayViewHolder.setPkview(); LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
} }
} }

View File

@ -0,0 +1,63 @@
package com.yunbao.live.views;
import android.content.Intent;
import android.content.res.Configuration;
/**
* 该类的方法对应 Activity 的方法
*/
public interface LiveActivityLifeCallback {
/**
* Activity onStart
*/
void onStart();
/**
* Activity onResume
*/
void onResume();
/**
* Activity onPause
*/
void onPause();
/**
* Activity onStop
*/
void onStop();
/**
* Activity onDestroy
*/
void onDestroy();
/**
* Activity onRestart
*/
void onRestart();
/**
* Activity onConfigurationChanged
*/
void onConfigurationChanged(Configuration newConfig);
/**
* Activity onActivityResult
*/
void onActivityResult(int requestCode, int resultCode, Intent data);
/**
* Activity onNewIntent
*/
void onNewIntent(Intent intent);
/**
* Activity onBackPressed
*/
void onBackPressed();
}

View File

@ -116,9 +116,7 @@ public class LiveAddImpressViewHolder extends AbsLivePageViewHolder {
mLinkedList.clear(); mLinkedList.clear();
mGroup.removeAllViews(); mGroup.removeAllViews();
removeFromParent(); removeFromParent();
if (CommonAppConfig.LIVE_ROOM_SCROLL && mContext != null && mContext instanceof LiveAudienceActivity) {
((LiveAudienceActivity) mContext).setScrollFrozen(false);
}
} }
private void initData() { private void initData() {
@ -151,9 +149,7 @@ public class LiveAddImpressViewHolder extends AbsLivePageViewHolder {
line++; line++;
mGroup.addView(linearLayout); mGroup.addView(linearLayout);
} }
if (CommonAppConfig.LIVE_ROOM_SCROLL && mContext != null && mContext instanceof LiveAudienceActivity) {
((LiveAudienceActivity) mContext).setScrollFrozen(true);
}
} }
} }
}); });

View File

@ -109,8 +109,6 @@ public class LiveContributeViewHolder extends AbsLivePageViewHolder implements V
@Override @Override
public void onHide() { public void onHide() {
if (CommonAppConfig.LIVE_ROOM_SCROLL && mContext != null && mContext instanceof LiveAudienceActivity) {
((LiveAudienceActivity) mContext).setScrollFrozen(false);
}
} }
} }

View File

@ -108,8 +108,6 @@ public class LiveMedalRankViewHolder extends AbsLivePageViewHolder implements Vi
@Override @Override
public void onHide() { public void onHide() {
if (CommonAppConfig.LIVE_ROOM_SCROLL && mContext != null && mContext instanceof LiveAudienceActivity) {
((LiveAudienceActivity) mContext).setScrollFrozen(false);
}
} }
} }

View File

@ -0,0 +1,27 @@
package com.yunbao.live.views;
import android.view.ViewGroup;
import com.yunbao.live.bean.LiveBean;
public interface LivePlayListener extends LiveActivityLifeCallback {
/**
* 用户滑动显示该页面
*
* @param data 房间信息
*/
void onAdd(LiveBean data, int liveType, int liveTypeVal, int liveSdk);
/**
* 用户滑动移除该页面
*/
void onRemove();
/**
* @return 页面的根布局 View
*/
ViewGroup getRootView();
}

View File

@ -1,6 +1,5 @@
package com.yunbao.live.views; package com.yunbao.live.views;
import android.Manifest;
import android.app.Dialog; import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.media.AudioManager; import android.media.AudioManager;
@ -14,17 +13,12 @@ import android.view.ViewGroup;
import android.view.ViewParent; import android.view.ViewParent;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.tencent.live2.V2TXLiveDef; import com.tencent.live2.V2TXLiveDef;
import com.tencent.live2.V2TXLivePlayer; import com.tencent.live2.V2TXLivePlayer;
import com.tencent.live2.impl.V2TXLivePlayerImpl; import com.tencent.live2.impl.V2TXLivePlayerImpl;
import com.tencent.rtmp.ui.TXCloudVideoView; import com.tencent.rtmp.ui.TXCloudVideoView;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient; import com.yunbao.common.http.HttpClient;
@ -36,8 +30,6 @@ import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.presenter.LiveRyLinkMicPkPresenter;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
@ -47,8 +39,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import cn.rongcloud.rtc.api.RCRTCEngine; import cn.rongcloud.rtc.api.RCRTCEngine;
import cn.rongcloud.rtc.api.RCRTCMixConfig;
import cn.rongcloud.rtc.api.RCRTCOtherRoom;
import cn.rongcloud.rtc.api.RCRTCRemoteUser; import cn.rongcloud.rtc.api.RCRTCRemoteUser;
import cn.rongcloud.rtc.api.RCRTCRoom; import cn.rongcloud.rtc.api.RCRTCRoom;
import cn.rongcloud.rtc.api.RCRTCRoomConfig; import cn.rongcloud.rtc.api.RCRTCRoomConfig;
@ -57,7 +47,6 @@ import cn.rongcloud.rtc.api.callback.IRCRTCResultDataCallback;
import cn.rongcloud.rtc.api.callback.IRCRTCRoomEventsListener; import cn.rongcloud.rtc.api.callback.IRCRTCRoomEventsListener;
import cn.rongcloud.rtc.api.callback.IRCRTCSwitchRoleCallback; import cn.rongcloud.rtc.api.callback.IRCRTCSwitchRoleCallback;
import cn.rongcloud.rtc.api.callback.IRCRTCSwitchRoleDataCallback; import cn.rongcloud.rtc.api.callback.IRCRTCSwitchRoleDataCallback;
import cn.rongcloud.rtc.api.stream.RCRTCCDNInputStream;
import cn.rongcloud.rtc.api.stream.RCRTCInputStream; import cn.rongcloud.rtc.api.stream.RCRTCInputStream;
import cn.rongcloud.rtc.api.stream.RCRTCLiveInfo; import cn.rongcloud.rtc.api.stream.RCRTCLiveInfo;
import cn.rongcloud.rtc.api.stream.RCRTCOutputStream; import cn.rongcloud.rtc.api.stream.RCRTCOutputStream;
@ -69,20 +58,9 @@ import cn.rongcloud.rtc.base.RCRTCMediaType;
import cn.rongcloud.rtc.base.RCRTCParamsType; import cn.rongcloud.rtc.base.RCRTCParamsType;
import cn.rongcloud.rtc.base.RCRTCRoomType; import cn.rongcloud.rtc.base.RCRTCRoomType;
import cn.rongcloud.rtc.base.RTCErrorCode; import cn.rongcloud.rtc.base.RTCErrorCode;
import cn.rongcloud.rtc.core.RendererCommon;
import cn.rongcloud.rtc.plugin.player.IPlayerPrepareListener;
import static cn.rongcloud.rtc.core.RendererCommon.ScalingType.SCALE_ASPECT_FILL; import static cn.rongcloud.rtc.core.RendererCommon.ScalingType.SCALE_ASPECT_FILL;
import static com.lzy.okgo.utils.HttpUtils.runOnUiThread; import static com.lzy.okgo.utils.HttpUtils.runOnUiThread;
import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK;
import static com.yunbao.live.activity.LiveActivity.mLiveRyLinkMicPkPresenter;
import static com.yunbao.live.activity.LiveRyAnchorActivity.mLivePushViewHolder;
import static com.yunbao.live.presenter.LiveRyLinkMicPkPresenter.leaveDRRoom;
import static com.yunbao.live.views.AbsRyLivePushViewHolder.mPreView;
import static com.yunbao.live.views.LivePushRyViewHolder.contexts;
import static com.yunbao.live.views.LivePushRyViewHolder.dr_pk_view;
import static com.yunbao.live.views.LivePushRyViewHolder.rcrtcLiveInfo;
import static com.yunbao.live.views.LivePushRyViewHolder.rtcRoom;
public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
@ -118,6 +96,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
public static int Micing = 0; public static int Micing = 0;
RCRTCRoom rcrtcRoom; RCRTCRoom rcrtcRoom;
String purl; String purl;
public LivePlayRyViewHolder(Context context, ViewGroup parentView, int landscapes) { public LivePlayRyViewHolder(Context context, ViewGroup parentView, int landscapes) {
super(context, parentView); super(context, parentView);
contexts = context; contexts = context;
@ -223,7 +202,9 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
public void release() { public void release() {
mEnd = true; mEnd = true;
mStarted = false; mStarted = false;
if (mPlayer != null) {
mPlayer.stopPlay(); mPlayer.stopPlay();
}
L.e(TAG, "release------->"); L.e(TAG, "release------->");
} }
@ -483,7 +464,8 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
rcrtcRoom = null; rcrtcRoom = null;
Micing = 0; Micing = 0;
ToastUtil.show("已成功退出語音連麥"); ToastUtil.show("已成功退出語音連麥");
}}); }
});
} }
@Override @Override

View File

@ -104,7 +104,6 @@ import pl.droidsonroids.gif.GifImageView;
import static com.yunbao.common.CommonAppContext.logger; import static com.yunbao.common.CommonAppContext.logger;
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics; import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
import static com.yunbao.live.activity.LiveAudienceActivity.countDownTimer;
/** /**
* Created by cxf on 2018/10/9. * Created by cxf on 2018/10/9.
@ -1200,8 +1199,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} else if (i == R.id.btn_follow) { } else if (i == R.id.btn_follow) {
follow(); follow();
if (countDownTimer != null) { if (((LiveAudienceActivity) mContext).getCountDownTimer() != null) {
countDownTimer.cancel(); ((LiveAudienceActivity) mContext).getCountDownTimer().cancel();
} }
} else if (i == R.id.view_medal) { } else if (i == R.id.view_medal) {
//点击粉丝勋章, 弹窗 开通粉丝勋章 //点击粉丝勋章, 弹窗 开通粉丝勋章
@ -1255,8 +1254,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
if (TextUtils.isEmpty(mLiveUid)) { if (TextUtils.isEmpty(mLiveUid)) {
return; return;
} }
if (countDownTimer != null) { if (((LiveAudienceActivity) Contexts).getCountDownTimer() != null) {
countDownTimer.cancel(); ((LiveAudienceActivity) Contexts).getCountDownTimer().cancel();
} }
CommonHttpUtil.setAttention(mLiveUid, new CommonCallback<Integer>() { CommonHttpUtil.setAttention(mLiveUid, new CommonCallback<Integer>() {
@Override @Override
@ -1292,7 +1291,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
dialog.findViewById(R.id.btn_confirm).setOnClickListener(new View.OnClickListener() { dialog.findViewById(R.id.btn_confirm).setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
LiveAudienceActivity.backIndex = 1; ((LiveAudienceActivity) context).setBackIndex(1);
((LiveAudienceActivity) context).onBackPressed(); ((LiveAudienceActivity) context).onBackPressed();
follow(); follow();
} }
@ -1300,7 +1299,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
dialog.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() { dialog.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
LiveAudienceActivity.backIndex = 1; ((LiveAudienceActivity) context).setBackIndex(1);
((LiveAudienceActivity) context).onBackPressed(); ((LiveAudienceActivity) context).onBackPressed();
} }
}); });
@ -1318,15 +1317,15 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
if (isStayRoomfive) { if (isStayRoomfive) {
showFollowDialog(mNameText, mAvatarUrl, mContext); showFollowDialog(mNameText, mAvatarUrl, mContext);
} else { } else {
LiveAudienceActivity.backIndex = 1; ((LiveAudienceActivity) mContext).setBackIndex(1);
((LiveAudienceActivity) mContext).onBackPressed(); ((LiveAudienceActivity) mContext).onBackPressed();
} }
} else { } else {
LiveAudienceActivity.backIndex = 1; ((LiveAudienceActivity) mContext).setBackIndex(1);
((LiveAudienceActivity) mContext).onBackPressed(); ((LiveAudienceActivity) mContext).onBackPressed();
} }
} else { } else {
LiveAudienceActivity.backIndex = 1; ((LiveAudienceActivity) mContext).setBackIndex(1);
((LiveAnchorActivity) mContext).onBackPressed(); ((LiveAnchorActivity) mContext).onBackPressed();
} }
} else { } else {

View File

@ -112,8 +112,6 @@ public class LiveWebViewHolder extends AbsLivePageViewHolder implements View.OnC
@Override @Override
public void onHide() { public void onHide() {
if (CommonAppConfig.LIVE_ROOM_SCROLL && mContext != null && mContext instanceof LiveAudienceActivity) {
((LiveAudienceActivity) mContext).setScrollFrozen(false);
}
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -138,8 +138,6 @@ public class TurnTableWebViewHolder extends AbsLivePageViewHolder implements Vie
@Override @Override
public void onHide() { public void onHide() {
if (CommonAppConfig.LIVE_ROOM_SCROLL && mContext != null && mContext instanceof LiveAudienceActivity) {
((LiveAudienceActivity) mContext).setScrollFrozen(false);
}
} }
} }

View File

@ -177,8 +177,6 @@ public class WishlistWebViewHolder extends AbsLivePageViewHolder implements View
@Override @Override
public void onHide() { public void onHide() {
if (CommonAppConfig.LIVE_ROOM_SCROLL && mContext != null && mContext instanceof LiveAudienceActivity) {
((LiveAudienceActivity) mContext).setScrollFrozen(false);
}
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@drawable/img_loading_01"
android:duration="350" />
<item
android:drawable="@drawable/img_loading_02"
android:duration="350" />
<item
android:drawable="@drawable/img_loading_03"
android:duration="350" />
</animation-list>

View File

@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" <com.yunbao.common.views.weight.MyDrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout" android:id="@+id/drawer_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@ -79,9 +80,8 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:paddingStart="8dp" android:paddingStart="8dp"
android:paddingEnd="8dp"
android:paddingTop="56dp" android:paddingTop="56dp"
> android:paddingEnd="8dp">
<com.ms.banner.Banner <com.ms.banner.Banner
android:id="@+id/banner" android:id="@+id/banner"
@ -113,4 +113,4 @@
</FrameLayout> </FrameLayout>
</androidx.drawerlayout.widget.DrawerLayout> </com.yunbao.common.views.weight.MyDrawerLayout>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.yunbao.common.views.weight.VerticalViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never" />
</RelativeLayout>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@mipmap/live_bg" />
<ImageView
android:id="@+id/iv_loading"
android:layout_width="50dp"
android:layout_height="10dp"
android:layout_centerInParent="true"
android:background="@drawable/loading_animation" />
</RelativeLayout>

View File

@ -126,9 +126,10 @@ import cn.rongcloud.rtc.api.RCRTCEngine;
import io.reactivex.Observer; import io.reactivex.Observer;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
import io.rong.imlib.RongIMClient; import io.rong.imlib.RongIMClient;
import kotlin.Unit;
import static com.yunbao.common.CommonAppContext.isReady; import static com.yunbao.common.CommonAppContext.isReady;
import kotlin.*;
@Route(path = RouteUtil.PATH_MAIN) @Route(path = RouteUtil.PATH_MAIN)
public class MainActivity extends AbsActivity implements MainAppBarLayoutListener { public class MainActivity extends AbsActivity implements MainAppBarLayoutListener {
@ -673,7 +674,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if (info.length > 0) { if (info.length > 0) {
Log.e("MainActivity", info[0]);
JSONObject obj = JSON.parseObject(info[0]); JSONObject obj = JSON.parseObject(info[0]);
if (code == 0) { if (code == 0) {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
@ -683,7 +683,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
fragment.setArguments(bundle); fragment.setArguments(bundle);
fragment.show(getSupportFragmentManager(), "SigninDialog"); fragment.show(getSupportFragmentManager(), "SigninDialog");
} }
if (obj.containsKey("msg_zdy_send") && obj.containsKey("msg_zdy_send_text")) { if (obj != null && obj.containsKey("msg_zdy_send") && obj.containsKey("msg_zdy_send_text")) {
Log.e("MainActivity333", info[0]); Log.e("MainActivity333", info[0]);
NoviceInstructorManager.get(mContext).getNetNoviceInstructor(info[0]); NoviceInstructorManager.get(mContext).getNetNoviceInstructor(info[0]);
} }