Fragment animation as in Honeycomb Gmail app - how to do that?

by Scythe » Fri, 20 May 2011 00:14:57 GMT


Sponsored Links
 I'd like to achieve similar fragment behaviour as in the Honeycomb
Gmail app. So I have three fragment next to each other: A, B and C.
Initially, A and B is displayed, and when the user selects something
from B, it triggers an sliding-animation/fragment-transaction so that
B and C are visible. B showing the selected item, C showing the
desired content.

Any ideas how the Gmail app does this?

-- 



Re: Fragment animation as in Honeycomb Gmail app - how to do that?

by Ed Burnette » Fri, 20 May 2011 02:33:46 GMT


 There's probably using FragmentTransaction.setTransition() or
setCustomAnimations().




-- 


Sponsored Links


Other Threads

1. How to simulate the user moving the cell phone from vertical to horizontal?

How can I simulate the user moving the cell phone from vertical to
horizontal?  I didn't see any options in the emulator.

Regards


--~--~---------~--~----~------------~-------~--~----~

2. View.onSaveInstanceState - How to implement it?

Hi,

i'm having a problem. I got a CustomView (extend AutoCompleteTextView)
which stores a certain value (additionall to the one whichis visible
in the TextView part), but when i open another activity (to edit a
certain record) and then return to my activity with the CustomView,
the value it stored isn't saved.

I know that the objects/UI is recreated when another activity gets
focus or when you change perspective. Well now i'm trying to implement
a feature which will preserve the values inside my CustomView. I've
come so far that i know that i need to override onSaveInstanceState()
and onRestoreInstanceState().

But i'm not actually sure of who exactly make the implementation and
how to work with Parcel and Parcelable Interfaces.

So i'd need a simple example which will make sure that the TextView as
well as my variable is preserved when the screen flips or another
application gets focus. I couldn't find anything in the internet, only
examples on how to implement onSaveInstanceState() and
onRestoreInstanceState() for an Activity. The Activity uses Bundle
class, which is easy to use and you can save values with state.put
("MYVALUE", myvalue);

However, i cant use bundle with classes which extends View class
(TextView, AutoCompleteTextView etc), as it will give me a casting
error if i try to convert the TextViews state into a bundle like in
the code below

        @Override
        public Parcelable onSaveInstanceState() {
                Bundle b = null;
                Parcelable p = super.onSaveInstanceState();

                // We have no state, return null
                if(p==null)
                        return null;

                try{
                        b = new Bundle((Bundle)p);
                        if(contactId>0)
                                b.putLong(CONTACT_ID, contactId);
                } catch(Exception ex){
                        Log.e(LOG_TAG,ex.getMessage(), ex);
                }

                return b;
        }

Can anyone post a piece of code as example on how to do it?
--~--~---------~--~----~------------~-------~--~----~

3. problem with playing sounds using media player

4. how to mount the sd card to pc via android application?

5. How to create two emulator instances in SDK 1.0 r2

6. seek bar implementing problem

7. my Activity extending ListActivity,null pointer exception when i select a list item which overstep the screen. why