summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-09-23 20:04:44 -0400
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-09-23 20:04:44 -0400
commitce60514221f2a143a0f85a1c63637d674eaa3d58 (patch)
treeded9397a08046be5f4eeab37d9739814ed435df3 /core
parent6e35b50e8d77ff16ffbcac88f421c7091d1c9b8c (diff)
parent5baba1698964194daa02d30d4dd93807b08c9379 (diff)
downloadframeworks_base-ce60514221f2a143a0f85a1c63637d674eaa3d58.zip
frameworks_base-ce60514221f2a143a0f85a1c63637d674eaa3d58.tar.gz
frameworks_base-ce60514221f2a143a0f85a1c63637d674eaa3d58.tar.bz2
Merge change 26717 into eclair
* changes: Newer animations.
Diffstat (limited to 'core')
-rw-r--r--core/java/android/view/animation/Animation.java28
-rw-r--r--core/res/res/anim/wallpaper_close_enter.xml15
-rw-r--r--core/res/res/anim/wallpaper_close_exit.xml13
-rw-r--r--core/res/res/anim/wallpaper_open_enter.xml13
-rw-r--r--core/res/res/anim/wallpaper_open_exit.xml15
-rw-r--r--core/res/res/values/attrs.xml3
-rw-r--r--core/res/res/values/public.xml1
7 files changed, 88 insertions, 0 deletions
diff --git a/core/java/android/view/animation/Animation.java b/core/java/android/view/animation/Animation.java
index 2f5e601..c8396c4 100644
--- a/core/java/android/view/animation/Animation.java
+++ b/core/java/android/view/animation/Animation.java
@@ -175,6 +175,11 @@ public abstract class Animation implements Cloneable {
*/
private int mZAdjustment;
+ /**
+ * Don't animate the wallpaper.
+ */
+ private boolean mDetachWallpaper = false;
+
private boolean mMore = true;
private boolean mOneMoreTime = true;
@@ -218,6 +223,8 @@ public abstract class Animation implements Cloneable {
setZAdjustment(a.getInt(com.android.internal.R.styleable.Animation_zAdjustment, ZORDER_NORMAL));
+ setDetachWallpaper(a.getBoolean(com.android.internal.R.styleable.Animation_detachWallpaper, false));
+
ensureInterpolator();
a.recycle();
@@ -515,6 +522,19 @@ public abstract class Animation implements Cloneable {
}
/**
+ * If detachWallpaper is true, and this is a window animation of a window
+ * that has a wallpaper background, then the window will be detached from
+ * the wallpaper while it runs. That is, the animation will only be applied
+ * to the window, and the wallpaper behind it will remain static.
+ *
+ * @param detachWallpaper true if the wallpaper should be detached from the animation
+ * @attr ref android.R.styleable#Animation_detachWallpaper
+ */
+ public void setDetachWallpaper(boolean detachWallpaper) {
+ mDetachWallpaper = detachWallpaper;
+ }
+
+ /**
* Gets the acceleration curve type for this animation.
*
* @return the {@link Interpolator} associated to this animation
@@ -611,6 +631,14 @@ public abstract class Animation implements Cloneable {
}
/**
+ * Return value of {@link #setDetachWallpaper(boolean)}.
+ * @attr ref android.R.styleable#Animation_detachWallpaper
+ */
+ public boolean getDetachWallpaper() {
+ return mDetachWallpaper;
+ }
+
+ /**
* <p>Indicates whether or not this animation will affect the transformation
* matrix. For instance, a fade animation will not affect the matrix whereas
* a scale animation will.</p>
diff --git a/core/res/res/anim/wallpaper_close_enter.xml b/core/res/res/anim/wallpaper_close_enter.xml
index 0d13009..5bc299e 100644
--- a/core/res/res/anim/wallpaper_close_enter.xml
+++ b/core/res/res/anim/wallpaper_close_enter.xml
@@ -18,7 +18,21 @@
-->
<!-- This version zooms the new non-wallpaper down on top of the
+ wallpaper, without zooming the wallpaper itself. -->
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:interpolator="@anim/decelerate_interpolator"
+ android:zAdjustment="top">
+ <scale android:fromXScale="2.0" android:toXScale="1.0"
+ android:fromYScale="2.0" android:toYScale="1.0"
+ android:pivotX="50%p" android:pivotY="50%p"
+ android:duration="@android:integer/config_mediumAnimTime" />
+ <alpha android:fromAlpha="0" android:toAlpha="1.0"
+ android:duration="@android:integer/config_mediumAnimTime"/>
+</set>
+
+<!-- This version zooms the new non-wallpaper down on top of the
wallpaper. -->
+<!--
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@anim/decelerate_interpolator">
<scale android:fromXScale="2.0" android:toXScale="1.0"
@@ -26,6 +40,7 @@
android:pivotX="50%p" android:pivotY="50%p"
android:duration="@android:integer/config_mediumAnimTime" />
</set>
+-->
<!-- This version is a variation on the inter-activity slide that
also scales the wallpaper. -->
diff --git a/core/res/res/anim/wallpaper_close_exit.xml b/core/res/res/anim/wallpaper_close_exit.xml
index 5d91e30..c3ae620 100644
--- a/core/res/res/anim/wallpaper_close_exit.xml
+++ b/core/res/res/anim/wallpaper_close_exit.xml
@@ -18,7 +18,19 @@
-->
<!-- This version zooms the new non-wallpaper down on top of the
+ wallpaper, without zooming the wallpaper itself. -->
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:interpolator="@anim/decelerate_interpolator"
+ android:detachWallpaper="true">
+ <scale android:fromXScale="1.0" android:toXScale=".5"
+ android:fromYScale="1.0" android:toYScale=".5"
+ android:pivotX="50%p" android:pivotY="50%p"
+ android:duration="@android:integer/config_mediumAnimTime" />
+</set>
+
+<!-- This version zooms the new non-wallpaper down on top of the
wallpaper. The wallpaper here just stays fixed behind. -->
+<!--
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@anim/decelerate_interpolator"
android:zAdjustment="top">
@@ -29,6 +41,7 @@
<alpha android:fromAlpha="1.0" android:toAlpha="0"
android:duration="@android:integer/config_mediumAnimTime"/>
</set>
+-->
<!-- This version is a variation on the inter-activity slide that
also scales the wallpaper. -->
diff --git a/core/res/res/anim/wallpaper_open_enter.xml b/core/res/res/anim/wallpaper_open_enter.xml
index cf27cf0..7fe7e1e 100644
--- a/core/res/res/anim/wallpaper_open_enter.xml
+++ b/core/res/res/anim/wallpaper_open_enter.xml
@@ -17,8 +17,20 @@
*/
-->
+<!-- This version zooms the new non-wallpaper down on top of the
+ wallpaper, without zooming the wallpaper itself. -->
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:interpolator="@anim/decelerate_interpolator"
+ android:detachWallpaper="true">
+ <scale android:fromXScale=".5" android:toXScale="1.0"
+ android:fromYScale=".5" android:toYScale="1.0"
+ android:pivotX="50%p" android:pivotY="50%p"
+ android:duration="@android:integer/config_mediumAnimTime" />
+</set>
+
<!-- This version zooms the new non-wallpaper up off the wallpaper the
wallpaper. The wallpaper here just stays fixed behind. -->
+<!--
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@anim/decelerate_interpolator"
android:zAdjustment="top">
@@ -29,6 +41,7 @@
<alpha android:fromAlpha="0.0" android:toAlpha="1.0"
android:duration="@android:integer/config_mediumAnimTime"/>
</set>
+-->
<!-- This version is a variation on the inter-activity slide that
also scales the wallpaper. -->
diff --git a/core/res/res/anim/wallpaper_open_exit.xml b/core/res/res/anim/wallpaper_open_exit.xml
index b7a539c..9489c6d 100644
--- a/core/res/res/anim/wallpaper_open_exit.xml
+++ b/core/res/res/anim/wallpaper_open_exit.xml
@@ -18,7 +18,21 @@
-->
<!-- This version zooms the new non-wallpaper down on top of the
+ wallpaper, without zooming the wallpaper itself. -->
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:interpolator="@anim/decelerate_interpolator"
+ android:zAdjustment="top">
+ <scale android:fromXScale="1.0" android:toXScale="2.0"
+ android:fromYScale="1.0" android:toYScale="2.0"
+ android:pivotX="50%p" android:pivotY="50%p"
+ android:duration="@android:integer/config_mediumAnimTime" />
+ <alpha android:fromAlpha="1.0" android:toAlpha="0"
+ android:duration="@android:integer/config_mediumAnimTime"/>
+</set>
+
+<!-- This version zooms the new non-wallpaper down on top of the
wallpaper. -->
+<!--
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@anim/decelerate_interpolator">
<scale android:fromXScale="1.0" android:toXScale="2.0"
@@ -26,6 +40,7 @@
android:pivotX="50%p" android:pivotY="50%p"
android:duration="@android:integer/config_mediumAnimTime" />
</set>
+-->
<!-- This version is a variation on the inter-activity slide that
also scales the wallpaper. -->
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 193fdb2..df2a715 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -2639,6 +2639,9 @@
content for the duration of the animation. -->
<enum name="bottom" value="-1" />
</attr>
+ <!-- Special option for window animations: if this window is on top
+ of a wallpaper, don't animate the wallpaper with it. -->
+ <attr name="detachWallpaper" format="boolean" />
</declare-styleable>
<declare-styleable name="RotateAnimation">
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 4d23ef4..305e415 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1170,6 +1170,7 @@
<public type="attr" name="detailColumn" />
<public type="attr" name="detailSocialSummary" />
<public type="attr" name="thumbnail" />
+ <public type="attr" name="detachWallpaper" />
<public type="style" name="Theme.Wallpaper" />
<public type="style" name="Theme.Wallpaper.NoTitleBar" />