Draggable / Expandable RecyclerView? - android

What is the newest and simplest way to do this?
All I want is the ability to drag parent items around and click them to expand to show their child items, with efficient operations if you delete or add.
Is there a library that does this and is simple to use? I tried Googling but everyone keeps saying this and that is outdated or inefficient but offer no alternatives.
Or can I just make one myself somehow? Is ItemTouchHelper what I need for expanding and moving stuff around?
Or is this built in somewhere? I'm using the support library.

I spent a long time in order to find a way to implement such a list. Check out my github project:
https://github.com/XxGoliathusxX/LightWeightExpandableDragAndSwipeRecyclerView
If you have any questions: Just ask me ;) Hope I can safe you a lot of time and trouble.

You can try this library. It allows an expandable, draggable and swipeable RecyclerView with many other features.

Related

ListView with a gridView within infinite height

This is one of the implementations that I have the most difficulty in actually finding the best way to solve.
There are a lot of techniques and ways, but the last answers I found did not really seem to me to solve the problem. Another point is that they are usually very old techniques and libraries.
What I want to do is this:
How do I create this ListView with a GridView inside and the screen has infinite height without using ScrollView, so we know that it is not recommended to use ListView within ScrollView.
I am not asking you to develop the code, but rather recommend me the correct architecture that I should use to implement this (ScrollView, ListView, GridView), or memo a library that has new development concepts that can help me.
This question arises because many of the existing responses are too old and have outdated ideas.
I know the question is of a slightly higher level of complexity, but I accept everyone's help.
Thank you very much.
It is very easy to solve this using a RecyclerView.
The documentation is pretty clear and explains all the details necessary for the development of the functionality.
I will leave the necessary documentation links to implement:
RecyclerView
GridLayoutManager
ItemsViewHolder
We know that it is always better to use native components in the development, I recommend, but if you prefer to use a library ready to solve your problem, here are some interesting:
Sticky Headers
recyclerview-stickyheaders
StickyListHeaders

Any idea if ExpandableListView is going to be deprecated in the near future ?

I hope my question doesn't violate the rules of StackOverFlow. I am writing an android app and want to implement a list view that is expandable. I am aware of expandableLisView and 3rd party libraries of different versions of expandable recycler view such as this or this . Although, I am trying to avoid using libraries and be as native as possible. knowing that recyclerView is more recent and potentially more efficient than listViews, I am afraid that expandableListView gets deprecated at some point in the near future and google comes up with something like that for recycler view.
Just wondering if anyone is aware of such a thing or if expandableListView would be a safe bet to go with. Thanks a lot for your input.

Android Custom GridView with Masonry Logic

I'm quite new to the world of Android development, and I'm relatively comfortable working with Adapters and GridViews. However, I'm looking to build something a little more advanced with GridViews that seems to be proving quite difficult without using third-party libraries (impossible from what I've read). Even using a third-party library like Etsy StaggeredGridView (https://github.com/etsy/AndroidStaggeredGrid) I can't seem to get it right. The best I can get is having rows that bleed into other rows, Pinterest-style, but what I'd like is something along these lines:
Where every nth cell actually has the width of two cells and offsets the grid.
So what I'd like some direction on is:
How could I accomplish this repeating pattern using a GridView/ Adapter combo?
Or failing that, how could I do this more efficiently than nesting a bunch of LinearLayouts inside a ScrollView and doing some really messy logic?
You can't. GridView has no way of merging columns like that. You can try using a GridLayout or TabletLayout to obtain that look. However neither support an adapter. You're best bet is to look for 3rd party libraries.
If there isn't going to be a lot of scrollable content, I'd go with (Grid/Table)Layout. You may take a small hit with memory consumption but you'll save yourself a lot of time in implementing your own custom solution. Which just may be your only choice if no 3rd party library exists.
One possibility would be to looking into RecycleView. It's a new view coming out with Android L that will also be in the support library. It's basically a more advanced version of a ListView that allows you to build customizable layouts that scroll and recycle their content. From the looks of it, it appears it would allow you to build an easy solution for your case.

What's the Android way of letting a user rearrange items on a ListView and remove items?

Well the question is that simple, what is the Android recommended way of letting a user reorder items in a ListView and remove items? I know the iOS way of doing it but since I haven't seen it much on Android I figured that probably isn't the recommend way of doing it?
Also please let me know if there are some libraries that help with it.
Thanks.

Animate Header in ListView

I want to add a header to my list view that will appear when I scroll up and disappear when I scroll down. This functionality is in the Facebook app. Is there any component in the ListView that I can call?
If you are comfortable using 3rd party libraries, here's a great one based on what you want.
https://github.com/LarsWerkman/QuickReturnListView
Also, I would really suggest you to take a look at Libraries for developers app. https://play.google.com/store/apps/details?id=com.desarrollodroide.repos
Very much useful for us developers! I happen to stumble upon a lot of useful libraries from this app!

Categories

Resources