直播间的滚动修复直播间聊天问题

This commit is contained in:
18401019693 2022-08-22 15:10:52 +08:00
parent 42a0440e6f
commit 318a3dcf8c

View File

@ -215,6 +215,22 @@ public class LiveAudienceActivity extends LiveActivity {
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
mCurrentItem = position; mCurrentItem = position;
Log.e(TAG, "mCurrentItem:" + mCurrentItem); Log.e(TAG, "mCurrentItem:" + mCurrentItem);
if (mCurrentItem == itemModelList.size() - 1) {
MainNetManager.get(mContext)
.anchorRecommend("30", new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
@Override
public void onSuccess(AnchorRecommendModel data) {
itemModelList.addAll(data.getList());
mPagerAdapter.notifyDataSetChanged();
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
}
} }
@Override @Override
@ -281,7 +297,7 @@ public class LiveAudienceActivity extends LiveActivity {
mLiveUid = mLiveBean.getUid(); mLiveUid = mLiveBean.getUid();
mStream = mLiveBean.getStream(); mStream = mLiveBean.getStream();
mAncherName = liveBean.getUserNiceName(); mAncherName = liveBean.getUserNiceName();
Log.e("收到socket--->","mLiveUid--------------------------->"+mLiveUid); Log.e("收到socket--->", "mLiveUid--------------------------->" + mLiveUid);
//加载当前页面数据 //加载当前页面数据
View rootView = manager.getRootView(); View rootView = manager.getRootView();
if (rootView.getParent() != null && rootView.getParent() instanceof ViewGroup) { if (rootView.getParent() != null && rootView.getParent() instanceof ViewGroup) {