From 652aae43e6b35ed164c7b21e55ba0a9566ef2a36 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Mon, 17 Oct 2016 16:48:14 -0700 Subject: [PATCH] Un-hide ROTATION_ANIMATION_SEAMLESS. For N the Camera used ROTATION_ANIMATION_JUMPCUT which was reinterpreted as seamless rotation if possible. However this ended up being non ideal in app transition scenarios where the rotation animation replaces the app transition. Here we also can't seamlessly rotate, so the window just suddenly appears with jumpcut. In fact we want crossfade as a fallback animation and this is what distinguishes ROTATION_ANIMATION_JUMPCUT and SEAMLESS. The problem was patched over in N by having double-tap gestures fire camera intents with a SEAMLESS ActivityOptions.rotationAnimationHint, but it was too late to un-hide for consumption by apps. While here, clean up some documentation that doesn't really parse. Test: Manual, try the RotationAnimation activity in ApiDemos sample. Bug: 28838855 Bug: 28823590 Change-Id: I17b5e9fa967df8ade0943337cd7b6c3956d3a499 --- api/current.txt | 1 + api/system-current.txt | 1 + api/test-current.txt | 1 + core/java/android/view/WindowManager.java | 20 ++++++++++---------- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/api/current.txt b/api/current.txt index 225297a57e31c..3dac8f6a40822 100644 --- a/api/current.txt +++ b/api/current.txt @@ -44020,6 +44020,7 @@ package android.view { field public static final int ROTATION_ANIMATION_CHANGED = 4096; // 0x1000 field public static final int ROTATION_ANIMATION_CROSSFADE = 1; // 0x1 field public static final int ROTATION_ANIMATION_JUMPCUT = 2; // 0x2 + field public static final int ROTATION_ANIMATION_SEAMLESS = 3; // 0x3 field public static final int ROTATION_ANIMATION_ROTATE = 0; // 0x0 field public static final int SCREEN_BRIGHTNESS_CHANGED = 2048; // 0x800 field public static final int SCREEN_ORIENTATION_CHANGED = 1024; // 0x400 diff --git a/api/system-current.txt b/api/system-current.txt index de1bbd3089562..efc0824b06f4e 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -47204,6 +47204,7 @@ package android.view { field public static final int ROTATION_ANIMATION_CHANGED = 4096; // 0x1000 field public static final int ROTATION_ANIMATION_CROSSFADE = 1; // 0x1 field public static final int ROTATION_ANIMATION_JUMPCUT = 2; // 0x2 + field public static final int ROTATION_ANIMATION_SEAMLESS = 3; // 0x3 field public static final int ROTATION_ANIMATION_ROTATE = 0; // 0x0 field public static final int SCREEN_BRIGHTNESS_CHANGED = 2048; // 0x800 field public static final int SCREEN_ORIENTATION_CHANGED = 1024; // 0x400 diff --git a/api/test-current.txt b/api/test-current.txt index 2d0fa49c0321c..682b6e7e6c5e8 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -44256,6 +44256,7 @@ package android.view { field public static final int ROTATION_ANIMATION_CHANGED = 4096; // 0x1000 field public static final int ROTATION_ANIMATION_CROSSFADE = 1; // 0x1 field public static final int ROTATION_ANIMATION_JUMPCUT = 2; // 0x2 + field public static final int ROTATION_ANIMATION_SEAMLESS = 3; // 0x3 field public static final int ROTATION_ANIMATION_ROTATE = 0; // 0x0 field public static final int SCREEN_BRIGHTNESS_CHANGED = 2048; // 0x800 field public static final int SCREEN_ORIENTATION_CHANGED = 1024; // 0x400 diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index abb305121ea88..f14acaaf43c6d 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -1578,30 +1578,30 @@ public interface WindowManager extends ViewManager { public float buttonBrightness = BRIGHTNESS_OVERRIDE_NONE; /** - * Value for {@link #rotationAnimation} to define the animation used to - * specify that this window will rotate in or out following a rotation. + * Value for {@link #rotationAnimation} which specifies that this + * window will visually rotate in or out following a rotation. */ public static final int ROTATION_ANIMATION_ROTATE = 0; /** - * Value for {@link #rotationAnimation} to define the animation used to - * specify that this window will fade in or out following a rotation. + * Value for {@link #rotationAnimation} which specifies that this + * window will fade in or out following a rotation. */ public static final int ROTATION_ANIMATION_CROSSFADE = 1; /** - * Value for {@link #rotationAnimation} to define the animation used to - * specify that this window will immediately disappear or appear following - * a rotation. + * Value for {@link #rotationAnimation} which specifies that this window + * will immediately disappear or appear following a rotation. */ public static final int ROTATION_ANIMATION_JUMPCUT = 2; /** * Value for {@link #rotationAnimation} to specify seamless rotation mode. * This works like JUMPCUT but will fall back to CROSSFADE if rotation - * can't be applied without pausing the screen. - * - * @hide + * can't be applied without pausing the screen. For example, this is ideal + * for Camera apps which don't want the viewfinder contents to ever rotate + * or fade (and rather to be seamless) but also don't want ROTATION_ANIMATION_JUMPCUT + * during app transition scenarios where seamless rotation can't be applied. */ public static final int ROTATION_ANIMATION_SEAMLESS = 3;