diff options
author | Alan Viverette <alanv@google.com> | 2014-10-29 22:05:09 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-10-29 22:05:11 +0000 |
commit | 2d3443fc5a6cf0830edd6a498a87760143dbc570 (patch) | |
tree | f5a5f96fdd0a3bd7f278714c7e5294367ed0a6ae | |
parent | 66c0adcfd4351518512df2f3e81526d2d67d6d65 (diff) | |
parent | 79c067c54a944660438c81ac2caf37ec68eedfa9 (diff) | |
download | frameworks_base-2d3443fc5a6cf0830edd6a498a87760143dbc570.zip frameworks_base-2d3443fc5a6cf0830edd6a498a87760143dbc570.tar.gz frameworks_base-2d3443fc5a6cf0830edd6a498a87760143dbc570.tar.bz2 |
Merge "Add setters for window elevation and clipToOutline properties" into lmp-mr1-dev
-rw-r--r-- | api/current.txt | 2 | ||||
-rw-r--r-- | core/java/android/view/Window.java | 29 | ||||
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindow.java | 16 |
3 files changed, 42 insertions, 5 deletions
diff --git a/api/current.txt b/api/current.txt index a90fee9..fa02c4e 100644 --- a/api/current.txt +++ b/api/current.txt @@ -34729,12 +34729,14 @@ package android.view { method public void setCallback(android.view.Window.Callback); method public abstract void setChildDrawable(int, android.graphics.drawable.Drawable); method public abstract void setChildInt(int, int); + method public void setClipToOutline(boolean); method public void setContainer(android.view.Window); 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 protected void setDefaultWindowFormat(int); method public void setDimAmount(float); + method public void setElevation(float); method public void setEnterTransition(android.transition.Transition); method public void setExitTransition(android.transition.Transition); method public abstract void setFeatureDrawable(int, android.graphics.drawable.Drawable); diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java index 20edeb8..0076abf 100644 --- a/core/java/android/view/Window.java +++ b/core/java/android/view/Window.java @@ -1074,17 +1074,36 @@ public abstract class Window { public abstract void onConfigurationChanged(Configuration newConfig); /** + * Sets the window elevation. + * + * @param elevation The window elevation. + * @see View#setElevation(float) + * @see android.R.styleable#Window_windowElevation + */ + public void setElevation(float elevation) {} + + /** + * Sets whether window content should be clipped to the outline of the + * window background. + * + * @param clipToOutline Whether window content should be clipped to the + * outline of the window background. + * @see View#setClipToOutline(boolean) + * @see android.R.styleable#Window_windowClipToOutline + */ + public void setClipToOutline(boolean clipToOutline) {} + + /** * Change the background of this window to a Drawable resource. Setting the * background to null will make the window be opaque. To make the window * transparent, you can use an empty drawable (for instance a ColorDrawable * with the color 0 or the system drawable android:drawable/empty.) * - * @param resid The resource identifier of a drawable resource which will be - * installed as the new background. + * @param resId The resource identifier of a drawable resource which will + * be installed as the new background. */ - public void setBackgroundDrawableResource(int resid) - { - setBackgroundDrawable(mContext.getDrawable(resid)); + public void setBackgroundDrawableResource(int resId) { + setBackgroundDrawable(mContext.getDrawable(resId)); } /** diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index 1ed61fd..4714826 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -1332,6 +1332,22 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } @Override + public final void setElevation(float elevation) { + mElevation = elevation; + if (mDecor != null) { + mDecor.setElevation(elevation); + } + } + + @Override + public final void setClipToOutline(boolean clipToOutline) { + mClipToOutline = clipToOutline; + if (mDecor != null) { + mDecor.setClipToOutline(clipToOutline); + } + } + + @Override public final void setBackgroundDrawable(Drawable drawable) { if (drawable != mBackgroundDrawable || mBackgroundResource != 0) { mBackgroundResource = 0; |