diff options
author | Alan Viverette <alanv@google.com> | 2015-04-30 15:53:11 -0700 |
---|---|---|
committer | Alan Viverette <alanv@google.com> | 2015-04-30 15:53:11 -0700 |
commit | 80ebe0d4ecb36d0e82dce499ccc0810cf3a0ec89 (patch) | |
tree | e1e507a704640e6e0c53526e4e7ea424e51bb4ca /core | |
parent | 7dc7d09ba5abdc99eb5f106cf3ce545355d4c9be (diff) | |
download | frameworks_base-80ebe0d4ecb36d0e82dce499ccc0810cf3a0ec89.zip frameworks_base-80ebe0d4ecb36d0e82dce499ccc0810cf3a0ec89.tar.gz frameworks_base-80ebe0d4ecb36d0e82dce499ccc0810cf3a0ec89.tar.bz2 |
ListPopupWindow should use window layout type SUB_PANEL
Look down, back up, where are you? You're in a dialog with an
AutoCompleteTextView. What's on your screen? I have it, it's the
auto-completion results you could be seeing. Look again. The window
layout type is now TYPE_APPLICATION_SUB_PANEL and the auto-completion
results are visible.
Also adds API on ListPopupWindow to specify the window layout type
and changes the text editing handle to be type ABOVE_SUB_PANEL.
Bug: 18530738
Change-Id: Id5577c4892729920de5b73411e580e6b2b2401d0
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/widget/Editor.java | 3 | ||||
-rw-r--r-- | core/java/android/widget/ListPopupWindow.java | 18 | ||||
-rw-r--r-- | core/java/android/widget/PopupWindow.java | 6 |
3 files changed, 22 insertions, 5 deletions
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index 35e7389..db48dd3 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -2422,7 +2422,8 @@ public class Editor { public PinnedPopupWindow() { createPopupWindow(); - mPopupWindow.setWindowLayoutType(WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL); + mPopupWindow.setWindowLayoutType( + WindowManager.LayoutParams.TYPE_APPLICATION_ABOVE_SUB_PANEL); mPopupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT); mPopupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); diff --git a/core/java/android/widget/ListPopupWindow.java b/core/java/android/widget/ListPopupWindow.java index 310412f..05866f0 100644 --- a/core/java/android/widget/ListPopupWindow.java +++ b/core/java/android/widget/ListPopupWindow.java @@ -39,6 +39,7 @@ import android.view.View.OnTouchListener; import android.view.ViewConfiguration; import android.view.ViewGroup; import android.view.ViewParent; +import android.view.WindowManager; import android.view.animation.AccelerateDecelerateInterpolator; import com.android.internal.R; @@ -77,6 +78,7 @@ public class ListPopupWindow { private int mDropDownWidth = ViewGroup.LayoutParams.WRAP_CONTENT; private int mDropDownHorizontalOffset; private int mDropDownVerticalOffset; + private int mDropDownWindowLayoutType = WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL; private boolean mDropDownVerticalOffsetSet; private int mDropDownGravity = Gravity.NO_GRAVITY; @@ -515,6 +517,19 @@ public class ListPopupWindow { } /** + * Set the layout type for this popup window. + * <p> + * See {@link WindowManager.LayoutParams#type} for possible values. + * + * @param layoutType Layout type for this window. + * + * @see WindowManager.LayoutParams#type + */ + public void setWindowLayoutType(int layoutType) { + mDropDownWindowLayoutType = layoutType; + } + + /** * Sets a listener to receive events when a list item is clicked. * * @param clickListener Listener to register @@ -567,8 +582,9 @@ public class ListPopupWindow { public void show() { int height = buildDropDown(); - boolean noInputMethod = isInputMethodNotNeeded(); + final boolean noInputMethod = isInputMethodNotNeeded(); mPopup.setAllowScrollingAnchorParent(!noInputMethod); + mPopup.setWindowLayoutType(mDropDownWindowLayoutType); if (mPopup.isShowing()) { final int widthSpec; diff --git a/core/java/android/widget/PopupWindow.java b/core/java/android/widget/PopupWindow.java index c3ac278..b4cbf35 100644 --- a/core/java/android/widget/PopupWindow.java +++ b/core/java/android/widget/PopupWindow.java @@ -829,9 +829,9 @@ public class PopupWindow { } /** - * Set the layout type for this window. This value will be passed through to - * {@link WindowManager.LayoutParams#type} therefore the value should match any value - * {@link WindowManager.LayoutParams#type} accepts. + * Set the layout type for this window. + * <p> + * See {@link WindowManager.LayoutParams#type} for possible values. * * @param layoutType Layout type for this window. * |