2

I'm not looking for exact code here, just a direction on what to look for and what I should be reading about so I can figure this out.

I have a layout that I would like to remain static, with only the listview changing depending on what's selected from the list. I've reloaded data in the list, but I would like the fancy transition animations between choices, and would like the app to go to the previous menu when pressing back.

Someone suggested using a viewswitcher, which seems like it'd be great, but I am still unsure about how to fill a listview in a layout with a regular row layout, then on selection do an animated transition to a custom row. Also, it seems the viewswitcher is limited to two views, so it may be a limitation when I want to go a few menus deeper.

Preferably, I'd like to put each menu in it's own class so that I can handle filling it in that class, if possible...

Hope this isn't too vague, but if it is I'll be more than happy to explain myself further.

Jorsher
  • 3,683
  • 3
  • 17
  • 14

1 Answers1

1

Don't know if it's what you meant but have you tried showing and hiding the views?

findViewById(R.id.listViewID).setVisibility(LinearLayout.GONE); //hide the one you want
findViewById(R.id.listViewID2).setVisibility(LinearLayout.VISIBLE); //show the one you want

Hope it's what you meant :)

Lior Iluz
  • 26,213
  • 16
  • 65
  • 114
  • Thanks for the answer however I'm not sure that will help with using transition animations between menus. Let's say I have an XML layout that includes a listview, how could I ONLY change the listview portion of the layout while keeping the rest of the layout static, and incorporate animations when switching to the new listview? – Jorsher Nov 08 '10 at 21:19
  • It would work fine with animation. Whatever method you called the .setVisibility in could also call your animation methods. – user432209 Nov 08 '10 at 21:25
  • agree with user432209 regarding the animation. R.id.ListViewID -> replace ListViewID with the id of the portion you want to show/hide. – Lior Iluz Nov 08 '10 at 21:36