Android-ObservableScrollView icon indicating copy to clipboard operation
Android-ObservableScrollView copied to clipboard

Example of using the new design library, but with ListView?

Open AndroidDeveloperLB opened this issue 8 years ago • 6 comments

Is it possible to show an example (using the new design library) of how to handle ViewPager+tabs+fragments with ListView, where each (vertical) scrolling of ListView would show/hide the actionbar? So far, I've seen it only for RecyclerView. I've tried to use ListView, but it just doesn't work.

AndroidDeveloperLB avatar Aug 16 '15 09:08 AndroidDeveloperLB

If you care about new library, why don't you just use new RecyclerView :D

eneim avatar Aug 17 '15 01:08 eneim

Sorry, I can't. I was told to still use the ListViews of the fragments, as they are very complex and converting to RecyclerView won't be easy at all.

AndroidDeveloperLB avatar Aug 17 '15 05:08 AndroidDeveloperLB

I see. Well AFAIK, the latest Design Library won't support legacy items (like ListView or event ScrollView). So you may need some extensions ...

eneim avatar Aug 17 '15 05:08 eneim

That's too bad. Do you know perhaps of such extensions? Or, what will it take for me to make ListView work nicely with the scrolling of the actionBar ? Isn't there maybe an interface that I can implement for a customized ListView , and then it will work just like it works for RecyclerView ?

AndroidDeveloperLB avatar Aug 17 '15 12:08 AndroidDeveloperLB

@AndroidDeveloperLB The current working "scrolling components" are RecyclerView and NestedScrollView which respectively, implement ScrollingView and NestedScrollingChild interfaces. They enable their childs to be able to scroll and handling the scrolled mount.

Furthermore, new Design Library comes with the "Behavior" concept (CoordinatoorLayout's component) which takes care of scrolling behaviors. And if you decompile the source of that library, you can see that they implement some Subclasses of Behavior for those interface I remind above, to calculate the scroll of childs as well as limit the view which can be handled.

So if you want to have that in your listview, I guess you must start from the abstract AbsListView and implement those interface propertly, or else You need to create your own subclass of Behavior to handle your listview (I consider this a better solution, but still not be able to do that). So please take a look at the (not public yet) source code and try. I'm creating the same thing though, but I don't have any good news for you, so please wait and see some update out there.

eneim avatar Aug 17 '15 16:08 eneim

This seems like it will take a lot of time to work on, and sadly I don't have it (which is a part of the reason I was told not to convert the ListViews to RecyclerViews) . I think I will try to avoid using the new design library for that matter, but will use other components of it whenever possible.

Sorry, and good luck. If you finish, please let me know. I have some repos that might be useful for you, if you wish to check out.

AndroidDeveloperLB avatar Aug 17 '15 16:08 AndroidDeveloperLB