Loading api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -37464,6 +37464,8 @@ package android.view { method public abstract void setContentView(int); method public abstract void setContentView(android.view.View); method public abstract void setContentView(android.view.View, android.view.ViewGroup.LayoutParams); method public abstract void setDecorView(android.view.View); method public abstract void setDecorView(int); method protected void setDefaultWindowFormat(int); method public void setDimAmount(float); method public void setElevation(float); api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -39761,6 +39761,8 @@ package android.view { method public abstract void setContentView(int); method public abstract void setContentView(android.view.View); method public abstract void setContentView(android.view.View, android.view.ViewGroup.LayoutParams); method public abstract void setDecorView(android.view.View); method public abstract void setDecorView(int); method protected void setDefaultWindowFormat(int); method public void setDimAmount(float); method public void setDisableWallpaperTouchEvents(boolean); core/java/android/view/Window.java +21 −0 Original line number Diff line number Diff line Loading @@ -1155,6 +1155,27 @@ public abstract class Window { */ public abstract void setContentView(View view); /** * Install a view in the decoration (title) area, to be shown when * the window is in multi-window mode. This view will be placed * next to the window controls. * * The view may be restored to defaults by passing null. * * @param view The desired view to display in window decorations. */ public abstract void setDecorView(View view); /** * Convenience for * {@link #setDecorView(View)} * to set the custom window decoration from a layout resource. The layout will be inflated * adding all top level views to the decoration * * @param layoutResID Resource ID to be inflated. */ public abstract void setDecorView(@LayoutRes int layoutResID); /** * Set the screen content to an explicit view. This view is placed * directly into the screen's view hierarchy. It can itself be a complex Loading core/java/com/android/internal/policy/PhoneWindow.java +25 −0 Original line number Diff line number Diff line Loading @@ -123,6 +123,7 @@ import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.view.animation.Interpolator; import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.ImageView; import android.widget.PopupWindow; import android.widget.ProgressBar; Loading Loading @@ -468,6 +469,30 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } } @Override public void setDecorView(int layoutResID) { View v = mLayoutInflater.inflate(layoutResID, null); setDecorView(v); } @Override public void setDecorView(View view) { if (mContentParent == null) { installDecor(); } LinearLayout clientDecorPlaceholder = (LinearLayout) findViewById(R.id.client_decor_placeholder); if (clientDecorPlaceholder != null) { clientDecorPlaceholder.removeAllViews(); if (view != null) { clientDecorPlaceholder.addView(view); } } } @Override public void addContentView(View view, ViewGroup.LayoutParams params) { if (mContentParent == null) { Loading core/java/com/android/internal/widget/NonClientDecorView.java +16 −30 Original line number Diff line number Diff line Loading @@ -428,8 +428,7 @@ public class NonClientDecorView extends LinearLayout // The render nodes for the multi threaded renderer. private ThreadedRenderer mRenderer; private RenderNode mFrameNode; private RenderNode mBackdropNode; private RenderNode mFrameAndBackdropNode; private final Rect mOldTargetRect = new Rect(); private final Rect mNewTargetRect = new Rect(); Loading @@ -450,13 +449,11 @@ public class NonClientDecorView extends LinearLayout setName("ResizeFrame"); mRenderer = renderer; // Create the render nodes for our frame and backdrop which can be resized independently // from the content. mFrameNode = RenderNode.create("FrameNode", null); mBackdropNode = RenderNode.create("BackdropNode", null); // Create a render node for the content and frame backdrop // which can be resized independently from the content. mFrameAndBackdropNode = RenderNode.create("FrameAndBackdropNode", null); mRenderer.addRenderNode(mFrameNode, false); mRenderer.addRenderNode(mBackdropNode, true); mRenderer.addRenderNode(mFrameAndBackdropNode, true); // Set the initial bounds and draw once so that we do not get a broken frame. mTargetRect.set(initialBounds); Loading Loading @@ -504,10 +501,9 @@ public class NonClientDecorView extends LinearLayout // Invalidate the current content bounds. mRenderer.setContentDrawBounds(0, 0, 0, 0); // Remove the render nodes again // Remove the render node again // (see comment above - better to do that only once). mRenderer.removeRenderNode(mFrameNode); mRenderer.removeRenderNode(mBackdropNode); mRenderer.removeRenderNode(mFrameAndBackdropNode); mRenderer = null; Loading Loading @@ -575,7 +571,7 @@ public class NonClientDecorView extends LinearLayout mRenderer.setContentDrawBounds( mLastXOffset, mLastYOffset + mLastCaptionHeight, mLastYOffset, mLastXOffset + mLastContentWidth, mLastYOffset + mLastCaptionHeight + mLastContentHeight); // If this was the first call and changeWindowSizeLocked got already called prior Loading Loading @@ -623,30 +619,20 @@ public class NonClientDecorView extends LinearLayout final int width = newBounds.width(); final int height = newBounds.height(); // Produce the draw calls. // TODO(skuhne): Create a separate caption view which draws this. If the shadow should // be resized while the window resizes, this hierarchy needs to have the elevation. // That said - it is probably no good idea to draw the shadow every time since it costs // a considerable time which we should rather spend for resizing the content and it does // barely show while the entire screen is moving. mFrameNode.setLeftTopRightBottom(left, top, left + width, top + mLastCaptionHeight); DisplayListCanvas canvas = mFrameNode.start(width, height); mFrameAndBackdropNode.setLeftTopRightBottom(left, top, left + width, top + height); // Draw the caption and content backdrops in to our render node. DisplayListCanvas canvas = mFrameAndBackdropNode.start(width, height); mCaptionBackgroundDrawable.setBounds(0, 0, left + width, top + mLastCaptionHeight); mCaptionBackgroundDrawable.draw(canvas); mFrameNode.end(canvas); mBackdropNode.setLeftTopRightBottom(left, top + mLastCaptionHeight, left + width, top + height); // The backdrop: clear everything with the background. Clipping is done elsewhere. canvas = mBackdropNode.start(width, height - mLastCaptionHeight); mResizingBackgroundDrawable.setBounds(0, 0, left + width, top + height); mResizingBackgroundDrawable.setBounds(0, mLastCaptionHeight, left + width, top + height); mResizingBackgroundDrawable.draw(canvas); mBackdropNode.end(canvas); mFrameAndBackdropNode.end(canvas); // We need to render both rendered nodes explicitly. mRenderer.drawRenderNode(mFrameNode); mRenderer.drawRenderNode(mBackdropNode); // We need to render the node explicitly mRenderer.drawRenderNode(mFrameAndBackdropNode); reportDrawIfNeeded(); } Loading Loading
api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -37464,6 +37464,8 @@ package android.view { method public abstract void setContentView(int); method public abstract void setContentView(android.view.View); method public abstract void setContentView(android.view.View, android.view.ViewGroup.LayoutParams); method public abstract void setDecorView(android.view.View); method public abstract void setDecorView(int); method protected void setDefaultWindowFormat(int); method public void setDimAmount(float); method public void setElevation(float);
api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -39761,6 +39761,8 @@ package android.view { method public abstract void setContentView(int); method public abstract void setContentView(android.view.View); method public abstract void setContentView(android.view.View, android.view.ViewGroup.LayoutParams); method public abstract void setDecorView(android.view.View); method public abstract void setDecorView(int); method protected void setDefaultWindowFormat(int); method public void setDimAmount(float); method public void setDisableWallpaperTouchEvents(boolean);
core/java/android/view/Window.java +21 −0 Original line number Diff line number Diff line Loading @@ -1155,6 +1155,27 @@ public abstract class Window { */ public abstract void setContentView(View view); /** * Install a view in the decoration (title) area, to be shown when * the window is in multi-window mode. This view will be placed * next to the window controls. * * The view may be restored to defaults by passing null. * * @param view The desired view to display in window decorations. */ public abstract void setDecorView(View view); /** * Convenience for * {@link #setDecorView(View)} * to set the custom window decoration from a layout resource. The layout will be inflated * adding all top level views to the decoration * * @param layoutResID Resource ID to be inflated. */ public abstract void setDecorView(@LayoutRes int layoutResID); /** * Set the screen content to an explicit view. This view is placed * directly into the screen's view hierarchy. It can itself be a complex Loading
core/java/com/android/internal/policy/PhoneWindow.java +25 −0 Original line number Diff line number Diff line Loading @@ -123,6 +123,7 @@ import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.view.animation.Interpolator; import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.ImageView; import android.widget.PopupWindow; import android.widget.ProgressBar; Loading Loading @@ -468,6 +469,30 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } } @Override public void setDecorView(int layoutResID) { View v = mLayoutInflater.inflate(layoutResID, null); setDecorView(v); } @Override public void setDecorView(View view) { if (mContentParent == null) { installDecor(); } LinearLayout clientDecorPlaceholder = (LinearLayout) findViewById(R.id.client_decor_placeholder); if (clientDecorPlaceholder != null) { clientDecorPlaceholder.removeAllViews(); if (view != null) { clientDecorPlaceholder.addView(view); } } } @Override public void addContentView(View view, ViewGroup.LayoutParams params) { if (mContentParent == null) { Loading
core/java/com/android/internal/widget/NonClientDecorView.java +16 −30 Original line number Diff line number Diff line Loading @@ -428,8 +428,7 @@ public class NonClientDecorView extends LinearLayout // The render nodes for the multi threaded renderer. private ThreadedRenderer mRenderer; private RenderNode mFrameNode; private RenderNode mBackdropNode; private RenderNode mFrameAndBackdropNode; private final Rect mOldTargetRect = new Rect(); private final Rect mNewTargetRect = new Rect(); Loading @@ -450,13 +449,11 @@ public class NonClientDecorView extends LinearLayout setName("ResizeFrame"); mRenderer = renderer; // Create the render nodes for our frame and backdrop which can be resized independently // from the content. mFrameNode = RenderNode.create("FrameNode", null); mBackdropNode = RenderNode.create("BackdropNode", null); // Create a render node for the content and frame backdrop // which can be resized independently from the content. mFrameAndBackdropNode = RenderNode.create("FrameAndBackdropNode", null); mRenderer.addRenderNode(mFrameNode, false); mRenderer.addRenderNode(mBackdropNode, true); mRenderer.addRenderNode(mFrameAndBackdropNode, true); // Set the initial bounds and draw once so that we do not get a broken frame. mTargetRect.set(initialBounds); Loading Loading @@ -504,10 +501,9 @@ public class NonClientDecorView extends LinearLayout // Invalidate the current content bounds. mRenderer.setContentDrawBounds(0, 0, 0, 0); // Remove the render nodes again // Remove the render node again // (see comment above - better to do that only once). mRenderer.removeRenderNode(mFrameNode); mRenderer.removeRenderNode(mBackdropNode); mRenderer.removeRenderNode(mFrameAndBackdropNode); mRenderer = null; Loading Loading @@ -575,7 +571,7 @@ public class NonClientDecorView extends LinearLayout mRenderer.setContentDrawBounds( mLastXOffset, mLastYOffset + mLastCaptionHeight, mLastYOffset, mLastXOffset + mLastContentWidth, mLastYOffset + mLastCaptionHeight + mLastContentHeight); // If this was the first call and changeWindowSizeLocked got already called prior Loading Loading @@ -623,30 +619,20 @@ public class NonClientDecorView extends LinearLayout final int width = newBounds.width(); final int height = newBounds.height(); // Produce the draw calls. // TODO(skuhne): Create a separate caption view which draws this. If the shadow should // be resized while the window resizes, this hierarchy needs to have the elevation. // That said - it is probably no good idea to draw the shadow every time since it costs // a considerable time which we should rather spend for resizing the content and it does // barely show while the entire screen is moving. mFrameNode.setLeftTopRightBottom(left, top, left + width, top + mLastCaptionHeight); DisplayListCanvas canvas = mFrameNode.start(width, height); mFrameAndBackdropNode.setLeftTopRightBottom(left, top, left + width, top + height); // Draw the caption and content backdrops in to our render node. DisplayListCanvas canvas = mFrameAndBackdropNode.start(width, height); mCaptionBackgroundDrawable.setBounds(0, 0, left + width, top + mLastCaptionHeight); mCaptionBackgroundDrawable.draw(canvas); mFrameNode.end(canvas); mBackdropNode.setLeftTopRightBottom(left, top + mLastCaptionHeight, left + width, top + height); // The backdrop: clear everything with the background. Clipping is done elsewhere. canvas = mBackdropNode.start(width, height - mLastCaptionHeight); mResizingBackgroundDrawable.setBounds(0, 0, left + width, top + height); mResizingBackgroundDrawable.setBounds(0, mLastCaptionHeight, left + width, top + height); mResizingBackgroundDrawable.draw(canvas); mBackdropNode.end(canvas); mFrameAndBackdropNode.end(canvas); // We need to render both rendered nodes explicitly. mRenderer.drawRenderNode(mFrameNode); mRenderer.drawRenderNode(mBackdropNode); // We need to render the node explicitly mRenderer.drawRenderNode(mFrameAndBackdropNode); reportDrawIfNeeded(); } Loading