seniorsetr.blogg.se

Smoothscroll to bottom android
Smoothscroll to bottom android










smoothscroll to bottom android

public class CustomLayoutManager : LinearLayoutManager Here is the related code, you could refer to it. Then custom a custom LinearLayoutManager class and pass the custom scroller to the manager. To customize the speed of SmoothScrollToPosition command, try creating a custom LinearSmoothScroller class to rewrite the CalculateSpeedPerPixel method to define the value fo the speed.

smoothscroll to bottom android

The way I'd like to do it is to control the scroll speed as the scrolling is taking place - that way I could just do one SmoothScrollToPosition to the bottom But as I understand it the method CalculateSpeedPerPixel only gets called once for each use of the SmoothScroller and the value cached - so the value it gives can't be changed 'on the fly'. The way I'd like to do it is to control the scroll speed as the scrolling is taking place - that way I could just do one SmoothScrollToPosition to the bottom (with speed set to very slow) and speed it up as the tilt got steeper. I've tried a couple of things to fix it suppressing the images (for which I use Glide), and invoking GetExtraLayoutSpace in the LayoutManager, but no luck. That works pretty well except that at slow speeds there is a noticeable pause whenever a new image appears on screen. I want it to scroll that list by tilting the phone, and so far I achieve this by using ScrollBy on a timer - every 20MS it scrolls a variable number of pixels depending on how steep the tilt is.

#SMOOTHSCROLL TO BOTTOM ANDROID ANDROID#

The Android app I'm writing (Xamarin, Visual Studio 2019) displays gallery pictures in a recyclerview. (Apologies for the length of this question!)












Smoothscroll to bottom android