Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(741)

Unified Diff: ui/android/java/src/org/chromium/ui/DropdownPopupWindow.java

Issue 932493003: [android] Hide <select> dropdown on outside tap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/android/java/src/org/chromium/ui/DropdownPopupWindow.java
diff --git a/ui/android/java/src/org/chromium/ui/DropdownPopupWindow.java b/ui/android/java/src/org/chromium/ui/DropdownPopupWindow.java
index 36bf7021626d7c34c387cf82378eb1e24a9fb152..e7f21d02266c37a39f3b2d1f7ccb7798424500f0 100644
--- a/ui/android/java/src/org/chromium/ui/DropdownPopupWindow.java
+++ b/ui/android/java/src/org/chromium/ui/DropdownPopupWindow.java
@@ -134,7 +134,26 @@ public class DropdownPopupWindow extends ListPopupWindow {
getListView().setDividerHeight(0);
ApiCompatibilityUtils.setLayoutDirection(getListView(),
mRtl ? View.LAYOUT_DIRECTION_RTL : View.LAYOUT_DIRECTION_LTR);
+ }
+
+ @Override
+ public void setOnDismissListener(PopupWindow.OnDismissListener listener) {
+ mOnDismissListener = listener;
+ }
+ /**
+ * Sets the text direction in the dropdown. Should be called before show().
+ * @param isRtl If true, then dropdown text direciton is right to left.
+ */
+ public void setRtl(boolean isRtl) {
+ mRtl = isRtl;
+ }
+
+ /**
+ * Disable hiding on outside tap so that tapping on a text input field associated with the popup
+ * will not hide the popup.
+ */
+ public void disableHideOnOutsideTap() {
// HACK: The ListPopupWindow's mPopup automatically dismisses on an outside tap. There's
// no way to override it or prevent it, except reaching into ListPopupWindow's hidden
// API. This allows the C++ controller to completely control showing/hiding the popup.
@@ -150,19 +169,6 @@ public class DropdownPopupWindow extends ListPopupWindow {
}
}
- @Override
- public void setOnDismissListener(PopupWindow.OnDismissListener listener) {
- mOnDismissListener = listener;
- }
-
- /**
- * Sets the text direction in the dropdown. Should be called before show().
- * @param isRtl If true, then dropdown text direciton is right to left.
- */
- public void setRtl(boolean isRtl) {
- mRtl = isRtl;
- }
-
/**
* Measures the width of the list content. The adapter should not be null.
* @return The popup window width in pixels.

Powered by Google App Engine
This is Rietveld 408576698