override fun getRefreshKey(state: PagingState<Int, UiItem>): Int? {
val anchor = state.anchorPosition ?: return null
val closestItem = state.closestItemAroundPosition(
anchorPosition = anchor,
// например, пропускаем разделители/заглушки
predicate = { it.isAnchorable }
)
return closestItem?.id
}#Android #AndroidX