From b29d0cdcfc2d78b8f211883b99a5264e20d4f5a2 Mon Sep 17 00:00:00 2001 From: "Randall E. Barker" Date: Mon, 16 Sep 2019 17:57:12 -0700 Subject: [PATCH] Ensure History and Bookmark labels are shown in url bar when they are visible. Fixes #1818 --- .../vrbrowser/ui/widgets/NavigationBarWidget.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java index f55d48be6..c756d18d3 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java @@ -403,13 +403,14 @@ public void attachToWindow(@NonNull WindowWidget aWindow) { mAttachedWindow.addHistoryViewListener(this); if (mAttachedWindow != null) { - mURLBar.setIsContentMode(mAttachedWindow.isBookmarksVisible()); + mURLBar.setIsContentMode(mAttachedWindow.isBookmarksVisible() || mAttachedWindow.isHistoryVisible()); + mURLBar.setURL(""); if (mAttachedWindow.isBookmarksVisible()) { - mURLBar.setURL(getResources().getString(R.string.url_bookmarks_title)); + mURLBar.setHint(R.string.url_bookmarks_title); mURLBar.setInsecureVisibility(View.GONE); - } if (mAttachedWindow.isHistoryVisible()) { - mURLBar.setURL(getResources().getString(R.string.url_history_title)); + } else if (mAttachedWindow.isHistoryVisible()) { + mURLBar.setHint(R.string.url_history_title); mURLBar.setInsecureVisibility(View.GONE); } else { @@ -713,7 +714,7 @@ public void release() { @Override public void onLocationChange(GeckoSession session, String url) { - if (mURLBar != null && !mAttachedWindow.isBookmarksVisible()) { + if (mURLBar != null && !mAttachedWindow.isBookmarksVisible() && !mAttachedWindow.isHistoryVisible()) { Log.d(LOGTAG, "Got location change"); mURLBar.setURL(url); mURLBar.setHint(R.string.search_placeholder);