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

Unified Diff: ui/android/java/src/org/chromium/ui/autofill/AutofillKeyboardAccessory.java

Issue 1112643004: Hide the autofill keyboard accessory when the keyboard hides. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « no previous file | ui/android/java/src/org/chromium/ui/base/WindowAndroid.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/android/java/src/org/chromium/ui/autofill/AutofillKeyboardAccessory.java
diff --git a/ui/android/java/src/org/chromium/ui/autofill/AutofillKeyboardAccessory.java b/ui/android/java/src/org/chromium/ui/autofill/AutofillKeyboardAccessory.java
index d114ccd1d14fc9982b25138957755ca60cf33741..478971aba708b0ffb1d430836163f93f90ba841d 100644
--- a/ui/android/java/src/org/chromium/ui/autofill/AutofillKeyboardAccessory.java
+++ b/ui/android/java/src/org/chromium/ui/autofill/AutofillKeyboardAccessory.java
@@ -24,7 +24,8 @@ import java.util.HashSet;
* The Autofill suggestion view that lists relevant suggestions. It sits above the keyboard and
* below the content area.
*/
-public class AutofillKeyboardAccessory extends ListView implements AdapterView.OnItemClickListener {
+public class AutofillKeyboardAccessory extends ListView implements AdapterView.OnItemClickListener,
+ WindowAndroid.KeyboardVisibilityListener {
private final WindowAndroid mWindowAndroid;
private final AutofillKeyboardAccessoryDelegate mAutofillCallback;
@@ -59,6 +60,7 @@ public class AutofillKeyboardAccessory extends ListView implements AdapterView.O
mWindowAndroid = windowAndroid;
mAutofillCallback = autofillCallback;
+ mWindowAndroid.addKeyboardVisibilityListener(this);
setBackgroundResource(R.drawable.autofill_accessory_view_border);
setOnItemClickListener(this);
setContentDescription(windowAndroid.getActivity().get().getString(
@@ -108,10 +110,19 @@ public class AutofillKeyboardAccessory extends ListView implements AdapterView.O
ViewGroup container = mWindowAndroid.getKeyboardAccessoryView();
container.removeView(this);
container.setVisibility(View.GONE);
+ mWindowAndroid.removeKeyboardVisibilityListener(this);
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
mAutofillCallback.suggestionSelected(position);
}
+
+ @Override
+ public void keyboardVisibilityChanged(boolean isShowing) {
+ if (!isShowing) {
+ dismiss();
+ mAutofillCallback.dismissed();
+ }
+ }
}
« no previous file with comments | « no previous file | ui/android/java/src/org/chromium/ui/base/WindowAndroid.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698