Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to apply fast scroll in recycler view at android sdk 26 ?

$
0
0

Now Android support fast scroll at RecyclerView on Android SDK 26

Of all the great advantages RecyclerView has over ListView, one feature that I miss a lot is fast scrolling where you could drag a thumb drawable and scroll around the list. In ListView you could do the following

listView = (ListView) findViewById(R.id.listView);
listView.setFastScrollEnabled(true);

And In RecyclerView you could do the following (Android xml)

<android.support.v7.widget.RecyclerView
    android:id="@+id/recyclerView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:fastScrollEnabled="true"
    app:fastScrollHorizontalThumbDrawable="@drawable/thumb_drawable"
    app:fastScrollHorizontalTrackDrawable="@drawable/line_drawable"
    app:fastScrollVerticalThumbDrawable="@drawable/thumb_drawable"
    app:fastScrollVerticalTrackDrawable="@drawable/line_drawable">

I want to apply in android custom renderer
like this

protected override void OnElementChanged(ElementChangedEventArgs e)
{
base.OnElementChanged(e);

   if (Control == null) return;

   element = Element as CustomRadListView;
   element.ScrollToRequested += Element_ScrollToRequested;

   control = Control.ListView;
   control.Touch += Control_Touch;
   control.ScrollChange += Control_ScrollChange;

   // Apply fast scroll in recycler view
   // control type is RecyclerView
   // error : FastScrollEnabled is not defined at RecyclerView
   control.FastScrollEnabled = true

}

What can I do ?? :disappointed:


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>