Loading core/java/android/app/Activity.java +4 −0 Original line number Diff line number Diff line Loading @@ -1733,9 +1733,13 @@ public class Activity extends ContextThemeWrapper * * @param multiWindowMode True if the activity is in multi-window mode. */ @CallSuper public void onMultiWindowModeChanged(boolean multiWindowMode) { if (DEBUG_LIFECYCLE) Slog.v(TAG, "onMultiWindowModeChanged " + this + ": " + multiWindowMode); if (mWindow != null) { mWindow.onMultiWindowModeChanged(); } } /** Loading core/java/android/view/Window.java +6 −0 Original line number Diff line number Diff line Loading @@ -2106,4 +2106,10 @@ public abstract class Window { * to better match your application. */ public abstract void setResizingCaptionDrawable(Drawable drawable); /** * Called when the activity changes from fullscreen mode to multi-window mode and visa-versa. * @hide */ public abstract void onMultiWindowModeChanged(); } core/java/com/android/internal/policy/DecorView.java +22 −10 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ import android.view.animation.Interpolator; import android.widget.FrameLayout; import android.widget.PopupWindow; import static android.app.ActivityManager.StackId; import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID; import static android.app.ActivityManager.StackId.INVALID_STACK_ID; import static android.view.View.MeasureSpec.AT_MOST; Loading Loading @@ -1193,7 +1194,7 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind invalidate(); int opacity = PixelFormat.OPAQUE; if (ActivityManager.StackId.hasWindowShadow(mStackId)) { if (StackId.hasWindowShadow(mStackId)) { // If the window has a shadow, it must be translucent. opacity = PixelFormat.TRANSLUCENT; } else{ Loading Loading @@ -1576,13 +1577,25 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind void onConfigurationChanged() { int workspaceId = getStackId(); if (mDecorCaptionView != null) { if (mStackId != workspaceId) { mStackId = workspaceId; if (mDecorCaptionView == null && StackId.hasWindowDecor(mStackId)) { // Configuration now requires a caption. final LayoutInflater inflater = mWindow.getLayoutInflater(); mDecorCaptionView = createDecorCaptionView(inflater); if (mDecorCaptionView != null) { if (mDecorCaptionView.getParent() == null) { addView(mDecorCaptionView, 0, new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)); } removeView(mContentRoot); mDecorCaptionView.addView(mContentRoot, new ViewGroup.MarginLayoutParams(MATCH_PARENT, MATCH_PARENT)); } } else if (mDecorCaptionView != null) { // We might have to change the kind of surface before we do anything else. mDecorCaptionView.onConfigurationChanged( ActivityManager.StackId.hasWindowDecor(mStackId)); enableCaption(ActivityManager.StackId.hasWindowDecor(workspaceId)); mDecorCaptionView.onConfigurationChanged(StackId.hasWindowDecor(mStackId)); enableCaption(StackId.hasWindowDecor(workspaceId)); } } initializeElevation(); Loading Loading @@ -1635,8 +1648,7 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind final boolean isApplication = attrs.type == TYPE_BASE_APPLICATION || attrs.type == TYPE_APPLICATION; // Only a non floating application window on one of the allowed workspaces can get a caption if (!mWindow.isFloating() && isApplication && ActivityManager.StackId.hasWindowDecor(mStackId)) { if (!mWindow.isFloating() && isApplication && StackId.hasWindowDecor(mStackId)) { // Dependent on the brightness of the used title we either use the // dark or the light button frame. if (decorCaptionView == null) { Loading Loading @@ -1859,7 +1871,7 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind final boolean wasAdjustedForStack = mElevationAdjustedForStack; // Do not use a shadow when we are in resizing mode (mBackdropFrameRenderer not null) // since the shadow is bound to the content size and not the target size. if (ActivityManager.StackId.hasWindowShadow(mStackId) && !isResizing()) { if (StackId.hasWindowShadow(mStackId) && !isResizing()) { elevation = hasWindowFocus() ? DECOR_SHADOW_FOCUSED_HEIGHT_IN_DIP : DECOR_SHADOW_UNFOCUSED_HEIGHT_IN_DIP; // TODO(skuhne): Remove this if clause once b/22668382 got fixed. Loading core/java/com/android/internal/policy/PhoneWindow.java +7 −0 Original line number Diff line number Diff line Loading @@ -662,6 +662,13 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } } @Override public void onMultiWindowModeChanged() { if (mDecor != null) { mDecor.onConfigurationChanged(); } } private static void clearMenuViews(PanelFeatureState st) { // This can be called on config changes, so we should make sure // the views will be reconstructed based on the new orientation, etc. Loading Loading
core/java/android/app/Activity.java +4 −0 Original line number Diff line number Diff line Loading @@ -1733,9 +1733,13 @@ public class Activity extends ContextThemeWrapper * * @param multiWindowMode True if the activity is in multi-window mode. */ @CallSuper public void onMultiWindowModeChanged(boolean multiWindowMode) { if (DEBUG_LIFECYCLE) Slog.v(TAG, "onMultiWindowModeChanged " + this + ": " + multiWindowMode); if (mWindow != null) { mWindow.onMultiWindowModeChanged(); } } /** Loading
core/java/android/view/Window.java +6 −0 Original line number Diff line number Diff line Loading @@ -2106,4 +2106,10 @@ public abstract class Window { * to better match your application. */ public abstract void setResizingCaptionDrawable(Drawable drawable); /** * Called when the activity changes from fullscreen mode to multi-window mode and visa-versa. * @hide */ public abstract void onMultiWindowModeChanged(); }
core/java/com/android/internal/policy/DecorView.java +22 −10 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ import android.view.animation.Interpolator; import android.widget.FrameLayout; import android.widget.PopupWindow; import static android.app.ActivityManager.StackId; import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID; import static android.app.ActivityManager.StackId.INVALID_STACK_ID; import static android.view.View.MeasureSpec.AT_MOST; Loading Loading @@ -1193,7 +1194,7 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind invalidate(); int opacity = PixelFormat.OPAQUE; if (ActivityManager.StackId.hasWindowShadow(mStackId)) { if (StackId.hasWindowShadow(mStackId)) { // If the window has a shadow, it must be translucent. opacity = PixelFormat.TRANSLUCENT; } else{ Loading Loading @@ -1576,13 +1577,25 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind void onConfigurationChanged() { int workspaceId = getStackId(); if (mDecorCaptionView != null) { if (mStackId != workspaceId) { mStackId = workspaceId; if (mDecorCaptionView == null && StackId.hasWindowDecor(mStackId)) { // Configuration now requires a caption. final LayoutInflater inflater = mWindow.getLayoutInflater(); mDecorCaptionView = createDecorCaptionView(inflater); if (mDecorCaptionView != null) { if (mDecorCaptionView.getParent() == null) { addView(mDecorCaptionView, 0, new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)); } removeView(mContentRoot); mDecorCaptionView.addView(mContentRoot, new ViewGroup.MarginLayoutParams(MATCH_PARENT, MATCH_PARENT)); } } else if (mDecorCaptionView != null) { // We might have to change the kind of surface before we do anything else. mDecorCaptionView.onConfigurationChanged( ActivityManager.StackId.hasWindowDecor(mStackId)); enableCaption(ActivityManager.StackId.hasWindowDecor(workspaceId)); mDecorCaptionView.onConfigurationChanged(StackId.hasWindowDecor(mStackId)); enableCaption(StackId.hasWindowDecor(workspaceId)); } } initializeElevation(); Loading Loading @@ -1635,8 +1648,7 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind final boolean isApplication = attrs.type == TYPE_BASE_APPLICATION || attrs.type == TYPE_APPLICATION; // Only a non floating application window on one of the allowed workspaces can get a caption if (!mWindow.isFloating() && isApplication && ActivityManager.StackId.hasWindowDecor(mStackId)) { if (!mWindow.isFloating() && isApplication && StackId.hasWindowDecor(mStackId)) { // Dependent on the brightness of the used title we either use the // dark or the light button frame. if (decorCaptionView == null) { Loading Loading @@ -1859,7 +1871,7 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind final boolean wasAdjustedForStack = mElevationAdjustedForStack; // Do not use a shadow when we are in resizing mode (mBackdropFrameRenderer not null) // since the shadow is bound to the content size and not the target size. if (ActivityManager.StackId.hasWindowShadow(mStackId) && !isResizing()) { if (StackId.hasWindowShadow(mStackId) && !isResizing()) { elevation = hasWindowFocus() ? DECOR_SHADOW_FOCUSED_HEIGHT_IN_DIP : DECOR_SHADOW_UNFOCUSED_HEIGHT_IN_DIP; // TODO(skuhne): Remove this if clause once b/22668382 got fixed. Loading
core/java/com/android/internal/policy/PhoneWindow.java +7 −0 Original line number Diff line number Diff line Loading @@ -662,6 +662,13 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } } @Override public void onMultiWindowModeChanged() { if (mDecor != null) { mDecor.onConfigurationChanged(); } } private static void clearMenuViews(PanelFeatureState st) { // This can be called on config changes, so we should make sure // the views will be reconstructed based on the new orientation, etc. Loading