How to create a tree view in Android? - android

There are no controls in Android that provide Tree-like View. There is an ExpandableList View which I suspect could be used to creating one.
Have you tried imlpementing such a control?
How would one implement such a control in Android?

Our company just open-sourced a small widget that is doing just that... You can see all the sources and add the project (as a library) to your own android project:
http://code.google.com/p/tree-view-list-android/

take a look at ExpandableListView. Besides, see following thread:
http://www.mail-archive.com/android-beginners#googlegroups.com/msg03587.html

this solutions are, very complicate. but can use a ExpandableListView of more levels.
Example: How to implement multilevel ExpandableListview in Android?

Related

trouble with layout android Not Able to generate this View According to icons and line and below text

I am designing following layout structure for one of my application. But dont know how to implement it.
This Design is called Stepper. There are lot of open source library is available for this design. Check the following link. May it will help you.
https://android-arsenal.com/details/1/3049

Swipe to delete for a custom view not for list item

I want to develop a layout with a very simple ImageView and a Listview binded in a Relativelayout . Now for a better user experience I want to delete the Image view by swiping it left or right same like what is implemented in android Gmail app to delete emails.
Implementing it on a listview item is very simple and there are many tuts and sample codes are available over the internet including the official Google I/O talk on animation and explained in a very good way by Chet Hasse here
https://www.youtube.com/watch?v=YCHNAi9kJI4
but I don't require to implement it on the listview items insted I want to implement it in more generic way. In my case I want the same behaviour for my ImageView item as one view and ListView another . Like shown below
As soon as the ImageView item is deleted the whole ListView should smoothly come on the top.
I have tried many way to implement the same without any success.
Suggest me the approach or some samples to do this which is supported in Gingerbread and above android OS.
You can use this code:
https://github.com/romannurik/Android-SwipeToDismiss/blob/master/src/com/example/android/swipedismiss/SwipeDismissTouchListener.java
As described in readme this code works for android 14+.
You can use the NineOldAndroids library to support old versions of Android, or use the Jake Wharton's port:
https://github.com/JakeWharton/SwipeToDismissNOA
I looked around and found this helpful.
https://github.com/nhaarman/ListViewAnimations
I implemented a custom ViewGroup that takes one child and allows you to drag/fling it to the left with a callback once the swipe is complete. My intention was for it to work just like in a RecyclerView. Works well in a LinearLayout with animateLayoutChanges=true and setting the visibility to GONE in the callback.
Gist here: https://gist.github.com/darnmason/38a1a5178a06470202784050f4dc1cdf
All you need is this library: https://github.com/timroes/EnhancedListView

Custom Android GridView

I want to create a GridView like this one:
But, I don't know how! I know how work with Android GridView, but not like this one.
Suggestions of library or any tip will be welcome.
Thanks.
I want to create a GridView like this one
The View you are referring to can quite easily be created without using a GridView. If your components (clothing, bags, shoes etc.) are static, you can use nested LinearLayouts (with weights) inside a ScrollView.
Suggestions of library or any tip will be welcome.
You can try StaggeredGridView: Link
A demo project to get you going: Link

Create Carousel Style ViewPager

I'm looking to try and implement this style pattern into my application:
http://www.androidpatterns.com/uap_pattern/carousel
But I am having trouble in finding an existing library or solution to it. Does anybody know of any libraries that I could use or how I would go about implementing this?
So far, Ive found this:
http://www.inter-fuser.com/2010/02/android-coverflow-widget-v2.html
but it isn't quite what I want as it would be nice if it was hosted inside of a ViewPager so I can have buttons etc inside the view.
You might try twoway-view, an implementation of an AdapterView (similar to ListView/GridView) that supports horizontal scrolling.
In this case, you'd use it more like a ListView rather than a ViewPager, so each element would be a separate item layout, rather than Fragment.
One example of where twoway-view is in use right now is the latest Firefox for Android nightly as discussed on the announcement post, which contains some screenshots of it in use:

Android interface : show form like the grouped listview style?

I'm building an App for Android that already exists for iOS. On iOS, we really like to use the listview grouped style to show details and forms. It is really useful to show details of objects that we don't know how much properties they have before loading it.
I know that Android doesn't have a similar tableview style. And I don't want to use a custom library to recreate it, because I don't want to force an iOS like interface to my Android's users.
But how would you create a consistent Android interface that show similar information? Do you have example for me?
First of all, your instinct to not force iOS style UI onto Android users is correct and I respect you for it.
Android's ListView is roughly the equivalent of iOS's UITableView. There are important differences. For instance, you should never use a ListView inside another scrollable container. If a ListView is in a particular layout, it should (usually) be the only scrollable component. If you want multiple ListViews in a layout, you probably don't want ListViews at all. You should instead use (vertical) LinearLayouts and add the items in order.
Cyril Mottier writes excellent posts on implementing custom behavior for Android's ListView.
If you want to display data in a list then you can use the ListView. Here is a great article about how to use it.

Categories

Resources