Commit a6f6cf14 authored by Ted Choc's avatar Ted Choc Committed by Commit Bot

Fix suggestions showing for the search widget after microphone defocus.

Update the suggestion visibility call to handle multiple
focus/lost focus cycles by always calling the finish animations
method after any url focus event.

BUG=902243

Change-Id: I413b772436faaa30c19106799ba27c638b6986e9
Reviewed-on: https://chromium-review.googlesource.com/c/1393375Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619536}
parent d372c56e
...@@ -139,12 +139,17 @@ public class SearchActivityLocationBarLayout extends LocationBarLayout { ...@@ -139,12 +139,17 @@ public class SearchActivityLocationBarLayout extends LocationBarLayout {
findViewById(R.id.url_action_container).setVisibility(View.VISIBLE); findViewById(R.id.url_action_container).setVisibility(View.VISIBLE);
} }
@Override
public void onUrlFocusChange(boolean hasFocus) {
super.onUrlFocusChange(hasFocus);
if (hasFocus) setUrlFocusChangeInProgress(false);
}
// TODO(tedchoc): Investigate focusing regardless of the search promo state and just ensure // TODO(tedchoc): Investigate focusing regardless of the search promo state and just ensure
// we don't start processing non-cached suggestion requests until that state // we don't start processing non-cached suggestion requests until that state
// is finalized after native has been initialized. // is finalized after native has been initialized.
private void focusTextBox() { private void focusTextBox() {
if (!mUrlBar.hasFocus()) mUrlBar.requestFocus(); if (!mUrlBar.hasFocus()) mUrlBar.requestFocus();
setUrlFocusChangeInProgress(false);
getAutocompleteCoordinator().setShowCachedZeroSuggestResults(true); getAutocompleteCoordinator().setShowCachedZeroSuggestResults(true);
new Handler().post(new Runnable() { new Handler().post(new Runnable() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment