修改通用链接详情刷新过程中滑动列表闪退问题

This commit is contained in:
jack
2021-09-27 17:21:35 +08:00
parent 806b3ac77e
commit de274f0954

View File

@ -76,7 +76,8 @@ class CommonCollectionDetailFragment : LazyListFragment<LinkEntity, CommonCollec
if (newState == RecyclerView.SCROLL_STATE_IDLE) {
val commonLinkCollection = mViewModel.commonCollectionLiveData.value
var position = mLayoutManager.findLastCompletelyVisibleItemPosition()
if (position == -1) position = mLayoutManager.findLastVisibleItemPosition() - 1
if (position < 0) position = mLayoutManager.findLastVisibleItemPosition() - 1
if (position < 0 || position >= commonLinkCollection?.linkList?.size ?: 0) return
val linkEntity = commonLinkCollection?.linkList?.get(position)
NewLogUtils.logSlideCommonCollection(
commonLinkCollection?.id ?: "",