سؤال

I am interested in the way that gmail handles fragments and their transitions. I'm trying to do something somewhat similar and am running into an issue. Could someone give me a high level over view of how to accomplish this?

  1. start with ActivityA that has fragmentA that takes up the entire screen
  2. when a user clicks on an element in fragmentA I would like to have fragmentB and fragmentC replace A and fragmentC to expand to fill most of the window (basically a weight of 1)

This seems like a simple thing, but I'm running into some problems. I don't need any advice on how to do the clicks or other things, but I would like some advice in how to lay it out correctly. Do I only use one activity? Am I hiding fragmentA and then adding fragmentB and fragmentC? Do I use a ViewSwitcher for the two cases and then just do a slide animation?

Thanks!

هل كانت مفيدة؟

المحلول

Romain Guy's Honeycomb PhotoAlbum app uses a technique to shift views along. I haven't had a chance to look at the code yet, but you might get some inspiration there?

http://www.curious-creature.org/2011/02/22/source-code-for-android-3-0-animation-demo/

نصائح أخرى

Look for SwipeyTabs (I know this is an old post but in case someone comes across it).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top