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.
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 expandable listview to get sub-menu on click of menu. I want to create two different section in expandable listview exactly like menu using separator.
I am using -
MainActivity
ExpandableListAdapter
listheader
list_submenu
Any help will be appreciated.
Thanks in advance.
Firstly, I would recommend you migrate to recyclerView cause nobody use ListView nowadays.
If I get you right, you need something like BigNerdRanch's ExpandableRecycler or expandable recycler view.
This is 2 library, which very easy to use in your app. In some of projects, we used expandableRecycler from the Big Nerd Ranch. Easy, fast, and comfortable. Second one, didn`t try yet.
To divide views with separator, you might be want to use DividerItemDecoration from support lib.
If, for some reason you still want to use listView - you can try tutorial here
Regards.
Hi I just watch the last video of Android Design in Action: Collections and I would like how do you approach the following view:
The first thing that I though was use a GridView, but how do you achieve the first item fill two items size?
The other solution that I think is use a normal ListView, but in each row return two items view. And for the first row return a single item.
What do you think about these two approach? There are a better options?
UPDATE:
I want to inflate the collection dynamically from a Cursor or a List.
Check out the link..
http://www.androidviews.net/2013/01/pinterest-like-adapterview/
in that link have Staggeredgridview example with source code try that..
https://github.com/maurycyw/StaggeredGridViewDemo
Not exactly the same scenario, but you may find this post useful.-
Create gridlayout.
Let me help you my friend. Use the following library https://github.com/Utopia-Developers/StaggeredGridView Its an implementation of StaggeredGridView that allows you to set column span on each view in the getView() method of your adapter.
In my android application, I've a ListView that is loaded with a lot of items. I would like that users could move very fast through the list. I've seen that in some applications, when a list is loaded, and the user starts scrolling, a icon appears on the right of the screen, and this icon can be used to move very fast through the list.
How can I do this?
Thank you very much!
You want android:fastScrollEnabled="true".
See Vardhan's implementation of Fast Scroll for android here.
If you want to be able to customize your Fast-scroller, like choosing
your own scroller image to appear, I recommend using this source:
https://github.com/nolanlawson/CustomFastScrollViewDemo/
Basically, your listview adapter will have to implement a
sectionindexer. This section indexer can be very stripped if you don't
want to complicate things and provide simple fastscrolling though the
entire length of the list.
The direct source for the fastscroller is here:
https://github.com/nolanlawson/CustomFastScrollViewDemo/blob/master/src/com/nolanlawson/customfastscrollviewdemo/CustomFastScrollView.java
Place this view around your listview (nest your listview inside this
view in your xml layout file) and set android:fastScrollEnabled="true"
on your listview.
You might also want to check out a previous answer:
Fast Scroll display problem with ListAdapter and SectionIndexer
Source : How to use fast scroll in android?
I wonder if there is a tutorial or example code how the effect below achieved in Android, or if someone published an adapter already for this... Basically based on the number of results returned the screen is populated with boxes, and as the finger swipes down more boxes will load on demand until the results run out.
This is a GridView. And you can use your custom Load More GridView. This is a custom ListView example of the same. You can implement your own custom GridView similar to this.
What you are looking for is a Lazy List Adapter.
There is a great implementation for it. You can check it here. All what you need next is to create the layout of your list rows, i.e the boxes.