recycler: fix fast scroll issues
Fix issues with the fast scroller, such as an improper thumb position and strange item behavior stemming from dataset changes.
This commit is contained in:
parent
a8e6ccf031
commit
8a70ece442
6 changed files with 10 additions and 5 deletions
|
@ -291,7 +291,7 @@ constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr
|
|||
}
|
||||
|
||||
private fun updateScrollbarState() {
|
||||
if (computeVerticalScrollRange() <= height || childCount == 0) {
|
||||
if (scrollRange <= height || childCount == 0) {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
5
app/src/main/res/drawable/ui_item_ripple.xml
Normal file
5
app/src/main/res/drawable/ui_item_ripple.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="?attr/colorSurface" />
|
||||
<item android:drawable="?attr/selectableItemBackground" />
|
||||
</layer-list>
|
|
@ -5,7 +5,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:background="@drawable/ui_item_ripple"
|
||||
android:paddingTop="@dimen/spacing_medium"
|
||||
android:paddingBottom="@dimen/spacing_medium"
|
||||
android:paddingEnd="@dimen/spacing_mid_medium"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:background="@drawable/ui_item_ripple"
|
||||
android:paddingTop="@dimen/spacing_medium"
|
||||
android:paddingBottom="@dimen/spacing_medium"
|
||||
android:paddingEnd="@dimen/spacing_mid_medium"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:background="@drawable/ui_item_ripple"
|
||||
android:paddingTop="@dimen/spacing_medium"
|
||||
android:paddingBottom="@dimen/spacing_medium"
|
||||
android:paddingEnd="@dimen/spacing_mid_medium"
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<dimen name="fast_scroll_popup_min_height">64dp</dimen>
|
||||
<dimen name="fast_scroll_popup_padding_start">@dimen/spacing_medium</dimen>
|
||||
<dimen name="fast_scroll_popup_padding_end">28dp</dimen>
|
||||
<dimen name="fast_scroll_thumb_touch_target_size">16dp</dimen>
|
||||
<dimen name="fast_scroll_thumb_touch_target_size">48dp</dimen>
|
||||
|
||||
<dimen name="slider_thumb_radius">6dp</dimen>
|
||||
|
||||
|
|
Loading…
Reference in a new issue