queue: remove no position check
Remove the check for NO_POSITION when doing scrolling. An empty list implies that we should probably scroll to the proper item when we add data.
This commit is contained in:
parent
fa06732e94
commit
c888035cbd
2 changed files with 2 additions and 4 deletions
|
@ -12,7 +12,7 @@ android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId namespace
|
applicationId namespace
|
||||||
versionName "2.5.0"
|
versionName "2.5.0"
|
||||||
versionCode 19
|
versionCode 18
|
||||||
|
|
||||||
minSdk 21
|
minSdk 21
|
||||||
// API 33 is still busted, waiting until the XML element issue is fixed
|
// API 33 is still busted, waiting until the XML element issue is fixed
|
||||||
|
|
|
@ -96,9 +96,7 @@ class QueueFragment : ViewBindingFragment<FragmentQueueBinding>(), QueueItemList
|
||||||
val start = lmm.findFirstCompletelyVisibleItemPosition()
|
val start = lmm.findFirstCompletelyVisibleItemPosition()
|
||||||
val end = lmm.findLastCompletelyVisibleItemPosition()
|
val end = lmm.findLastCompletelyVisibleItemPosition()
|
||||||
|
|
||||||
if (start != RecyclerView.NO_POSITION &&
|
if (scrollTo !in start..end) {
|
||||||
end != RecyclerView.NO_POSITION &&
|
|
||||||
scrollTo !in start..end) {
|
|
||||||
logD("Scrolling to new position")
|
logD("Scrolling to new position")
|
||||||
binding.queueRecycler.scrollToPosition(scrollTo)
|
binding.queueRecycler.scrollToPosition(scrollTo)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue