I want to create sticky header recycler view with ability to expand and collapse sections without on header click i have found this this library
but it uses listview and i want to use Recycler view because i want to use it as a list and Grid at the same time
did any body have made something like this
Thanks in advance
Actually yes, just finished to add this new feature, and it should be also the way you would like. Check my FlexibleAdapter project, but, you should also read my answer here: How can I set a listener inside a RecyclerView Header Decor?
Related
My problem is simple: I need to make a layout similar to android.R.layout.simple_expandable_list_item_1 which can fit more than one textview in the layout, as well as show the little '>' symbol that indicates that the tab is expandable.
How can this best be accomplished? My first thought was to use the layout as a background of a linear layout with two textviews in it, but I can't seem to make that work.
Vogella has a pretty good tutorial on how to achieve custom list views through Adapters.
Basically, what you do is you create a Layout with the looks you want for the list items and then you extend an adapter (ArrayAdapter for instance), see section 4. Then, in your activity, you create an instance of your Adapter implementation and populate it from an Array containing the data for the list.
Also have a look at the Developers site for how to make the list scroll smoothly with the ViewHolder pattern.
And if you feel you need more info on the expandable part maybe the hive can help.
I am using DragNDrop library for re ordering list view. But what I exactly need is that, the last element of the list view should be static. It should not move when some one try to re order. How can I implement it? Should I use some other libraries for that?
You could just add it as a footer:
View footerView = getLayoutInflater().inflate(R.layout.footer_layout, null, false);
yourListView.addFooterView(footerView);
You could use a RecyclerView which offers more control and flexibility for the user interaction. There is some interesting library out there already implementing the user action like Swipe-to-delete, Swipe-to-reorder... And you could add you own behaviours to it depending of the position like you wanted to do. AdvancedRecyclerView
For example, you could just do nothing onSwiped() if the position is the last one as you wanted to accomplish.
I want to create List view row animation like below . I want to move row from one list view to other list view. Both list view are in same activity.
Anyone can give me idea how I can do this.
First of all because you mentioned "ListView":
In my opinion the best way to perform dynamic "lists" in android is to use to android-given class
RecyclerView.
It's easy to use like a normal ListView but like I said before it handles dynamic data.
Moreover it has some support librarys like ItemTouchHelper to drag/drop and swipe items in the list around. Its very easy to expand your RecyclerView with this upgrade. Here is a good tutorial:
Tutorial.
I would like to give you two ideas how I would proceed to implement such a list like the example of your post:
1) (Recommended) Search on Github or similar sites for 3rd library parties that already solved this.
2) Use the RecyclerView with the ItemtouchHelper-Upgrade i mentioned above and try to expand it with two lists. When an item is onMove() set the visibility of the first list on GONE and the second on VISIBLE. Now you only have to add the data of your item to the second list and remove it from the first. Then use notifyDataSetChanged() on both lists and your done.
I dont know how difficult it will be to implement it but thats the only way I know how you can do that and how the programmers of your example could have done it.
I would like some information (a library or specific name) to try to do that.
I want a listview or recyclerview with an item or header that dont scroll and when another specific item is on top of the screen stay that new item.
Here an example in youtube.
https://www.youtube.com/watch?v=BuHQSWQHxwk
Once I found a library to do that but I cant find it anymore.
Thank you in advance
There is a library StickyListHeader. You can create view just like shown in the video you mentioned.
I want to create a grid-like in Pinterest or Wish Android applications.
I already found some solutions like http://www.androidviews.net/2013/01/pinterest-like-adapterview/
But all the solutions that I found don't have a ScrollListener, that I am using to detect reaching the bottom and loading new content.
Any ideas or solutions?
Try my solution of wrapping a scroll view around recycler view and then adding scroll listener to the scroll view: https://stackoverflow.com/a/43780074/6662058
how about try this open source library.
https://github.com/huewu/PinterestLikeAdapterView
It is implemented based on android internal adapter view codes and provide its own OnScrollerListener interface just like android's original one.
For all thoses who need to set a scroll listener on the StaggeredGridView, here is my forked version that add the support for this feature -> https://github.com/GoMino/StaggeredGridView