Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scroll a View before ListView like lollipop phone app

I have a layout with a linearLayout (top layout) and a listview under this. What I want to do is like the phone app in Lollipop:

  • With the scrollbar I can scroll the contact list (top layout doesn't move)

  • When scroll the list with the finger, first the top layout is scrolling and once it is not visible anymore the listview scroll. When the top layout is visible the scrollbar doesn't move.

Someone has any idea how to do this trick?

What I'm thinking :

  • I can add the top layout to the header of listview, but the scrollbar take count of the header. And if I scroll with the scrollbar, the top layout will scroll

    • Trying to set a scrollListener to the listview, and translate the top view, but don't think it will be good and the scrollY is not available for listView

I think I can do something with a scrollView for the root layout, but I know it is not good to put a listview inside a scrollview.

I don't find any proper way to do this kind of feature...

EDIT: To be more clear, I want to translate the listview before I'm able to scroll the listview itself. Problem is when translate listview, the listview height will not expand.

like image 666
Chol Avatar asked Dec 07 '25 02:12

Chol


1 Answers

I am also getting this problem in version 5.1 in lower version it's working fine.Try to use in 5.0 As it STABLE verson, also check another scrolling bug in 5.1 in this link here I could not comment so posting this as answer.

like image 199
Jishant Avatar answered Dec 08 '25 16:12

Jishant



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!