From cb2736f3a3c7905320d3642bcd0ad1b931598290 Mon Sep 17 00:00:00 2001 From: Imanol Fernandez Date: Tue, 19 Nov 2019 11:58:46 +0100 Subject: [PATCH] Request focus when clicking URL bar icon buttons. Fixes #2301. --- .../org/mozilla/vrbrowser/ui/views/NavigationURLBar.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/views/NavigationURLBar.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/views/NavigationURLBar.java index 97f131d13..02653aafa 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/views/NavigationURLBar.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/views/NavigationURLBar.java @@ -239,7 +239,10 @@ private void initialize(Context aContext) { mURLWebsiteColor = typedValue.data; // Bookmarks - mBinding.bookmarkButton.setOnClickListener(v -> handleBookmarkClick()); + mBinding.bookmarkButton.setOnClickListener(v -> { + v.requestFocusFromTouch(); + handleBookmarkClick(); + }); // Initialize bindings mBinding.setIsLibraryVisible(false); @@ -479,6 +482,7 @@ public void setClickable(boolean clickable) { if (mAudio != null) { mAudio.playSound(AudioEngine.Sound.CLICK); } + view.requestFocusFromTouch(); if (mDelegate != null) { mDelegate.onVoiceSearchClicked(); @@ -500,6 +504,7 @@ public void setClickable(boolean clickable) { mAudio.playSound(AudioEngine.Sound.CLICK); } + view.requestFocusFromTouch(); if (mDelegate != null) { mDelegate.onPopUpButtonClicked(); }