Scroll coordinates in the cycle view

Asked 2 years ago, Updated 2 years ago, 19 views

Hi, how are you?

You are currently trying to resize the toolbar with the scroll coordinates of the cycle view.

I'd like to get the Y coordinates of the recycling view here Once you added dy in onScrolled, you were able to get the value that you moved.

But if you move the scroll quickly, Not 10 -> 9 -> 8 -> 7 -> 6 -> 5 It's going to be 10 ->

The price that I want to bring from here is If you scroll, regardless of speed

I want to import them in order of 10 -> 9 -> 8 -> 7 -> 6 -> 5. Is there any way?

android

2022-09-22 10:34

1 Answers

As you mentioned, the value moved during scrolling is not returned sequentially. This is something that can be seen in common in all views that are scrolling as well as in the Recycler view. Is the reason why sequential values are needed to smoothly adjust the size of the toolbar? If that's the case, I think it's a more common approach to find a way to naturally adjust the size of the toolbar, even if there's no intermediate value.

Alternatively, look at the Coordinator Layout and Appbar sections at the following link. If the scrolling technique in that section and the UI you are currently trying to implement are similar, you can also use the design library provided by Android.


2022-09-22 10:34

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.