summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2010-11-30 22:06:10 -0800
committerDianne Hackborn <hackbod@google.com>2010-12-01 11:00:42 -0800
commit0f761d6b8f5d5a607c87dbcdca6fe0ec7911970e (patch)
tree06f47ce47a1b403c66865d0fa8d074e9467a937c /services
parent7423c09f7a8cf4c7a5cf6856e7e8eb40bb67cac6 (diff)
downloadframeworks_base-0f761d6b8f5d5a607c87dbcdca6fe0ec7911970e.zip
frameworks_base-0f761d6b8f5d5a607c87dbcdca6fe0ec7911970e.tar.gz
frameworks_base-0f761d6b8f5d5a607c87dbcdca6fe0ec7911970e.tar.bz2
Implement issue #3201795: Improve transition when keyboard comes up
ViewRoot now does a fade animation between a snapshot of the previous layout to the new one when its content rect changes. Also tweaked some things in the window manager to fix problems in deciding when to animate the movement of a window and when not to. Change-Id: I9b4b3bd53c8258bd39a2f2fc315e77cfc56a409c
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/ScreenRotationAnimation.java4
-rw-r--r--services/java/com/android/server/WindowManagerService.java16
2 files changed, 14 insertions, 6 deletions
diff --git a/services/java/com/android/server/ScreenRotationAnimation.java b/services/java/com/android/server/ScreenRotationAnimation.java
index 1cc6a2a..a95a6c7 100644
--- a/services/java/com/android/server/ScreenRotationAnimation.java
+++ b/services/java/com/android/server/ScreenRotationAnimation.java
@@ -122,7 +122,9 @@ class ScreenRotationAnimation {
mSurface.unlockCanvasAndPost(c);
Surface.closeTransaction();
- screenshot.recycle();
+ if (screenshot != null) {
+ screenshot.recycle();
+ }
}
static int deltaRotation(int oldRotation, int newRotation) {
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index 5e49404..27ec1af 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -6848,6 +6848,8 @@ public class WindowManagerService extends IWindowManager.Stub
}
if (!mParentFrame.equals(pf)) {
+ //Slog.i(TAG, "Window " + this + " content frame from " + mParentFrame
+ // + " to " + pf);
mParentFrame.set(pf);
mContentChanged = true;
}
@@ -7734,12 +7736,10 @@ public class WindowManagerService extends IWindowManager.Stub
* sense to call from performLayoutAndPlaceSurfacesLockedInner().)
*/
boolean shouldAnimateMove() {
- return mContentChanged && !mAnimating && !mLastHidden && !mDisplayFrozen
+ return mContentChanged && !mExiting && !mLastHidden && !mDisplayFrozen
&& (mFrame.top != mLastFrame.top
|| mFrame.left != mLastFrame.left)
- && (mAttachedWindow == null
- || (mAttachedWindow.mAnimation == null
- && !mAttachedWindow.shouldAnimateMove()))
+ && (mAttachedWindow == null || !mAttachedWindow.shouldAnimateMove())
&& mPolicy.isScreenOn();
}
@@ -9223,6 +9223,7 @@ public class WindowManagerService extends IWindowManager.Stub
if (!gone || !win.mHaveFrame) {
if (!win.mLayoutAttached) {
if (initial) {
+ //Slog.i(TAG, "Window " + this + " clearing mContentChanged - initial");
win.mContentChanged = false;
}
mPolicy.layoutWindowLw(win, win.mAttrs, null);
@@ -9257,6 +9258,7 @@ public class WindowManagerService extends IWindowManager.Stub
if ((win.mViewVisibility != View.GONE && win.mRelayoutCalled)
|| !win.mHaveFrame) {
if (initial) {
+ //Slog.i(TAG, "Window " + this + " clearing mContentChanged - initial");
win.mContentChanged = false;
}
mPolicy.layoutWindowLw(win, win.mAttrs, win.mAttachedWindow);
@@ -9455,7 +9457,6 @@ public class WindowManagerService extends IWindowManager.Stub
w.setAnimation(a);
animDw = w.mLastFrame.left - w.mFrame.left;
animDh = w.mLastFrame.top - w.mFrame.top;
- w.mContentChanged = false;
}
// Execute animation.
@@ -10242,6 +10243,11 @@ public class WindowManagerService extends IWindowManager.Stub
w.mOrientationChanging = false;
}
+ if (w.mContentChanged) {
+ //Slog.i(TAG, "Window " + this + " clearing mContentChanged - done placing");
+ w.mContentChanged = false;
+ }
+
final boolean canBeSeen = w.isDisplayedLw();
if (someoneLosingFocus && w == mCurrentFocus && canBeSeen) {