tags:

views:

462

answers:

4

I'd like to implement drill down view in Android. Currently, onListItemClick, I refill the same list view with different data.

questions:

  1. any other suggestions? Something like the way it is done using UITableView on iPhone?
  2. is it possible to animate (push left or right) the listview fill operation?
A: 

The "Android-Way" of doing this (if it's only two levels of hierarchy) would be using the ExpandableListView. You can find this in the API Demos sample project.

To implement something really identical to the iPhone behavior, I am sure you must go the hard way of implementing this yourself.

  • Option A: implement distinct Activities for each level of hierarchy (maybe using ListActivities) and push the data in there manually
  • Option B: maybe it is possible to implement sliding in and out of data through a SlidingDrawer. I am not sure though, haven't used it so far.

Seems to be tough to implement this in Android. Let's see what others suggest!

Zordid
That won't work because I've multi-level database. Sometimes, the user may have to drill down 3 to 4 levels to see the final content. Also, I'm hosting the ListView in TabHost, so it is not possible to launch another activity from onListItemClick since the new activity takes over entire screen instead of showing up within the tab.
HiQuLABS
A: 

If you implement the detail view as a second Activity, passing the selected item using an Intent you'll get the animated transition between Activities. When going forward, the new Activity zooms out from the middle of the screen and when going backward the reverse happens.

Dave Webb
As far as I know this will only happen if the user has enabled Activity animation in the settings. I guess even this animation might be altered by customized Android versions by the vendors - and, most importantly: it does not look like the iPhone... :-(
Zordid
I would assume that if the user has switched off Activity animations it's because they don't like them and so implementing your own animations which they can't switch off isn't going to please them.
Dave Webb
+1  A: 

this is actually rather easy just implement your main view as ViewAnimator, add a listview to it. then in onItemClick in list view, just create next view, and push it into viewAnimator. when done - call showPrevious() and it will return to previous list view.

Reflog
A: 

I'm attempting to do the same thing. Have you accomplished it yet? Do you have the sample code hosted somewhere?

thecaptain
should be a comment
Janusz