]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Finish tabbed browsing. https://redmine.stoutner.com/issues/22
authorSoren Stoutner <soren@stoutner.com>
Tue, 23 Apr 2019 18:32:41 +0000 (11:32 -0700)
committerSoren Stoutner <soren@stoutner.com>
Tue, 23 Apr 2019 18:32:41 +0000 (11:32 -0700)
24 files changed:
app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
app/src/main/java/com/stoutner/privacybrowser/asynctasks/GetHostIpAddresses.java
app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java
app/src/main/res/layout/appbar_spinner_dropdown_item.xml
app/src/main/res/layout/appbar_spinner_item.xml
app/src/main/res/layout/bookmarks_activity_item_linearlayout.xml
app/src/main/res/layout/bookmarks_databaseview_item_linearlayout.xml
app/src/main/res/layout/bookmarks_drawer_item_linearlayout.xml
app/src/main/res/layout/databaseview_spinner_dropdown_items.xml
app/src/main/res/layout/databaseview_spinner_item.xml
app/src/main/res/layout/domain_name_linearlayout.xml
app/src/main/res/layout/domain_settings_spinner_dropdown_items.xml
app/src/main/res/layout/move_to_folder_item_linearlayout.xml
app/src/main/res/layout/requests_appbar_spinner_dropdown_item.xml
app/src/main/res/layout/requests_appbar_spinner_item.xml
app/src/main/res/layout/requests_item_linearlayout.xml
app/src/main/res/layout/spinner_dropdown_items.xml
app/src/main/res/layout/spinner_item.xml
app/src/main/res/layout/url_history_item_linearlayout.xml
app/src/main/res/layout/webview_framelayout.xml
app/src/main/res/values-v21/styles.xml
app/src/main/res/values/attrs.xml
app/src/main/res/values/colors.xml
app/src/main/res/values/styles.xml

index a363ef1dc718de05fdbe46e28d7000064969d5ee..908979b9992ff660359651455e87f5c22ac561cb 100644 (file)
@@ -152,8 +152,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-// TODO.  New tabs are white in dark mode.
-
 // 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,
         DownloadFileDialog.DownloadFileListener, DownloadImageDialog.DownloadImageListener, DownloadLocationPermissionDialog.DownloadLocationPermissionDialogListener, EditBookmarkDialog.EditBookmarkListener,
@@ -611,8 +609,10 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
 
             @Override
             public void afterTextChanged(Editable s) {
-                // Search for the text in `mainWebView`.
-                currentWebView.findAllAsync(findOnPageEditText.getText().toString());
+                // Search for the text in the WebView if it is not null.  Sometimes on resume after a period of non-use the WebView will be null.
+                if (currentWebView != null) {
+                    currentWebView.findAllAsync(findOnPageEditText.getText().toString());
+                }
             }
         });
 
@@ -894,8 +894,10 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
                     // Reset the current domain name so the domain settings will be reapplied.
                     nestedScrollWebView.resetCurrentDomainName();
 
-                    // Reapply the domain settings.
-                    applyDomainSettings(nestedScrollWebView, nestedScrollWebView.getUrl(), false, true);
+                    // Reapply the domain settings if the URL is not null, which can happen if an empty tab is active when returning from settings.
+                    if (nestedScrollWebView.getUrl() != null) {
+                        applyDomainSettings(nestedScrollWebView, nestedScrollWebView.getUrl(), false, true);
+                    }
                 }
             }
         }
@@ -4226,23 +4228,37 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
             // Update the privacy icons.  `true` redraws the icons in the app bar.
             updatePrivacyIcons(true);
 
-            // Clear the focus from the URL text box.
-            urlEditText.clearFocus();
-
             // Get a handle for the input method manager.
             InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
 
             // Remove the lint warning below that the input method manager might be null.
             assert inputMethodManager != null;
 
-            // Hide the soft keyboard.
-            inputMethodManager.hideSoftInputFromWindow(currentWebView.getWindowToken(), 0);
+            // Get the current URL.
+            String url = currentWebView.getUrl();
+
+            if ((url == null) || url.equals("about:blank")) {  // The WebView is blank.
+                // Display the hint in the URL edit text.
+                urlEditText.setText("");
+
+                // Request focus for the URL text box.
+                urlEditText.requestFocus();
 
-            // Display the current URL in the URL text box.
-            urlEditText.setText(currentWebView.getUrl());
+                // Display the keyboard.
+                inputMethodManager.showSoftInput(urlEditText, 0);
+            } else {  // The WebView has a loaded URL.
+                // Clear the focus from the URL text box.
+                urlEditText.clearFocus();
 
-            // Highlight the URL text.
-            highlightUrlText();
+                // Hide the soft keyboard.
+                inputMethodManager.hideSoftInputFromWindow(currentWebView.getWindowToken(), 0);
+
+                // Display the current URL in the URL text box.
+                urlEditText.setText(url);
+
+                // Highlight the URL text.
+                highlightUrlText();
+            }
 
             // Set the background to indicate the domain settings status.
             if (currentWebView.getDomainSettingsApplied()) {
@@ -4481,7 +4497,7 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
             @Override
             public void onProgressChanged(WebView view, int progress) {
                 // Inject the night mode CSS if night mode is enabled.
-                if (nestedScrollWebView.getNightMode()) {
+                if (nestedScrollWebView.getNightMode()) {  // Night mode is enabled.
                     // `background-color: #212121` sets the background to be dark gray.  `color: #BDBDBD` sets the text color to be light gray.  `box-shadow: none` removes a lower underline on links
                     // used by WordPress.  `text-decoration: none` removes all text underlines.  `text-shadow: none` removes text shadows, which usually have a hard coded color.
                     // `border: none` removes all borders, which can also be used to underline text.  `a {color: #1565C0}` sets links to be a dark blue.
@@ -4503,6 +4519,11 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
                         // Display the WebView after 500 milliseconds.
                         displayWebViewHandler.postDelayed(displayWebViewRunnable, 500);
                     });
+                } else {  // Night mode is disabled.
+                    // Display the nested scroll WebView if night mode is disabled.
+                    // Because of a race condition between `applyDomainSettings` and `onPageStarted`,
+                    // when night mode is set by domain settings the WebView may be hidden even if night mode is not currently enabled.
+                    nestedScrollWebView.setVisibility(View.VISIBLE);
                 }
 
                 // Update the progress bar.
@@ -4516,13 +4537,6 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
                     // Hide the progress bar.
                     progressBar.setVisibility(View.GONE);
 
-                    // Display the nested scroll WebView if night mode is disabled.
-                    // Because of a race condition between `applyDomainSettings` and `onPageStarted`,
-                    // when night mode is set by domain settings the WebView may be hidden even if night mode is not currently enabled.
-                    if (!nestedScrollWebView.getNightMode()) {
-                        nestedScrollWebView.setVisibility(View.VISIBLE);
-                    }
-
                     //Stop the swipe to refresh indicator if it is running
                     swipeRefreshLayout.setRefreshing(false);
                 }
@@ -5107,6 +5121,8 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
                 // If night mode is enabled, hide `mainWebView` until after the night mode CSS is applied.
                 if (nestedScrollWebView.getNightMode()) {
                     nestedScrollWebView.setVisibility(View.INVISIBLE);
+                } else {
+                    nestedScrollWebView.setVisibility(View.VISIBLE);
                 }
 
                 // Hide the keyboard.
@@ -5250,8 +5266,8 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
                             // Display the keyboard.
                             inputMethodManager.showSoftInput(urlEditText, 0);
 
-                            // Hide the WebView, which causes the default background color to be displayed according to the theme.  // TODO
-                            nestedScrollWebView.setVisibility(View.GONE);
+                            // Hide the WebView, which causes the default background color to be displayed according to the theme.
+                            nestedScrollWebView.setVisibility(View.INVISIBLE);
 
                             // Apply the domain settings.  This clears any settings from the previous domain.
                             applyDomainSettings(nestedScrollWebView, "", true, false);
index 66111de7c351185668e5ffbcc71082beac11f118..050ae1dd502437c302383e2b86c5079c6419751a 100644 (file)
@@ -24,7 +24,6 @@ import android.os.AsyncTask;
 
 import androidx.fragment.app.FragmentManager;
 
-import com.stoutner.privacybrowser.activities.MainWebViewActivity;
 import com.stoutner.privacybrowser.helpers.CheckPinnedMismatchHelper;
 import com.stoutner.privacybrowser.views.NestedScrollWebView;
 
index 3b28d663321c6a20b865c7ab350e552fb5aff136..4001345b14037b1497f734f58b6e30b4b1b42c2f 100644 (file)
@@ -25,6 +25,7 @@ import android.content.Intent;
 import android.content.SharedPreferences;
 import android.os.Build;
 import android.os.Bundle;
+import android.os.Handler;
 import android.preference.Preference;
 import android.preference.PreferenceCategory;
 import android.preference.PreferenceFragment;
@@ -942,11 +943,23 @@ public class SettingsFragment extends PreferenceFragment {
                     // Assert that the intent is not null to remove the lint error below.
                     assert allowScreenshotsRestartIntent != null;
 
-                    // `Intent.FLAG_ACTIVITY_CLEAR_TASK` removes all activities from the stack.  It requires `Intent.FLAG_ACTIVITY_NEW_TASK`.  TODO.
+                    // `Intent.FLAG_ACTIVITY_CLEAR_TASK` removes all activities from the stack.  It requires `Intent.FLAG_ACTIVITY_NEW_TASK`.
                     allowScreenshotsRestartIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
 
-                    // Make it so.
-                    startActivity(allowScreenshotsRestartIntent);
+                    // Create a handler to restart the activity.
+                    Handler allowScreenshotsRestartHandler = new Handler();
+
+                    // Create a runnable to restart the activity.
+                    Runnable allowScreenshotsRestartRunnable = () -> {
+                        // Restart the activity.
+                        startActivity(allowScreenshotsRestartIntent);
+
+                        // Kill this instance of Privacy Browser.  Otherwise, the app exhibits sporadic behavior after the restart.
+                        System.exit(0);
+                    };
+
+                    // Restart the activity after 100 milliseconds, so that the app has enough time to save the change to the preference.
+                    allowScreenshotsRestartHandler.postDelayed(allowScreenshotsRestartRunnable, 100);
                     break;
 
                 case "easylist":
@@ -1482,11 +1495,23 @@ public class SettingsFragment extends PreferenceFragment {
                     // Assert that the intent is not null to remove the lint error below.
                     assert changeThemeRestartIntent != null;
 
-                    // `Intent.FLAG_ACTIVITY_CLEAR_TASK` removes all activities from the stack.  It requires `Intent.FLAG_ACTIVITY_NEW_TASK`.  TODO.
+                    // `Intent.FLAG_ACTIVITY_CLEAR_TASK` removes all activities from the stack.  It requires `Intent.FLAG_ACTIVITY_NEW_TASK`.
                     changeThemeRestartIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
 
-                    // Make it so.
-                    startActivity(changeThemeRestartIntent);
+                    // Create a handler to restart the activity.
+                    Handler changeThemeRestartHandler = new Handler();
+
+                    // Create a runnable to restart the activity.
+                    Runnable changeThemeRestartRunnable = () -> {
+                        // Restart the activity.
+                        startActivity(changeThemeRestartIntent);
+
+                        // Kill this instance of Privacy Browser.  Otherwise, the app exhibits sporadic behavior after the restart.
+                        System.exit(0);
+                    };
+
+                    // Restart the activity after 100 milliseconds, so that the app has enought time to save the change to the preference.
+                    changeThemeRestartHandler.postDelayed(changeThemeRestartRunnable, 100);
                     break;
 
                 case "night_mode":
index a65867505cce867602f50a3ed6d7968758c961e3..a04ab57c0a31fc61f4ebe649fab30e956e3df657 100644 (file)
@@ -39,7 +39,7 @@
         android:id="@+id/spinner_item_textview"
         android:layout_height="wrap_content"
         android:layout_width="match_parent"
-        android:maxLines="1"
+        android:lines="1"
         android:ellipsize="end"
         android:paddingStart="20dp"
         android:paddingEnd="20dp"
index 3b79130b28f7fc7cccb118626ded0e7d656ad0cd..edc8d7c9d1c23d0618784b89808a59c7e9e1f64f 100644 (file)
@@ -38,7 +38,7 @@
         android:id="@+id/spinner_item_textview"
         android:layout_height="wrap_content"
         android:layout_width="match_parent"
-        android:maxLines="1"
+        android:lines="1"
         android:ellipsize="end"
         android:paddingStart="10dp"
         android:paddingEnd="10dp"
index 6cd123d17e15a5b73ba6795fb13cd6f372d368e8..83501e81b38bf7ee93affbde9815cc1543c5842e 100644 (file)
@@ -44,6 +44,6 @@
         android:textColor="?android:attr/textColorPrimary"
         android:textSize="22sp"
         android:layout_margin="10dp"
-        android:maxLines="1"
+        android:lines="1"
         android:ellipsize="end" />
 </LinearLayout>
\ No newline at end of file
index 85031f9b34ddf1a80dbda0069cfa02187ba280c4..dda54ea8594fb145b61fe2e6c9034615fb674341 100644 (file)
@@ -60,7 +60,7 @@
             android:textColor="?android:attr/textColorPrimary"
             android:textSize="22sp"
             android:ellipsize="end"
-            android:maxLines="1" />
+            android:lines="1" />
     </LinearLayout>
 
     <!-- Second row. -->
@@ -73,7 +73,7 @@
         android:textColor="?android:attr/textColorPrimary"
         android:textSize="22sp"
         android:ellipsize="end"
-        android:maxLines="1" />
+        android:lines="1" />
 
     <!-- Third row. -->
     <LinearLayout
             android:textSize="22sp"
             android:textStyle="italic"
             android:ellipsize="end"
-            android:maxLines="1" />
+            android:lines="1" />
     </LinearLayout>
 </LinearLayout>
\ No newline at end of file
index 3009a352b75a17aa767f265ca21346a3b3d35bad..203685dd5fe52ea2c8fc97d4bc6131050ab78960 100644 (file)
@@ -43,6 +43,6 @@
         android:textColor="?android:attr/textColorPrimary"
         android:textSize="22sp"
         android:layout_margin="10dp"
-        android:maxLines="1"
+        android:lines="1"
         android:ellipsize="end" />
 </LinearLayout>
\ No newline at end of file
index 5e3c1ff0b603abf47a49c5a89077c12c00534be4..9efa9ef146a339d97cd2a9c1fa6b2b4f7fcf4612 100644 (file)
 
     <!-- A `CheckedTextView` allows the color of the text to be changed when it is selected (checked). -->
     <CheckedTextView
-        xmlns:android="http://schemas.android.com/apk/res/android"
         android:id="@+id/spinner_item_textview"
         android:layout_height="wrap_content"
         android:layout_width="match_parent"
-        android:maxLines="1"
+        android:lines="1"
         android:ellipsize="end"
         android:paddingStart="20dp"
         android:paddingEnd="20dp"
index e254b4983d7ef87f2064c751be2f81ca3a001737..0f65382ac0655281e74dd94b7459633725d53a6d 100644 (file)
         tools:ignore="contentDescription" />
 
     <TextView
-        xmlns:android="http://schemas.android.com/apk/res/android"
         android:id="@+id/spinner_item_textview"
         android:layout_height="wrap_content"
         android:layout_width="match_parent"
-        android:maxLines="1"
+        android:lines="1"
         android:ellipsize="end"
         android:paddingStart="10dp"
         android:paddingEnd="10dp"
index d2a22cc01ba14a5825a8465b7d228a6b0f709156..c80a38d85ba02b5f122f4107cf98781390ec1364 100644 (file)
@@ -33,6 +33,6 @@
         android:textColor="?android:attr/textColorPrimary"
         android:textSize="22sp"
         android:layout_margin="10dp"
-        android:maxLines="1"
+        android:lines="1"
         android:ellipsize="end" />
 </LinearLayout>
\ No newline at end of file
index 6d746b6b123a7fc293a4fd5297fef947c97cea1f..d0b6eb12f982ae78911361c25004756987fe09d1 100644 (file)
@@ -23,7 +23,7 @@
     android:id="@+id/spinner_dropdown_item_textview"
     android:layout_height="wrap_content"
     android:layout_width="match_parent"
-    android:maxLines="1"
+    android:lines="1"
     android:ellipsize="end"
     android:gravity="center_vertical"
     android:paddingStart="16dp"
index a4b3bd17b9dee74fd2a2d9f01dd4850e646094d6..02bc3d778b14ef5336cb4ac6be70ab408116ee9a 100644 (file)
@@ -41,7 +41,7 @@
         android:layout_height="wrap_content"
         android:layout_width="wrap_content"
         android:layout_margin="10dp"
-        android:maxLines="1"
+        android:lines="1"
         android:textColor="?android:attr/textColorPrimary"
         android:textSize="22sp" />
 </LinearLayout>
\ No newline at end of file
index 6c9fd9d0c8dffa4cb36c01824d72ab4fc44d8453..5021ab0de55847e9e806582b1f3ae3301adc7222 100644 (file)
@@ -24,7 +24,7 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_height="wrap_content"
     android:layout_width="match_parent"
-    android:maxLines="1"
+    android:lines="1"
     android:ellipsize="end"
     android:paddingStart="20dp"
     android:paddingEnd="20dp"
index 459f85472918bc9db918811e558ed472db527ae2..4d70750541d2de65193f67ceac1b18d713c477a1 100644 (file)
@@ -23,7 +23,7 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_height="wrap_content"
     android:layout_width="match_parent"
-    android:maxLines="1"
+    android:lines="1"
     android:ellipsize="end"
     android:paddingStart="10dp"
     android:paddingEnd="10dp"
index b0489d74ea6b7ba65bf978b29db9a58ada0a2f23..fee278268597a6ad143360960f39291f04c770ae 100644 (file)
@@ -38,6 +38,6 @@
         android:layout_width="wrap_content"
         android:layout_margin="10dp"
         android:textSize="16sp"
-        android:maxLines="1"
+        android:lines="1"
         android:ellipsize="end" />
 </LinearLayout>
\ No newline at end of file
index 7105179b14dea0a0fe913622d4f31eb0e3822ec6..8467f38c0bf279e2025ff44b98b474bae4579991 100644 (file)
@@ -24,7 +24,7 @@
     android:id="@+id/spinner_item_textview"
     android:layout_height="wrap_content"
     android:layout_width="match_parent"
-    android:maxLines="1"
+    android:lines="1"
     android:ellipsize="end"
     android:paddingStart="20dp"
     android:paddingEnd="20dp"
index 5bc6f820def73ce8c8bf02b976f8245e8482bfc9..62b737b689bbde1346235e3c0752a831a2f5bb9d 100644 (file)
@@ -23,7 +23,7 @@
     android:id="@+id/spinner_item_textview"
     android:layout_height="wrap_content"
     android:layout_width="match_parent"
-    android:maxLines="1"
+    android:lines="1"
     android:ellipsize="end"
     android:paddingStart="10dp"
     android:paddingEnd="10dp"
index b6e7338d1aec18b67508ebf12f38744c2912953e..e099fc8b28431cc212e096cb00d41d42e83dd851 100644 (file)
@@ -41,6 +41,6 @@
         android:textColor="?attr/urlHistoryText"
         android:textSize="16sp"
         android:layout_margin="10dp"
-        android:maxLines="1"
+        android:lines="1"
         android:ellipsize="end"/>
 </LinearLayout>
\ No newline at end of file
index 27e62773a17c63e3d267c2fc0b95963eddd2e685..0243a062ee2aea65ee3f356bd142cb8c3bdc15c5 100644 (file)
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
-    android:layout_height="match_parent" >
+    android:layout_height="match_parent"
+    android:background="?attr/webViewBackground" >
 
+    <!-- The WebView is initially `visibility="invisible"` so that the background color matches the theme. -->
     <com.stoutner.privacybrowser.views.NestedScrollWebView
         android:id="@+id/nestedscroll_webview"
         android:layout_height="match_parent"
         android:layout_width="match_parent"
         android:focusable="true"
-        android:focusableInTouchMode="true" />
+        android:focusableInTouchMode="true"
+        android:visibility="invisible" />
 
     <!-- `android:max` changes the maximum `ProgressBar` value from 10000 to 100 to match progress percentage.
         `android:layout_height="2dp"` works best for API >= 23, but `3dp` is required for visibility on API <= 22.
index 1daae7692b9aad4d5deccec9eb6aafa080cc3c9c..6d4b83926e54708bee0b1d1fa4640b7cc53302d3 100644 (file)
     <!-- `android:windowTranslucentStatus` makes the system status bar translucent.  When it is specified the root layout should include `android:fitsSystemWindows="true"`. -->
     <style name="PrivacyBrowserLight" parent="Theme.AppCompat.Light.NoActionBar" >
         <item name="aboutIcon">@drawable/about_light</item>
-        <item name="android:windowTranslucentStatus">true</item>
         <item name="addTabIconTintColor">@color/gray_700</item>
+        <item name="android:textColorHighlight">@color/blue_200</item>
         <item name="android:textColorPrimary">@color/primary_text_color_selector_light</item>
+        <item name="android:windowTranslucentStatus">true</item>
+        <item name="appBarTheme">@style/PrivacyBrowserAppBarLight</item>
         <item name="colorAccent">@color/blue_700</item>
         <item name="dialogTabLayoutTheme">@style/PrivacyBrowserTabLayoutDialogLight</item>
-        <item name="android:textColorHighlight">@color/blue_200</item>
         <item name="mainStatusBarBackground">@color/gray_500</item>
         <item name="navigationHeaderBackground">@color/blue_700</item>
         <item name="navigationHeaderTextColor">@color/white</item>
-        <item name="appBarTheme">@style/PrivacyBrowserAppBarLight</item>
         <item name="navigationIconTintColor">@color/blue_800</item>
         <item name="findOnPageIconTintColor">@color/blue_800</item>
         <item name="progressTintColor">@color/blue_700</item>
@@ -42,6 +42,7 @@
         <item name="sslTitle">@color/blue_900</item>
         <item name="urlHistoryText">@color/black</item>
         <item name="viewSourceIconTintColor">@color/black</item>
+        <item name="webViewBackground">@color/gray_50</item>
     </style>
 
     <!-- `windowActionModeOverlay` makes the contextual app bar cover the support app bar. -->
     <!-- `android:windowTranslucentStatus` makes the system status bar translucent.  When it is specified the root layout should include `android:fitsSystemWindows="true"`. -->
     <style name="PrivacyBrowserDark" parent="Theme.AppCompat.NoActionBar" >
         <item name="aboutIcon">@drawable/about_dark</item>
-        <item name="android:windowTranslucentStatus">true</item>
         <item name="addTabIconTintColor">@color/gray_400</item>
+        <item name="android:textColorHighlight">@color/blue_800</item>
         <item name="android:textColorPrimary">@color/primary_text_color_selector_dark</item>
+        <item name="android:windowTranslucentStatus">true</item>
+        <item name="appBarTheme">@style/PrivacyBrowserAppBarDark</item>
         <item name="colorAccent">@color/blue_600</item>
-        <item name="android:textColorHighlight">@color/blue_800</item>
         <item name="mainStatusBarBackground">@color/black</item>
         <item name="navigationHeaderBackground">@color/blue_800</item>
         <item name="navigationHeaderTextColor">@color/gray_300</item>
-        <item name="appBarTheme">@style/PrivacyBrowserAppBarDark</item>
         <item name="findOnPageIconTintColor">@color/blue_600</item>
         <item name="navigationIconTintColor">@color/blue_600</item>
         <item name="progressTintColor">@color/blue_600</item>
         <item name="sslTitle">@color/blue_700</item>
         <item name="urlHistoryText">@color/gray_200</item>
         <item name="viewSourceIconTintColor">@color/gray_300</item>
+        <item name="webViewBackground">@color/gray_900</item>
     </style>
 
     <!-- `windowActionModeOverlay` makes the contextual app bar cover the support app bar.  `colorPrimaryDark` goes behind the status bar, which is then darkened by the overlay.-->
index e0e767e33e2ef1855af0460e3264e66813d8e08a..3632b7ccae5fda5dc82d049f21e41d0c5d3ae255 100644 (file)
@@ -39,6 +39,7 @@
     <attr name="spinnerBackground" format="reference" />
     <attr name="spinnerTextColorSelector" format="reference" />
     <attr name="urlHistoryText" format="reference" />
+    <attr name="webViewBackground" format="reference" />
 
     <attr name="navigationHeaderBackground" format="reference" />
     <attr name="navigationHeaderTextColor" format="reference" />
index 0bcee21df1196c094057afdfcb84fba4c45aea77..bb10d238eda8c527d4f7175d9d03def9eda58d77 100644 (file)
@@ -53,6 +53,7 @@
 
     <color name="dark_green_15">#FF163317</color>
 
+    <color name="gray_50">#FFFAFAFA</color>
     <color name="gray_100">#FFF5F5F5</color>
     <color name="gray_200">#FFEEEEEE</color>
     <color name="gray_300">#FFE0E0E0</color>
index c8af48ff513778ded045e3788e1ed137df506c4a..694ed6b6d1fbee185ecac225088e5058a4c47b87 100644 (file)
     <!-- `android:windowTranslucentStatus` makes the system status bar translucent.  When it is specified the root layout should include `android:fitsSystemWindows="true"`. -->
     <style name="PrivacyBrowserLight" parent="Theme.AppCompat.Light.NoActionBar" >
         <item name="aboutIcon">@drawable/about_light</item>
-        <item name="android:windowTranslucentStatus">true</item>
         <item name="addTabIconTintColor">@color/gray_700</item>
+        <item name="android:textColorHighlight">@color/blue_200</item>
         <item name="android:textColorPrimary">@color/primary_text_color_selector_light</item>
+        <item name="android:windowTranslucentStatus">true</item>
+        <item name="appBarTheme">@style/PrivacyBrowserAppBarLight</item>
         <item name="colorAccent">@color/blue_700</item>
         <item name="dialogTabLayoutTheme">@style/PrivacyBrowserTabLayoutDialogLight</item>
-        <item name="android:textColorHighlight">@color/blue_200</item>
         <item name="mainStatusBarBackground">@color/gray_500</item>
         <item name="navigationHeaderBackground">@color/blue_700</item>
         <item name="navigationHeaderTextColor">@color/white</item>
-        <item name="appBarTheme">@style/PrivacyBrowserAppBarLight</item>
         <item name="navigationIconTintColor">@color/blue_800</item>
         <item name="findOnPageIconTintColor">@color/blue_800</item>
         <item name="progressTintColor">@color/blue_700</item>
@@ -42,6 +42,7 @@
         <item name="sslTitle">@color/blue_900</item>
         <item name="urlHistoryText">@color/black</item>
         <item name="viewSourceIconTintColor">@color/black</item>
+        <item name="webViewBackground">@color/gray_50</item>
     </style>
 
     <!-- `windowActionModeOverlay` makes the contextual app bar cover the support app bar. -->
     <!-- `android:windowTranslucentStatus` makes the system status bar translucent.  When it is specified the root layout should include `android:fitsSystemWindows="true"`. -->
     <style name="PrivacyBrowserDark" parent="Theme.AppCompat.NoActionBar" >
         <item name="aboutIcon">@drawable/about_dark</item>
-        <item name="android:windowTranslucentStatus">true</item>
         <item name="addTabIconTintColor">@color/gray_400</item>
+        <item name="android:textColorHighlight">@color/blue_800</item>
         <item name="android:textColorPrimary">@color/primary_text_color_selector_dark</item>
+        <item name="android:windowTranslucentStatus">true</item>
+        <item name="appBarTheme">@style/PrivacyBrowserAppBarDark</item>
         <item name="colorAccent">@color/blue_600</item>
-        <item name="android:textColorHighlight">@color/blue_800</item>
         <item name="mainStatusBarBackground">@color/black</item>
         <item name="navigationHeaderBackground">@color/blue_800</item>
         <item name="navigationHeaderTextColor">@color/gray_300</item>
-        <item name="appBarTheme">@style/PrivacyBrowserAppBarDark</item>
         <item name="findOnPageIconTintColor">@color/blue_600</item>
         <item name="navigationIconTintColor">@color/blue_600</item>
         <item name="progressTintColor">@color/blue_600</item>
         <item name="sslTitle">@color/blue_700</item>
         <item name="urlHistoryText">@color/gray_200</item>
         <item name="viewSourceIconTintColor">@color/gray_300</item>
+        <item name="webViewBackground">@color/gray_900</item>
     </style>
 
     <!-- `windowActionModeOverlay` makes the contextual app bar cover the support app bar.  `colorPrimaryDark` goes behind the status bar, which is then darkened by the overlay.-->