ksoichiro / Android-ObservableScrollView

Android library to observe scroll events on scrollable views.
http://ksoichiro.github.io/Android-ObservableScrollView/
Apache License 2.0
9.65k stars 2.06k forks source link

How to mimic the scrolling in the Phone app of Lollipop? #46

Open AndroidDeveloperLB opened 9 years ago

AndroidDeveloperLB commented 9 years ago

I've noticed they have a really interesting UI :

Is it possible to mimic those things using the library?

ksoichiro commented 9 years ago

@AndroidDeveloperLB Thank you for your feedback and sorry for my late reply.

It seems difficult but I think it's possible. Maybe it's like SlidingUpListViewActivity that uses TouchInterceptionFrameLayout of this library. (SlidingUp examples moves ObservableView using TouchInterceptionFrameLayout.) I'll try when I have time.

AndroidDeveloperLB commented 9 years ago

Thank you. I've come with a solution, but I think it's a bad one and hope there is a better way: http://stackoverflow.com/q/27997948/878126

When using a translationY, it causes weird issues of clicking on the items of the RecyclerView (when the upper area is shown). so I can click on the first item, yet the second (or third) item is shown as clicked. That's why I used padding instead.

I think the best thing is to change the layout params of the upper area, and also make it change its size using a customized RecyclerView that allows to block scrolling of itself via a listener. Changing the LayoutParams to change the size (and use animation to do so) can be done as I've shown here: http://stackoverflow.com/q/19519921/878126

dnlbauer commented 9 years ago

I'd also love to see a sample for that since OPs solution seems to be not that elegant.

AndroidDeveloperLB commented 9 years ago

@danijoo Yes, sorry. That's what I was allowed to do during the given time I had at work.

frapsMatheus commented 9 years ago

I'm trying to accomplish this by using this other API https://github.com/emilsjolander/StickyListHeaders but I can't figure it out how to use both at the same time with the same ListView.

AndroidDeveloperLB commented 9 years ago

@matrpedreira I don't know how to help, but maybe this repo is a better start: https://github.com/edsilfer/sticky-index ? You can also try one of mine.