修复:
直播间滑动导致画面卡顿问题
This commit is contained in:
parent
11854ba95a
commit
afc60eddfc
@ -109,6 +109,8 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
|
||||
private ViewGroup mViewGroup;
|
||||
private int liveBg = 0;
|
||||
//直播间进入房间队列
|
||||
private Handler liveHandler = new Handler();
|
||||
|
||||
|
||||
@Override
|
||||
@ -246,14 +248,28 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
|
||||
private void loadData(ViewGroup viewGroup, int currentItem) {
|
||||
mViewGroup = viewGroup;
|
||||
AnchorRecommendItemModel data = itemModelList.get(mCurrentPage);
|
||||
|
||||
//获取直播间状态
|
||||
LiveHttpUtil.getLiveInfo(data.getUid(), liveInfo);
|
||||
mLastPosition = currentItem;
|
||||
liveHandler.removeCallbacks(liveRunnable);
|
||||
if (mCurrentPage > 0) {
|
||||
liveHandler.postDelayed(liveRunnable, 800);
|
||||
} else {
|
||||
liveHandler.post(liveRunnable);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Runnable liveRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
AnchorRecommendItemModel data = itemModelList.get(mCurrentPage);
|
||||
|
||||
//获取直播间状态
|
||||
LiveHttpUtil.getLiveInfo(data.getUid(), liveInfo);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取直播间状态
|
||||
*/
|
||||
|
@ -61,6 +61,7 @@ import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
@ -1082,7 +1083,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
ViewFlipper flipper = (ViewFlipper) findViewById(R.id.hour_rank_list);
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(44), DpUtil.dp2px(16));
|
||||
LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
textParams.leftMargin=DpUtil.dp2px(5);
|
||||
textParams.leftMargin = DpUtil.dp2px(5);
|
||||
API.get().pdLiveApi(mContext).getHourChartRank(mLiveUid)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
@ -2355,7 +2356,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
if (fastMsgRecyclerView == null) return;
|
||||
RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams)
|
||||
fastMsgRecyclerView.getLayoutParams();
|
||||
params1.rightMargin = 400;
|
||||
params1.rightMargin = DeviceUtils.getScreenWidth((Activity) mContext) / 3;
|
||||
fastMsgRecyclerView.setLayoutParams(params1);
|
||||
} else if ("stop_svga_new_user_gif".equals(str)) {
|
||||
if (fastMsgRecyclerView == null) return;
|
||||
|
@ -83,6 +83,7 @@ import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import cn.rongcloud.rtc.api.RCRTCEngine;
|
||||
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
|
||||
@ -166,6 +167,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
private LiveImDeletUtil liveImDeletUtil;
|
||||
private List<String> greetings = new ArrayList<>();
|
||||
|
||||
|
||||
public PortraitLiveManager(Activity context, Intent intent) {
|
||||
this.mContext = context;
|
||||
this.mIntent = intent;
|
||||
@ -273,7 +275,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
|
||||
@Override
|
||||
public void onRemove() {
|
||||
end();
|
||||
endPlay();
|
||||
Executors.newCachedThreadPool().execute(() -> end());
|
||||
if (mLiveAudienceViewHolder != null) {
|
||||
mLiveAudienceViewHolder.removeFromParent();
|
||||
mLiveAudienceViewHolder.countDownTimerTrickery = null;
|
||||
@ -545,6 +548,11 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
|
||||
@Override
|
||||
public void onChat(LiveChatBean bean, int index) {
|
||||
if (bean.getType() == 1) {
|
||||
if (!bean.getContent().contains(mLiveBean.getUserNiceName())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.insertChat(bean, index);
|
||||
}
|
||||
@ -1355,7 +1363,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
Log.i("tx", "退出失败");
|
||||
}
|
||||
});
|
||||
endPlay();
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -1457,4 +1465,5 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user