diff options
| -rw-r--r-- | core/java/android/view/View.java | 10 | ||||
| -rw-r--r-- | core/java/android/view/ViewRoot.java | 1 | ||||
| -rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindow.java | 16 |
3 files changed, 27 insertions, 0 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 4c40653..2e6664b 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -11398,6 +11398,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } } + /** @hide */ + public void hackTurnOffWindowResizeAnim(boolean off) { + mAttachInfo.mTurnOffWindowResizeAnim = off; + } + /** * Interface definition for a callback to be invoked when a key event is * dispatched to this view. The callback will be invoked before the key @@ -11664,6 +11669,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility boolean mScalingRequired; /** + * If set, ViewRoot doesn't use its lame animation for when the window resizes. + */ + boolean mTurnOffWindowResizeAnim; + + /** * Left position of this view's window */ int mWindowLeft; diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java index 042095a..41fc6c6 100644 --- a/core/java/android/view/ViewRoot.java +++ b/core/java/android/view/ViewRoot.java @@ -772,6 +772,7 @@ public final class ViewRoot extends Handler implements ViewParent, if (!mAttachInfo.mContentInsets.equals(mPendingContentInsets)) { if (mWidth > 0 && mHeight > 0 && mSurface != null && mSurface.isValid() && + !mAttachInfo.mTurnOffWindowResizeAnim && mAttachInfo.mHardwareRenderer != null && mAttachInfo.mHardwareRenderer.isEnabled() && lp != null && !PixelFormat.formatHasAlpha(lp.format)) { diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index 88f30ed..8afb53e 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -2026,6 +2026,14 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } } + @Override + public void setBackgroundDrawable(Drawable d) { + super.setBackgroundDrawable(d); + if (getWindowToken() != null) { + updateWindowResizeState(); + } + } + public void setWindowFrame(Drawable drawable) { if (getForeground() != drawable) { setForeground(drawable); @@ -2126,10 +2134,18 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } } + void updateWindowResizeState() { + Drawable bg = getBackground(); + hackTurnOffWindowResizeAnim(bg == null || bg.getOpacity() + != PixelFormat.OPAQUE); + } + @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); + updateWindowResizeState(); + final Callback cb = getCallback(); if (cb != null && mFeatureId < 0) { cb.onAttachedToWindow(); |
