Stop RecyclerView momentum on fast scroll
Prevent any unnessecary scrolling when using the fast scroll bar in SongsFragment.
This commit is contained in:
parent
299c47e9c3
commit
8c107d66a0
2 changed files with 6 additions and 4 deletions
|
@ -52,7 +52,6 @@ class MainActivity : AppCompatActivity() {
|
|||
// Since the activity is set to singleInstance [Given that there's only MainActivity]
|
||||
// We have to manually push the intent whenever we get one so that the fragments
|
||||
// can catch any file intents
|
||||
// TODO: If possible try to make this system completely
|
||||
setIntent(intent)
|
||||
}
|
||||
|
||||
|
|
|
@ -179,10 +179,13 @@ class SongsFragment : Fragment() {
|
|||
indicatorCenterY: Int,
|
||||
itemPosition: Int
|
||||
) {
|
||||
val layoutManager = binding.songRecycler.layoutManager
|
||||
as LinearLayoutManager
|
||||
binding.songRecycler.apply {
|
||||
(layoutManager as LinearLayoutManager).scrollToPositionWithOffset(
|
||||
itemPosition, 0
|
||||
)
|
||||
|
||||
layoutManager.scrollToPositionWithOffset(itemPosition, 0)
|
||||
stopScroll()
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue