From b8a2c6af93b55788b8fa978dc8ea28abddb7ddc4 Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Fri, 6 Oct 2017 11:41:56 -0700 Subject: [PATCH] Hide the keyboard every time a new webpage loads. https://redmine.stoutner.com/issues/214 --- .../activities/MainWebViewActivity.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java index e75d4193..6bc302ad 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -682,11 +682,8 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation // Load the new folder. loadBookmarksFolder(); } else { // The selected bookmark is not a folder. - // Get the bookmark URL and assign it to `formattedUrlString`. - String bookmarkUrl = bookmarkCursor.getString(bookmarkCursor.getColumnIndex(BookmarksDatabaseHelper.BOOKMARK_URL)); - // Load the bookmark URL. - loadUrl(bookmarkUrl); + loadUrl(bookmarkCursor.getString(bookmarkCursor.getColumnIndex(BookmarksDatabaseHelper.BOOKMARK_URL))); // Close the bookmarks drawer. drawerLayout.closeDrawer(GravityCompat.END); @@ -839,6 +836,9 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation mainWebView.setVisibility(View.INVISIBLE); } + // Hide the keyboard. `0` indicates no additional flags. + inputMethodManager.hideSoftInputFromWindow(mainWebView.getWindowToken(), 0); + // Check to see if we are waiting on Orbot. if (!waitingForOrbot) { // We are not waiting on Orbot, so we need to process the URL. // We need to update `formattedUrlString` at the beginning of the load, so that if the user toggles JavaScript during the load the new website is reloaded. @@ -2478,9 +2478,6 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation } loadUrl(formattedUrlString); - - // Hide the keyboard so we can see the webpage. `0` indicates no additional flags. - inputMethodManager.hideSoftInputFromWindow(mainWebView.getWindowToken(), 0); } -- 2.43.0