修复手机开播Pk界面问题,直播间聊天滚动至底部优化
This commit is contained in:
@@ -320,9 +320,9 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
||||
|
||||
} else if (bean.getType() == -2) {//自动消息,点击发言
|
||||
|
||||
mBg.setBackgroundResource(R.drawable.bg_chat_automatic_item);
|
||||
mTextView.setText(R.string.automatic_chat);
|
||||
bean.setHeart(position);
|
||||
mBg.setBackgroundResource(R.drawable.bg_chat_automatic_item);
|
||||
mTextView.setText(R.string.automatic_chat);
|
||||
bean.setHeart(position);
|
||||
} else if (bean.getType() == MSG_HOUR_RANK_CHANGE) {
|
||||
mBg.setBackgroundResource(R.drawable.bg_chat_automatic_item);
|
||||
mTextView.setText(bean.getContent());
|
||||
@@ -381,7 +381,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
||||
mList.add(bean);
|
||||
|
||||
if (isSlideToBottom(mRecyclerView)) {
|
||||
mRecyclerView.smoothScrollToPosition(getItemCount() - 1);
|
||||
scrollToBottom(mRecyclerView);
|
||||
} else {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.NEW_MESSAGE_REMINDER));
|
||||
@@ -396,6 +396,19 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
||||
|
||||
}
|
||||
|
||||
private void scrollToBottom(final RecyclerView recyclerView) {
|
||||
// scroll to last item to get the view of last item
|
||||
final LinearLayoutManager layoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();
|
||||
final int lastItemPosition = getItemCount() - 1;
|
||||
recyclerView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
layoutManager.scrollToPositionWithOffset(lastItemPosition, Integer.MIN_VALUE);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否滚到底部
|
||||
*
|
||||
|
||||
@@ -185,6 +185,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
|
||||
private View loading;
|
||||
|
||||
private int landscape;
|
||||
|
||||
public PortraitLiveManager setQuitF(boolean quitF) {
|
||||
isQuitF = quitF;
|
||||
return this;
|
||||
@@ -341,7 +343,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
.enterRoomNew(mLiveBean.getStream(), mLiveBean.getUid(), mLiveBean.getCity(), new com.yunbao.common.http.base.HttpCallback<EnterRoomNewModel>() {
|
||||
@Override
|
||||
public void onSuccess(EnterRoomNewModel data) {
|
||||
mLivePlayViewHolder.setLiveBeanLandscape(data.getLiveInfo().getLandscape());
|
||||
landscape = data.getLiveInfo().getLandscape();
|
||||
mLivePlayViewHolder.setLiveBeanLandscape(landscape);
|
||||
//是否热度卡加成
|
||||
liveHandler.postDelayed(() -> mLiveRoomViewHolder.getIsHot(data.getIsUseHotCard()), 700);
|
||||
|
||||
@@ -1228,6 +1231,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
}, 4000);//3秒后执行Runnable中的run方法
|
||||
|
||||
}
|
||||
if (mLivePlayViewHolder!=null){
|
||||
mLivePlayViewHolder.setLiveBeanLandscape(1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1239,6 +1245,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
mLiveRoomViewHolder.resetViewGone();
|
||||
}
|
||||
}
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLivePlayViewHolder.setLiveBeanLandscape(landscape);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1262,6 +1271,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
mLiveRyLinkMicPkPresenter.onLinkMicPkEnd(winUid);
|
||||
mLiveRoomViewHolder.setDelOtherInfo();
|
||||
}
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLivePlayViewHolder.setLiveBeanLandscape(landscape);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user