zhanghai / AndroidFastScroll

Fast scroll for Android RecyclerView and more
https://play.google.com/store/apps/details?id=me.zhanghai.android.fastscroll.sample
Apache License 2.0
703 stars 64 forks source link

Expose methods to adjust mMinTouchTargetSize in FastScroller #55

Closed Diman96 closed 1 year ago

Diman96 commented 1 year ago

Hello, I noticed that the FastScroller class in your library does not provide getter and setter methods to modify the mMinTouchTargetSize property. Moreover, it is not possible to set this value through the constructor. By default, the value is set to 48dp (<dimen name="afs_min_touch_target_size">48dp</dimen>), which may not work correctly for different screen sizes and densities.

It would be beneficial to expose methods to adjust the mMinTouchTargetSize property, allowing developers to fine-tune this value for their specific use cases and ensure a better user experience across various devices.

Possible solution:

  1. Add getter and setter methods for mMinTouchTargetSize in the FastScroller class.
  2. Alternatively, allow passing this value through the constructor or FastScrollerBuilder class.

This improvement would provide better customization options and ensure the library's adaptability to different screen configurations.

Thank you for your attention to this issue, and I appreciate your work on this library.

Diman96 commented 1 year ago

Any updates ? @h6ah4i @zhanghai @drakeet

zhanghai commented 1 year ago

You can override library resources in your app by creating the same afs_min_touch_target_size again in your XML code, with your desired value.

Theoretically this is an accessibility requirement that shouldn't be modified, and MaterialComponents did it in the same way, so I'm not going to expose a dedicated Java API for it.