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

PopupTextProvider in FastScrollNestedScrollView #27

Closed tosam144 closed 4 years ago

tosam144 commented 4 years ago

I would like to know how I can implement PopupTextProvider in FastScrollNestedScrollView? The direct child of FastScrollNestedScrollView is a LinearLayout, which contains some TextViews and also a nested RecyclerView (with android:isScrollContainer="false"). I tried to use

new FastScrollerBuilder(mNestedScrollView).setPopupTextProvider(position -> "some text").build();

But the code "some text" is never called. Any ideas?

zhanghai commented 4 years ago

Yes, the bundled ViewHelper implementation FastScrollNestedScrollView.SimpleViewHelper doesn't implement ViewHelper.getPopupText(), because it has no idea of when to show what text. You can implement your own ViewHelper along with ViewHelper.getPopupText() if you know how the scroll position should correspond to popup text in your own app's logic.