Merge "resolved conflicts for merge of 4e14159a to master"
diff --git a/api/current.xml b/api/current.xml
index dbbdb7b..0f30449 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -1482,6 +1482,28 @@
  visibility="public"
 >
 </field>
+<field name="animator_fade_in"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="17432609"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="animator_fade_out"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="17432610"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 <field name="anticipate_interpolator"
  type="int"
  transient="false"
@@ -4310,6 +4332,50 @@
  visibility="public"
 >
 </field>
+<field name="fragmentCloseEnterAnimation"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843560"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="fragmentCloseExitAnimation"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843561"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="fragmentOpenEnterAnimation"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843558"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="fragmentOpenExitAnimation"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843559"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 <field name="freezesText"
  type="int"
  transient="false"
@@ -20806,6 +20872,19 @@
 <parameter name="sequenceItems" type="android.animation.Animatable...">
 </parameter>
 </method>
+<method name="setTarget"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="target" type="java.lang.Object">
+</parameter>
+</method>
 </class>
 <class name="Sequencer.Builder"
  extends="java.lang.Object"
@@ -27905,8 +27984,8 @@
 <parameter name="savedInstanceState" type="android.os.Bundle">
 </parameter>
 </method>
-<method name="onCreateAnimation"
- return="android.view.animation.Animation"
+<method name="onCreateAnimatable"
+ return="android.animation.Animatable"
  abstract="false"
  native="false"
  synchronized="false"
@@ -28412,39 +28491,6 @@
 <parameter name="fragment" type="android.app.Fragment">
 </parameter>
 </method>
-<field name="TRANSIT_ACTIVITY_CLOSE"
- type="int"
- transient="false"
- volatile="false"
- value="8199"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="TRANSIT_ACTIVITY_OPEN"
- type="int"
- transient="false"
- volatile="false"
- value="4102"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="TRANSIT_ENTER"
- type="int"
- transient="false"
- volatile="false"
- value="4097"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
 <field name="TRANSIT_ENTER_MASK"
  type="int"
  transient="false"
@@ -28456,17 +28502,6 @@
  visibility="public"
 >
 </field>
-<field name="TRANSIT_EXIT"
- type="int"
- transient="false"
- volatile="false"
- value="8194"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
 <field name="TRANSIT_EXIT_MASK"
  type="int"
  transient="false"
@@ -28478,11 +28513,22 @@
  visibility="public"
 >
 </field>
-<field name="TRANSIT_HIDE"
+<field name="TRANSIT_FRAGMENT_CLOSE"
  type="int"
  transient="false"
  volatile="false"
- value="8196"
+ value="8194"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="TRANSIT_FRAGMENT_OPEN"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="4097"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -28500,72 +28546,6 @@
  visibility="public"
 >
 </field>
-<field name="TRANSIT_PREVIEW_DONE"
- type="int"
- transient="false"
- volatile="false"
- value="5"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="TRANSIT_SHOW"
- type="int"
- transient="false"
- volatile="false"
- value="4099"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="TRANSIT_TASK_CLOSE"
- type="int"
- transient="false"
- volatile="false"
- value="8201"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="TRANSIT_TASK_OPEN"
- type="int"
- transient="false"
- volatile="false"
- value="4104"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="TRANSIT_TASK_TO_BACK"
- type="int"
- transient="false"
- volatile="false"
- value="8203"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="TRANSIT_TASK_TO_FRONT"
- type="int"
- transient="false"
- volatile="false"
- value="4106"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
 <field name="TRANSIT_UNSET"
  type="int"
  transient="false"
@@ -28577,50 +28557,6 @@
  visibility="public"
 >
 </field>
-<field name="TRANSIT_WALLPAPER_CLOSE"
- type="int"
- transient="false"
- volatile="false"
- value="8204"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="TRANSIT_WALLPAPER_INTRA_CLOSE"
- type="int"
- transient="false"
- volatile="false"
- value="8207"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="TRANSIT_WALLPAPER_INTRA_OPEN"
- type="int"
- transient="false"
- volatile="false"
- value="4110"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="TRANSIT_WALLPAPER_OPEN"
- type="int"
- transient="false"
- volatile="false"
- value="4109"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
 </interface>
 <class name="Instrumentation"
  extends="java.lang.Object"
diff --git a/core/java/android/animation/Sequencer.java b/core/java/android/animation/Sequencer.java
index 3278a3e..2406d8a 100644
--- a/core/java/android/animation/Sequencer.java
+++ b/core/java/android/animation/Sequencer.java
@@ -140,6 +140,24 @@
     }
 
     /**
+     * Sets the target object for all current {@link #getChildAnimations() child animations}
+     * of this Sequencer that take targets ({@link android.animation.PropertyAnimator} and
+     * Sequencer).
+     *
+     * @param target The object being animated
+     */
+    public void setTarget(Object target) {
+        for (Node node : mNodes) {
+            Animatable animation = node.animation;
+            if (animation instanceof Sequencer) {
+                ((Sequencer)animation).setTarget(target);
+            } else if (animation instanceof PropertyAnimator) {
+                ((PropertyAnimator)animation).setTarget(target);
+            }
+        }
+    }
+
+    /**
      * This method creates a <code>Builder</code> object, which is used to
      * set up playing constraints. This initial <code>play()</code> method
      * tells the <code>Builder</code> the animation that is the dependency for
diff --git a/core/java/android/app/Fragment.java b/core/java/android/app/Fragment.java
index 0bb200c..2f61345 100644
--- a/core/java/android/app/Fragment.java
+++ b/core/java/android/app/Fragment.java
@@ -16,6 +16,7 @@
 
 package android.app;
 
+import android.animation.Animatable;
 import android.content.ComponentCallbacks;
 import android.content.Context;
 import android.content.Intent;
@@ -35,7 +36,6 @@
 import android.view.ViewGroup;
 import android.view.ContextMenu.ContextMenuInfo;
 import android.view.View.OnCreateContextMenuListener;
-import android.view.animation.Animation;
 import android.widget.AdapterView;
 
 import java.lang.reflect.InvocationTargetException;
@@ -495,7 +495,10 @@
         mCalled = true;
     }
     
-    public Animation onCreateAnimation(int transit, boolean enter, int nextAnim) {
+    /**
+     * Called when a fragment loads an animation.
+     */
+    public Animatable onCreateAnimatable(int transit, boolean enter, int nextAnim) {
         return null;
     }
     
diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java
index 35b4610..54e37b0 100644
--- a/core/java/android/app/FragmentManager.java
+++ b/core/java/android/app/FragmentManager.java
@@ -16,6 +16,9 @@
 
 package android.app;
 
+import android.animation.Animatable;
+import android.animation.PropertyAnimator;
+import android.animation.Sequencer;
 import android.content.res.TypedArray;
 import android.os.Bundle;
 import android.os.Handler;
@@ -28,7 +31,6 @@
 import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
-import android.view.animation.Animation;
 import android.view.animation.AnimationUtils;
 
 import java.util.ArrayList;
@@ -106,16 +108,16 @@
         }
     };
     
-    Animation loadAnimation(Fragment fragment, int transit, boolean enter,
+    Animatable loadAnimatable(Fragment fragment, int transit, boolean enter,
             int transitionStyle) {
-        Animation animObj = fragment.onCreateAnimation(transitionStyle, enter,
+        Animatable animObj = fragment.onCreateAnimatable(transit, enter,
                 fragment.mNextAnim);
         if (animObj != null) {
             return animObj;
         }
         
         if (fragment.mNextAnim != 0) {
-            Animation anim = AnimationUtils.loadAnimation(mActivity, fragment.mNextAnim);
+            Animatable anim = AnimationUtils.loadAnimator(mActivity, fragment.mNextAnim);
             if (anim != null) {
                 return anim;
             }
@@ -138,7 +140,7 @@
         }
         
         TypedArray attrs = mActivity.obtainStyledAttributes(transitionStyle,
-                com.android.internal.R.styleable.WindowAnimation);
+                com.android.internal.R.styleable.FragmentAnimation);
         int anim = attrs.getResourceId(styleIndex, 0);
         attrs.recycle();
         
@@ -146,7 +148,7 @@
             return null;
         }
         
-        return AnimationUtils.loadAnimation(mActivity, anim);
+        return AnimationUtils.loadAnimator(mActivity, anim);
     }
     
     void moveToState(Fragment f, int newState, int transit, int transitionStyle) {
@@ -208,10 +210,15 @@
                             if (f.mView != null) {
                                 f.mView.setSaveFromParentEnabled(false);
                                 if (container != null) {
-                                    Animation anim = loadAnimation(f, transit, true,
+                                    Animatable anim = loadAnimatable(f, transit, true,
                                             transitionStyle);
                                     if (anim != null) {
-                                        f.mView.setAnimation(anim);
+                                        if (anim instanceof Sequencer) {
+                                            ((Sequencer)anim).setTarget(f.mView);
+                                        } else if (anim instanceof PropertyAnimator) {
+                                            ((PropertyAnimator)anim).setTarget(f.mView);
+                                        }
+                                        anim.start();
                                     }
                                     container.addView(f.mView);
                                     f.restoreViewState();
@@ -290,10 +297,15 @@
                             }
                             if (f.mContainer != null) {
                                 if (mCurState > Fragment.INITIALIZING) {
-                                    Animation anim = loadAnimation(f, transit, false,
+                                    Animatable anim = loadAnimatable(f, transit, true,
                                             transitionStyle);
                                     if (anim != null) {
-                                        f.mView.setAnimation(anim);
+                                        if (anim instanceof Sequencer) {
+                                            ((Sequencer)anim).setTarget(f.mView);
+                                        } else if (anim instanceof PropertyAnimator) {
+                                            ((PropertyAnimator)anim).setTarget(f.mView);
+                                        }
+                                        anim.start();
                                     }
                                 }
                                 f.mContainer.removeView(f.mView);
@@ -420,10 +432,15 @@
         if (!fragment.mHidden) {
             fragment.mHidden = true;
             if (fragment.mView != null) {
-                Animation anim = loadAnimation(fragment, transition, false,
+                Animatable anim = loadAnimatable(fragment, transition, true,
                         transitionStyle);
                 if (anim != null) {
-                    fragment.mView.setAnimation(anim);
+                    if (anim instanceof Sequencer) {
+                        ((Sequencer)anim).setTarget(fragment.mView);
+                    } else if (anim instanceof PropertyAnimator) {
+                        ((PropertyAnimator)anim).setTarget(fragment.mView);
+                    }
+                    anim.start();
                 }
                 fragment.mView.setVisibility(View.GONE);
             }
@@ -439,10 +456,15 @@
         if (fragment.mHidden) {
             fragment.mHidden = false;
             if (fragment.mView != null) {
-                Animation anim = loadAnimation(fragment, transition, true,
+                Animatable anim = loadAnimatable(fragment, transition, true,
                         transitionStyle);
                 if (anim != null) {
-                    fragment.mView.setAnimation(anim);
+                    if (anim instanceof Sequencer) {
+                        ((Sequencer)anim).setTarget(fragment.mView);
+                    } else if (anim instanceof PropertyAnimator) {
+                        ((PropertyAnimator)anim).setTarget(fragment.mView);
+                    }
+                    anim.start();
                 }
                 fragment.mView.setVisibility(View.VISIBLE);
             }
@@ -981,47 +1003,11 @@
     public static int reverseTransit(int transit) {
         int rev = 0;
         switch (transit) {
-            case FragmentTransaction.TRANSIT_ENTER:
-                rev = FragmentTransaction.TRANSIT_EXIT;
+            case FragmentTransaction.TRANSIT_FRAGMENT_OPEN:
+                rev = FragmentTransaction.TRANSIT_FRAGMENT_CLOSE;
                 break;
-            case FragmentTransaction.TRANSIT_EXIT:
-                rev = FragmentTransaction.TRANSIT_ENTER;
-                break;
-            case FragmentTransaction.TRANSIT_SHOW:
-                rev = FragmentTransaction.TRANSIT_HIDE;
-                break;
-            case FragmentTransaction.TRANSIT_HIDE:
-                rev = FragmentTransaction.TRANSIT_SHOW;
-                break;
-            case FragmentTransaction.TRANSIT_ACTIVITY_OPEN:
-                rev = FragmentTransaction.TRANSIT_ACTIVITY_CLOSE;
-                break;
-            case FragmentTransaction.TRANSIT_ACTIVITY_CLOSE:
-                rev = FragmentTransaction.TRANSIT_ACTIVITY_OPEN;
-                break;
-            case FragmentTransaction.TRANSIT_TASK_OPEN:
-                rev = FragmentTransaction.TRANSIT_TASK_CLOSE;
-                break;
-            case FragmentTransaction.TRANSIT_TASK_CLOSE:
-                rev = FragmentTransaction.TRANSIT_TASK_OPEN;
-                break;
-            case FragmentTransaction.TRANSIT_TASK_TO_FRONT:
-                rev = FragmentTransaction.TRANSIT_TASK_TO_BACK;
-                break;
-            case FragmentTransaction.TRANSIT_TASK_TO_BACK:
-                rev = FragmentTransaction.TRANSIT_TASK_TO_FRONT;
-                break;
-            case FragmentTransaction.TRANSIT_WALLPAPER_OPEN:
-                rev = FragmentTransaction.TRANSIT_WALLPAPER_CLOSE;
-                break;
-            case FragmentTransaction.TRANSIT_WALLPAPER_CLOSE:
-                rev = FragmentTransaction.TRANSIT_WALLPAPER_OPEN;
-                break;
-            case FragmentTransaction.TRANSIT_WALLPAPER_INTRA_OPEN:
-                rev = FragmentTransaction.TRANSIT_WALLPAPER_INTRA_CLOSE;
-                break;
-            case FragmentTransaction.TRANSIT_WALLPAPER_INTRA_CLOSE:
-                rev = FragmentTransaction.TRANSIT_WALLPAPER_INTRA_OPEN;
+            case FragmentTransaction.TRANSIT_FRAGMENT_CLOSE:
+                rev = FragmentTransaction.TRANSIT_FRAGMENT_OPEN;
                 break;
         }
         return rev;
@@ -1031,67 +1017,15 @@
     public static int transitToStyleIndex(int transit, boolean enter) {
         int animAttr = -1;
         switch (transit) {
-            case FragmentTransaction.TRANSIT_ENTER:
-                animAttr = com.android.internal.R.styleable.WindowAnimation_windowEnterAnimation;
-                break;
-            case FragmentTransaction.TRANSIT_EXIT:
-                animAttr = com.android.internal.R.styleable.WindowAnimation_windowExitAnimation;
-                break;
-            case FragmentTransaction.TRANSIT_SHOW:
-                animAttr = com.android.internal.R.styleable.WindowAnimation_windowShowAnimation;
-                break;
-            case FragmentTransaction.TRANSIT_HIDE:
-                animAttr = com.android.internal.R.styleable.WindowAnimation_windowHideAnimation;
-                break;
-            case FragmentTransaction.TRANSIT_ACTIVITY_OPEN:
+            case FragmentTransaction.TRANSIT_FRAGMENT_OPEN:
                 animAttr = enter
-                        ? com.android.internal.R.styleable.WindowAnimation_activityOpenEnterAnimation
-                        : com.android.internal.R.styleable.WindowAnimation_activityOpenExitAnimation;
+                    ? com.android.internal.R.styleable.FragmentAnimation_fragmentOpenEnterAnimation
+                    : com.android.internal.R.styleable.FragmentAnimation_fragmentOpenExitAnimation;
                 break;
-            case FragmentTransaction.TRANSIT_ACTIVITY_CLOSE:
+            case FragmentTransaction.TRANSIT_FRAGMENT_CLOSE:
                 animAttr = enter
-                        ? com.android.internal.R.styleable.WindowAnimation_activityCloseEnterAnimation
-                        : com.android.internal.R.styleable.WindowAnimation_activityCloseExitAnimation;
-                break;
-            case FragmentTransaction.TRANSIT_TASK_OPEN:
-                animAttr = enter
-                        ? com.android.internal.R.styleable.WindowAnimation_taskOpenEnterAnimation
-                        : com.android.internal.R.styleable.WindowAnimation_taskOpenExitAnimation;
-                break;
-            case FragmentTransaction.TRANSIT_TASK_CLOSE:
-                animAttr = enter
-                        ? com.android.internal.R.styleable.WindowAnimation_taskCloseEnterAnimation
-                        : com.android.internal.R.styleable.WindowAnimation_taskCloseExitAnimation;
-                break;
-            case FragmentTransaction.TRANSIT_TASK_TO_FRONT:
-                animAttr = enter
-                        ? com.android.internal.R.styleable.WindowAnimation_taskToFrontEnterAnimation
-                        : com.android.internal.R.styleable.WindowAnimation_taskToFrontExitAnimation;
-                break;
-            case FragmentTransaction.TRANSIT_TASK_TO_BACK:
-                animAttr = enter
-                        ? com.android.internal.R.styleable.WindowAnimation_taskToBackEnterAnimation
-                        : com.android.internal.R.styleable.WindowAnimation_taskToBackExitAnimation;
-                break;
-            case FragmentTransaction.TRANSIT_WALLPAPER_OPEN:
-                animAttr = enter
-                        ? com.android.internal.R.styleable.WindowAnimation_wallpaperOpenEnterAnimation
-                        : com.android.internal.R.styleable.WindowAnimation_wallpaperOpenExitAnimation;
-                break;
-            case FragmentTransaction.TRANSIT_WALLPAPER_CLOSE:
-                animAttr = enter
-                        ? com.android.internal.R.styleable.WindowAnimation_wallpaperCloseEnterAnimation
-                        : com.android.internal.R.styleable.WindowAnimation_wallpaperCloseExitAnimation;
-                break;
-            case FragmentTransaction.TRANSIT_WALLPAPER_INTRA_OPEN:
-                animAttr = enter
-                        ? com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenEnterAnimation
-                        : com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenExitAnimation;
-                break;
-            case FragmentTransaction.TRANSIT_WALLPAPER_INTRA_CLOSE:
-                animAttr = enter
-                        ? com.android.internal.R.styleable.WindowAnimation_wallpaperIntraCloseEnterAnimation
-                        : com.android.internal.R.styleable.WindowAnimation_wallpaperIntraCloseExitAnimation;
+                    ? com.android.internal.R.styleable.FragmentAnimation_fragmentCloseEnterAnimation
+                    : com.android.internal.R.styleable.FragmentAnimation_fragmentCloseExitAnimation;
                 break;
         }
         return animAttr;
diff --git a/core/java/android/app/FragmentTransaction.java b/core/java/android/app/FragmentTransaction.java
index 65cf85c..04598a3 100644
--- a/core/java/android/app/FragmentTransaction.java
+++ b/core/java/android/app/FragmentTransaction.java
@@ -100,47 +100,11 @@
     public final int TRANSIT_UNSET = -1;
     /** No animation for transition. */
     public final int TRANSIT_NONE = 0;
-    /** Window has been added to the screen. */
-    public final int TRANSIT_ENTER = 1 | TRANSIT_ENTER_MASK;
-    /** Window has been removed from the screen. */
-    public final int TRANSIT_EXIT = 2 | TRANSIT_EXIT_MASK;
-    /** Window has been made visible. */
-    public final int TRANSIT_SHOW = 3 | TRANSIT_ENTER_MASK;
-    /** Window has been made invisible. */
-    public final int TRANSIT_HIDE = 4 | TRANSIT_EXIT_MASK;
-    /** The "application starting" preview window is no longer needed, and will
-     * animate away to show the real window. */
-    public final int TRANSIT_PREVIEW_DONE = 5;
-    /** A window in a new activity is being opened on top of an existing one
-     * in the same task. */
-    public final int TRANSIT_ACTIVITY_OPEN = 6 | TRANSIT_ENTER_MASK;
-    /** The window in the top-most activity is being closed to reveal the
-     * previous activity in the same task. */
-    public final int TRANSIT_ACTIVITY_CLOSE = 7 | TRANSIT_EXIT_MASK;
-    /** A window in a new task is being opened on top of an existing one
-     * in another activity's task. */
-    public final int TRANSIT_TASK_OPEN = 8 | TRANSIT_ENTER_MASK;
-    /** A window in the top-most activity is being closed to reveal the
-     * previous activity in a different task. */
-    public final int TRANSIT_TASK_CLOSE = 9 | TRANSIT_EXIT_MASK;
-    /** A window in an existing task is being displayed on top of an existing one
-     * in another activity's task. */
-    public final int TRANSIT_TASK_TO_FRONT = 10 | TRANSIT_ENTER_MASK;
-    /** A window in an existing task is being put below all other tasks. */
-    public final int TRANSIT_TASK_TO_BACK = 11 | TRANSIT_EXIT_MASK;
-    /** A window in a new activity that doesn't have a wallpaper is being
-     * opened on top of one that does, effectively closing the wallpaper. */
-    public final int TRANSIT_WALLPAPER_CLOSE = 12 | TRANSIT_EXIT_MASK;
-    /** A window in a new activity that does have a wallpaper is being
-     * opened on one that didn't, effectively opening the wallpaper. */
-    public final int TRANSIT_WALLPAPER_OPEN = 13 | TRANSIT_ENTER_MASK;
-    /** A window in a new activity is being opened on top of an existing one,
-     * and both are on top of the wallpaper. */
-    public final int TRANSIT_WALLPAPER_INTRA_OPEN = 14 | TRANSIT_ENTER_MASK;
-    /** The window in the top-most activity is being closed to reveal the
-     * previous activity, and both are on top of he wallpaper. */
-    public final int TRANSIT_WALLPAPER_INTRA_CLOSE = 15 | TRANSIT_EXIT_MASK;
-    
+    /** Fragment is being added */
+    public final int TRANSIT_FRAGMENT_OPEN = 1 | TRANSIT_ENTER_MASK;
+    /** Fragment is being removed */
+    public final int TRANSIT_FRAGMENT_CLOSE = 2 | TRANSIT_EXIT_MASK;
+
     public FragmentTransaction setCustomAnimations(int enter, int exit);
     
     public FragmentTransaction setTransition(int transit);
diff --git a/core/res/res/anim/animator_fade_in.xml b/core/res/res/anim/animator_fade_in.xml
new file mode 100644
index 0000000..cd5042f
--- /dev/null
+++ b/core/res/res/anim/animator_fade_in.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<property xmlns:android="http://schemas.android.com/apk/res/android"
+    android:interpolator="@anim/accelerate_interpolator"
+    android:valueFrom="0"
+    android:valueTo="1"
+    android:propertyName="alpha"
+    android:duration="@android:integer/config_mediumAnimTime"
+/>
diff --git a/core/res/res/anim/animator_fade_out.xml b/core/res/res/anim/animator_fade_out.xml
new file mode 100644
index 0000000..dfb5d9c
--- /dev/null
+++ b/core/res/res/anim/animator_fade_out.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<property xmlns:android="http://schemas.android.com/apk/res/android"
+    android:interpolator="@anim/accelerate_interpolator"
+    android:valueFrom="1.0"
+    android:valueTo="0.0"
+    android:propertyName="alpha"
+    android:duration="@android:integer/config_mediumAnimTime"
+/>
diff --git a/core/res/res/anim/fragment_close_enter.xml b/core/res/res/anim/fragment_close_enter.xml
new file mode 100644
index 0000000..d4091e8
--- /dev/null
+++ b/core/res/res/anim/fragment_close_enter.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<sequencer xmlns:android="http://schemas.android.com/apk/res/android">
+    <property
+        android:interpolator="@anim/decelerate_interpolator"
+        android:valueFrom="2"
+        android:valueTo="1"
+        android:valueType="floatType"
+        android:propertyName="scaleX"
+        android:duration="@android:integer/config_mediumAnimTime"/>
+    <property
+        android:interpolator="@anim/decelerate_interpolator"
+        android:valueFrom="2"
+        android:valueTo="1"
+        android:valueType="floatType"
+        android:propertyName="scaleY"
+        android:duration="@android:integer/config_mediumAnimTime"/>
+    <property
+        android:interpolator="@anim/decelerate_interpolator"
+        android:valueFrom="0"
+        android:valueTo="1"
+        android:valueType="floatType"
+        android:propertyName="alpha"
+        android:duration="@android:integer/config_mediumAnimTime"/>
+    <property
+        android:interpolator="@anim/decelerate_interpolator"
+        android:valueFrom="-400"
+        android:valueTo="0"
+        android:valueType="floatType"
+        android:propertyName="translationX"
+        android:duration="@android:integer/config_mediumAnimTime"/>
+</sequencer>
\ No newline at end of file
diff --git a/core/res/res/anim/fragment_close_exit.xml b/core/res/res/anim/fragment_close_exit.xml
new file mode 100644
index 0000000..3e2cd22
--- /dev/null
+++ b/core/res/res/anim/fragment_close_exit.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<sequencer xmlns:android="http://schemas.android.com/apk/res/android">
+    <property
+        android:interpolator="@anim/accelerate_interpolator"
+        android:valueFrom="1"
+        android:valueTo=".5"
+        android:valueType="floatType"
+        android:propertyName="scaleX"
+        android:duration="@android:integer/config_mediumAnimTime"/>
+    <property
+        android:interpolator="@anim/accelerate_interpolator"
+        android:valueFrom="1"
+        android:valueTo=".5"
+        android:valueType="floatType"
+        android:propertyName="scaleY"
+        android:duration="@android:integer/config_mediumAnimTime"/>
+    <property
+        android:interpolator="@anim/accelerate_interpolator"
+        android:valueFrom="1"
+        android:valueTo="0"
+        android:valueType="floatType"
+        android:propertyName="alpha"
+        android:duration="@android:integer/config_mediumAnimTime"/>
+    <property
+        android:interpolator="@anim/accelerate_interpolator"
+        android:valueFrom="0"
+        android:valueTo="400"
+        android:valueType="floatType"
+        android:propertyName="translationX"
+        android:duration="@android:integer/config_mediumAnimTime"/>
+</sequencer>
\ No newline at end of file
diff --git a/core/res/res/anim/fragment_open_enter.xml b/core/res/res/anim/fragment_open_enter.xml
new file mode 100644
index 0000000..c89001c
--- /dev/null
+++ b/core/res/res/anim/fragment_open_enter.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<sequencer xmlns:android="http://schemas.android.com/apk/res/android">
+    <property
+        android:interpolator="@anim/decelerate_interpolator"
+        android:valueFrom="2"
+        android:valueTo="1"
+        android:valueType="floatType"
+        android:propertyName="scaleX"
+        android:duration="@android:integer/config_mediumAnimTime"/>
+    <property
+        android:interpolator="@anim/decelerate_interpolator"
+        android:valueFrom="2"
+        android:valueTo="1"
+        android:valueType="floatType"
+        android:propertyName="scaleY"
+        android:duration="@android:integer/config_mediumAnimTime"/>
+    <property
+        android:valueFrom="0"
+        android:valueTo="1"
+        android:valueType="floatType"
+        android:propertyName="alpha"
+        android:duration="@android:integer/config_mediumAnimTime"/>
+    <property
+        android:valueFrom="400"
+        android:valueTo="0"
+        android:valueType="floatType"
+        android:propertyName="translationX"
+        android:duration="@android:integer/config_mediumAnimTime"/>
+</sequencer>
\ No newline at end of file
diff --git a/core/res/res/anim/fragment_open_exit.xml b/core/res/res/anim/fragment_open_exit.xml
new file mode 100644
index 0000000..427fe4f
--- /dev/null
+++ b/core/res/res/anim/fragment_open_exit.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<sequencer xmlns:android="http://schemas.android.com/apk/res/android">
+    <property
+        android:interpolator="@anim/accelerate_interpolator"
+        android:valueFrom="1"
+        android:valueTo="2"
+        android:valueType="floatType"
+        android:propertyName="scaleX"
+        android:duration="@android:integer/config_mediumAnimTime"/>
+    <property
+        android:interpolator="@anim/accelerate_interpolator"
+        android:valueFrom="1"
+        android:valueTo="2"
+        android:valueType="floatType"
+        android:propertyName="scaleY"
+        android:duration="@android:integer/config_mediumAnimTime"/>
+    <property
+        android:valueFrom="1"
+        android:valueTo="0"
+        android:valueType="floatType"
+        android:propertyName="alpha"
+        android:duration="@android:integer/config_mediumAnimTime"/>
+    <property
+        android:valueFrom="0"
+        android:valueTo="-400"
+        android:valueType="floatType"
+        android:propertyName="translationX"
+        android:duration="@android:integer/config_mediumAnimTime"/>
+</sequencer>
\ No newline at end of file
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index a8c7842..a75f1a6 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -1021,6 +1021,14 @@
         <attr name="centerMedium" format="reference|color" />
     </declare-styleable>
 
+    <!-- Fragment animation class attributes. -->
+    <declare-styleable name="FragmentAnimation">
+        <attr name="fragmentOpenEnterAnimation" format="reference" />
+        <attr name="fragmentOpenExitAnimation" format="reference" />
+        <attr name="fragmentCloseEnterAnimation" format="reference" />
+        <attr name="fragmentCloseExitAnimation" format="reference" />
+    </declare-styleable>
+
     <!-- Window animation class attributes. -->
     <declare-styleable name="WindowAnimation">
         <!-- The animation used when a window is being added. -->
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index dee1cbc..539f1c0 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1316,6 +1316,12 @@
   <public type="attr" name="ordering" />
   <public type="attr" name="fragment" />
   <public type="attr" name="windowActionBarOverlay" />
+  <public type="attr" name="fragmentOpenEnterAnimation" />
+  <public type="attr" name="fragmentOpenExitAnimation" />
+  <public type="attr" name="fragmentCloseEnterAnimation" />
+  <public type="attr" name="fragmentCloseExitAnimation" />
+  <public type="anim" name="animator_fade_in" />
+  <public type="anim" name="animator_fade_out" />
 
   <public type="id" name="home" />
   <!-- Context menu ID for the "Select text..." menu item to switch to text
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index 0e7509e..7e52ebd 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -74,6 +74,10 @@
         <item name="wallpaperIntraOpenExitAnimation">@anim/wallpaper_intra_open_exit</item>
         <item name="wallpaperIntraCloseEnterAnimation">@anim/wallpaper_intra_close_enter</item>
         <item name="wallpaperIntraCloseExitAnimation">@anim/wallpaper_intra_close_exit</item>
+        <item name="fragmentOpenEnterAnimation">@anim/fragment_open_enter</item>
+        <item name="fragmentOpenExitAnimation">@anim/fragment_open_exit</item>
+        <item name="fragmentCloseEnterAnimation">@anim/fragment_close_enter</item>
+        <item name="fragmentCloseExitAnimation">@anim/fragment_close_exit</item>
     </style>
 
     <!-- Standard animations for a non-full-screen window or activity. -->