优化直播间聊天消息动画效果
This commit is contained in:
parent
2c6e88500a
commit
cae0599307
@ -127,7 +127,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
|||||||
@Override
|
@Override
|
||||||
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
||||||
super.onScrolled(recyclerView, dx, dy);
|
super.onScrolled(recyclerView, dx, dy);
|
||||||
if(isSlideToBottom(recyclerView))return;
|
if (isSlideToBottom(recyclerView)) return;
|
||||||
mRecyclerViewScrolledDy = dy;
|
mRecyclerViewScrolledDy = dy;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -390,7 +390,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
|||||||
}
|
}
|
||||||
mList.add(bean);
|
mList.add(bean);
|
||||||
if (isSlideToBottom(mRecyclerView) || mRecyclerViewScrolledDy == 0) {
|
if (isSlideToBottom(mRecyclerView) || mRecyclerViewScrolledDy == 0) {
|
||||||
scrollToBottom(mRecyclerView);
|
scrollToBottom();
|
||||||
} else {
|
} else {
|
||||||
Bus.get().post(new LiveAudienceEvent()
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
.setType(LiveAudienceEvent.LiveAudienceType.NEW_MESSAGE_REMINDER));
|
.setType(LiveAudienceEvent.LiveAudienceType.NEW_MESSAGE_REMINDER));
|
||||||
@ -401,7 +401,11 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
|||||||
mPosition = size;
|
mPosition = size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
notifyDataSetChanged();
|
if (getItemCount() == 1) {
|
||||||
|
notifyDataSetChanged();
|
||||||
|
} else {
|
||||||
|
notifyItemInserted(getItemCount());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user