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:
+1
-1
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user