From: Soren Stoutner Date: Mon, 22 Apr 2019 22:11:52 +0000 (-0700) Subject: Fix find on page. X-Git-Tag: v3.0~4 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=026e3182ead986bf03026f1dd31e47ceb330303d;p=PrivacyBrowserAndroid.git Fix find on page. --- 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 4193364d..a363ef1d 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -153,7 +153,6 @@ import java.util.Map; import java.util.Set; // TODO. New tabs are white in dark mode. -// TODO. Find on page. // AppCompatActivity from android.support.v7.app.AppCompatActivity must be used to have access to the SupportActionBar until the minimum API is >= 21. public class MainWebViewActivity extends AppCompatActivity implements CreateBookmarkDialog.CreateBookmarkListener, CreateBookmarkFolderDialog.CreateBookmarkFolderListener, @@ -479,6 +478,9 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook @Override public void onPageSelected(int position) { + // Close the find on page bar if it is open. + closeFindOnPage(null); + // Set the current WebView. setCurrentWebView(position); @@ -1926,6 +1928,9 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook LinearLayout findOnPageLinearLayout = findViewById(R.id.find_on_page_linearlayout); EditText findOnPageEditText = findViewById(R.id.find_on_page_edittext); + // Set the minimum height of the find on page linear layout to match the toolbar. + findOnPageLinearLayout.setMinimumHeight(toolbar.getHeight()); + // Hide the toolbar. toolbar.setVisibility(View.GONE); @@ -4325,6 +4330,9 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook if (inFullScreenBrowsingMode) { // Switch to full screen mode. // Hide the app bar if specified. if (hideAppBar) { + // Close the find on page bar if it is visible. + closeFindOnPage(null); + // Hide the tab linear layout. tabsLinearLayout.setVisibility(View.GONE); diff --git a/app/src/main/res/layout/main_framelayout.xml b/app/src/main/res/layout/main_framelayout.xml index 20dfc9bf..5cff666f 100644 --- a/app/src/main/res/layout/main_framelayout.xml +++ b/app/src/main/res/layout/main_framelayout.xml @@ -63,40 +63,14 @@ android:layout_width="match_parent" android.support.design:layout_scrollFlags="scroll|enterAlways|snap" /> - - - - - - - + android:visibility="gone" + android.support.design:layout_scrollFlags="scroll|enterAlways|snap" > + + + + + + +