Create a dark theme for the `AlertDialogs`.
authorSoren Stoutner <soren@stoutner.com>
Sat, 17 Jun 2017 19:05:14 +0000 (12:05 -0700)
committerSoren Stoutner <soren@stoutner.com>
Sat, 17 Jun 2017 19:05:14 +0000 (12:05 -0700)
24 files changed:
app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
app/src/main/java/com/stoutner/privacybrowser/dialogs/AddDomainDialog.java
app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateBookmarkDialog.java
app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateBookmarkFolderDialog.java
app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateHomeScreenShortcutDialog.java
app/src/main/java/com/stoutner/privacybrowser/dialogs/DownloadFileDialog.java
app/src/main/java/com/stoutner/privacybrowser/dialogs/DownloadImageDialog.java
app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkDialog.java
app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkFolderDialog.java
app/src/main/java/com/stoutner/privacybrowser/dialogs/MoveToFolderDialog.java
app/src/main/java/com/stoutner/privacybrowser/dialogs/SslCertificateErrorDialog.java
app/src/main/java/com/stoutner/privacybrowser/dialogs/UrlHistoryDialog.java
app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewSslCertificateDialog.java
app/src/main/java/com/stoutner/privacybrowser/helpers/OrbotProxyHelper.java
app/src/main/res/layout/create_home_screen_shortcut_dialog.xml
app/src/main/res/layout/edit_bookmark_dialog.xml
app/src/main/res/layout/edit_bookmark_folder_dialog.xml
app/src/main/res/layout/ssl_certificate_error.xml
app/src/main/res/layout/url_history_dialog.xml
app/src/main/res/layout/url_history_item_linearlayout.xml
app/src/main/res/layout/view_ssl_certificate.xml
app/src/main/res/values/attrs.xml
app/src/main/res/values/colors.xml
app/src/main/res/values/styles.xml

index 02f3742f179468bd309cea8788235046733b433a..06b4c4c4a136a94704b6def631df7bb3e80bfe76 100644 (file)
@@ -122,7 +122,9 @@ import java.util.Set;
 public class MainWebViewActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener, CreateHomeScreenShortcutDialog.CreateHomeScreenSchortcutListener,
         SslCertificateErrorDialog.SslCertificateErrorListener, DownloadFileDialog.DownloadFileListener, DownloadImageDialog.DownloadImageListener, UrlHistoryDialog.UrlHistoryListener {
 
-    // `darkTheme` is public static so it can be accessed from `AboutActivity` and `GuideActivity`.  It is also used in `onCreate()`, `applyAppSettings()`, and `applyDomainSettings()`.
+    // `darkTheme` is public static so it can be accessed from `AboutActivity`, `GuideActivity`, `AddDomainDialog`, `CreateBookmarkDialog`, `CreateBookmarkFolderDialog`, `DownloadFileDialog`, `DownloadImageDialog`, `EditBookmarkDialog`,
+    // `EditBookmarkFolderDialog`, `MoveToFolderDialog`, `SslCertificateErrorDialog`, `UrlHistoryDialog`, `ViewSslCertificateDialog`, `CreateHomeScreenShortcutDialog`, and `OrbotProxyHelper`.
+    // It is also used in `onCreate()`, `applyAppSettings()`, and `applyDomainSettings()`.
     public static boolean darkTheme;
 
     // `favoriteIconBitmap` is public static so it can be accessed from `CreateHomeScreenShortcutDialog`, `BookmarksActivity`, `CreateBookmarkDialog`, `CreateBookmarkFolderDialog`, `EditBookmarkDialog`, `EditBookmarkFolderDialog`, `ViewSslCertificateDialog`.
index 4d99a20655258ab012af57574b76725efb2d2d8e..9e63a9405207a97bfbdb9fe48b305af0736dc094 100644 (file)
@@ -63,10 +63,20 @@ public class AddDomainDialog extends AppCompatDialogFragment {
     @Override
     @NonNull
     public Dialog onCreateDialog(Bundle savedInstanceState) {
-        // Use `AlertDialog.Builder` to create the `AlertDialog`.  The style formats the color of the button text.
-        AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+        // Use `AlertDialog.Builder` to create the `AlertDialog`.
+        AlertDialog.Builder dialogBuilder;
+
+        // Set the style according to the theme.
+        if (MainWebViewActivity.darkTheme) {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+        } else {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+        }
+
+        // Set the title.
         dialogBuilder.setTitle(R.string.add_domain);
-        // The parent view is `null` because it will be assigned by the `AlertDialog`.
+
+        // Set the view.  The parent view is `null` because it will be assigned by the `AlertDialog`.
         dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.add_domain_dialog, null));
 
         // Set an `onClick()` listener for the negative button.
index e6efc7077e9ca36ef037b12e1019fe5dac8db969..60863a9c9d3c430e15a1fd99aedde5d178ecf563 100644 (file)
@@ -67,11 +67,21 @@ public class CreateBookmarkDialog extends AppCompatDialogFragment {
         // Create a drawable version of the favorite icon.
         Drawable favoriteIconDrawable = new BitmapDrawable(getResources(), MainWebViewActivity.favoriteIconBitmap);
 
-        // Use `AlertDialog.Builder` to create the `AlertDialog`.  The style formats the color of the button text.
-        AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+        // Use `AlertDialog.Builder` to create the `AlertDialog`.
+        AlertDialog.Builder dialogBuilder;
+
+        // Set the style according to the theme.
+        if (MainWebViewActivity.darkTheme) {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+        } else {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+        }
+
+        // Set the title and icon.
         dialogBuilder.setTitle(R.string.create_bookmark);
         dialogBuilder.setIcon(favoriteIconDrawable);
-        // The parent view is `null` because it will be assigned by the `AlertDialog`.
+
+        // Set the view.  The parent view is `null` because it will be assigned by the `AlertDialog`.
         dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.create_bookmark_dialog, null));
 
         // Set an `onClick()` listener for the negative button.
index d703a394f30ec6dd688901eae556e92c3b7257a1..dfa2fc63fe884248639d7a782dc89abc630b7a4c 100644 (file)
@@ -62,10 +62,20 @@ public class CreateBookmarkFolderDialog extends AppCompatDialogFragment {
     @Override
     @NonNull
     public Dialog onCreateDialog(Bundle savedInstanceState) {
-        // Use `AlertDialog.Builder` to create the `AlertDialog`.  The style formats the color of the button text.
-        final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+        // Use `AlertDialog.Builder` to create the `AlertDialog`.
+        AlertDialog.Builder dialogBuilder;
+
+        // Set the style according to the theme.
+        if (MainWebViewActivity.darkTheme) {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+        } else {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+        }
+
+        // Set the title.
         dialogBuilder.setTitle(R.string.create_folder);
-        // The parent view is `null` because it will be assigned by the `AlertDialog`.
+
+        // Set the view.  The parent view is `null` because it will be assigned by the `AlertDialog`.
         dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.create_bookmark_folder_dialog, null));
 
         // Set an `onClick()` listener for the negative button.
index 89e27f5439204e43c981175c86bd8bc90f1ef08b..dbda6c791afe5c0fe9aca4745da68fba7185264c 100644 (file)
@@ -69,11 +69,21 @@ public class CreateHomeScreenShortcutDialog extends AppCompatDialogFragment {
         // Create a drawable version of the favorite icon.
         Drawable favoriteIconDrawable = new BitmapDrawable(getResources(), MainWebViewActivity.favoriteIconBitmap);
 
-        // Use `AlertDialog.Builder` to create the `AlertDialog`.  `R.style.LightAlertDialog` formats the color of the button text.
-        AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+        // Use `AlertDialog.Builder` to create the `AlertDialog`.
+        AlertDialog.Builder dialogBuilder;
+
+        // Set the style according to the theme.
+        if (MainWebViewActivity.darkTheme) {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+        } else {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+        }
+
+        // Set the title and icon.
         dialogBuilder.setTitle(R.string.create_shortcut);
         dialogBuilder.setIcon(favoriteIconDrawable);
-        // The parent view is `null` because it will be assigned by `AlertDialog`.
+
+        // Set the view.  The parent view is `null` because it will be assigned by `AlertDialog`.
         dialogBuilder.setView(layoutInflater.inflate(R.layout.create_home_screen_shortcut_dialog, null));
 
         // Set an `onClick` listener on the negative button.
index a348fb90cc109580f8ba229f32bd75d464d879be..a496eb2075810042569d126019e307b644d59f29 100644 (file)
@@ -37,6 +37,7 @@ import android.widget.EditText;
 import android.widget.TextView;
 
 import com.stoutner.privacybrowser.R;
+import com.stoutner.privacybrowser.activities.MainWebViewActivity;
 
 import java.util.Locale;
 
@@ -122,8 +123,15 @@ public class DownloadFileDialog extends AppCompatDialogFragment {
         // Get the activity's layout inflater.
         LayoutInflater layoutInflater = getActivity().getLayoutInflater();
 
-        // Use `AlertDialog.Builder` to create the `AlertDialog`.  `R.style.lightAlertDialog` formats the color of the button text.
-        AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+        // Use `AlertDialog.Builder` to create the `AlertDialog`.
+        AlertDialog.Builder dialogBuilder;
+
+        // Set the style according to the theme.
+        if (MainWebViewActivity.darkTheme) {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+        } else {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+        }
 
         // Set the title.
         dialogBuilder.setTitle(R.string.save_as);
index 7a0aeccd89b9a8a2fe07107c3eb0d322b6fce5a5..c6bcb6fbd5cfba16f2064dc3e0fd4199c66758ab 100644 (file)
@@ -36,6 +36,7 @@ import android.view.WindowManager;
 import android.widget.EditText;
 
 import com.stoutner.privacybrowser.R;
+import com.stoutner.privacybrowser.activities.MainWebViewActivity;
 
 // `android.support.v7.app.AlertDialog` uses more of the horizontal screen real estate versus `android.app.AlertDialog's` smaller width.
 // We have to use `AppCompatDialogFragment` instead of `DialogFragment` or an error is produced on API <=22.
@@ -99,10 +100,20 @@ public class DownloadImageDialog extends AppCompatDialogFragment {
         // Get the activity's layout inflater.
         LayoutInflater layoutInflater = getActivity().getLayoutInflater();
 
-        // Use `AlertDialog.Builder` to create the `AlertDialog`.  `R.style.lightAlertDialog` formats the color of the button text.
-        AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+        // Use `AlertDialog.Builder` to create the `AlertDialog`.
+        AlertDialog.Builder dialogBuilder;
+
+        // Set the style according to the theme.
+        if (MainWebViewActivity.darkTheme) {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+        } else {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+        }
+
+        // Set the title.
         dialogBuilder.setTitle(R.string.save_image_as);
-        // The parent view is `null` because it will be assigned by `AlertDialog`.
+
+        // Set the view.  The parent view is `null` because it will be assigned by `AlertDialog`.
         dialogBuilder.setView(layoutInflater.inflate(R.layout.download_image_dialog, null));
 
         // Set an `onClick()` listener on the negative button.
index 6e868ee7433a57b9a16c729aa7f58b05abd9c4f5..117d58400eb67c36775b6410cb9fe2b968ac8407 100644 (file)
@@ -75,10 +75,20 @@ public class EditBookmarkDialog extends AppCompatDialogFragment {
         Cursor bookmarkCursor = BookmarksActivity.bookmarksDatabaseHelper.getBookmarkCursor(selectedBookmarkDatabaseId);
         bookmarkCursor.moveToFirst();
 
-        // Use `AlertDialog.Builder` to create the `AlertDialog`.  The style formats the color of the button text.
-        AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+        // Use `AlertDialog.Builder` to create the `AlertDialog`.
+        AlertDialog.Builder dialogBuilder;
+
+        // Set the style according to the theme.
+        if (MainWebViewActivity.darkTheme) {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+        } else {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+        }
+
+        // Set the title.
         dialogBuilder.setTitle(R.string.edit_bookmark);
-        // The parent view is `null` because it will be assigned by `AlertDialog`.
+
+        // Set the view.  The parent view is `null` because it will be assigned by `AlertDialog`.
         dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.edit_bookmark_dialog, null));
 
         // Set an `onClick()` listener for the negative button.
index bccd8006c8d6eed13bab128e219fc48c68590232..ae56135478b5ada5a96ce0922557af5602f3a945 100644 (file)
@@ -75,10 +75,20 @@ public class EditBookmarkFolderDialog extends AppCompatDialogFragment {
         Cursor bookmarkCursor = BookmarksActivity.bookmarksDatabaseHelper.getBookmarkCursor(selectedBookmarkDatabaseId);
         bookmarkCursor.moveToFirst();
 
-        // Use `AlertDialog.Builder` to create the `AlertDialog`.  The style formats the color of the button text.
-        AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+        // Use `AlertDialog.Builder` to create the `AlertDialog`.
+        AlertDialog.Builder dialogBuilder;
+
+        // Set the style according to the theme.
+        if (MainWebViewActivity.darkTheme) {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+        } else {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+        }
+
+        // Set the title.
         dialogBuilder.setTitle(R.string.edit_folder);
-        // The parent view is `null` because it will be assigned by `AlertDialog`.
+
+        // Set the view.  The parent view is `null` because it will be assigned by `AlertDialog`.
         dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.edit_bookmark_folder_dialog, null));
 
         // Set an `onClick()` listener for the negative button.
index 4e5b7f36309b15304b37f6e13f34e0e18dd68cf3..6eb09a31aa1134ff0c853331b5469f331e3bd70e 100644 (file)
@@ -46,6 +46,7 @@ import android.widget.TextView;
 
 import com.stoutner.privacybrowser.R;
 import com.stoutner.privacybrowser.activities.BookmarksActivity;
+import com.stoutner.privacybrowser.activities.MainWebViewActivity;
 import com.stoutner.privacybrowser.helpers.BookmarksDatabaseHelper;
 
 import java.io.ByteArrayOutputStream;
@@ -78,10 +79,20 @@ public class MoveToFolderDialog extends AppCompatDialogFragment {
     @Override
     @NonNull
     public Dialog onCreateDialog(Bundle savedInstanceState) {
-        // Use `AlertDialog.Builder` to create the `AlertDialog`.  The style formats the color of the button text.
-        AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+        // Use `AlertDialog.Builder` to create the `AlertDialog`.
+        AlertDialog.Builder dialogBuilder;
+
+        // Set the style according to the theme.
+        if (MainWebViewActivity.darkTheme) {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+        } else {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+        }
+
+        // Set the title.
         dialogBuilder.setTitle(R.string.move_to_folder);
-        // The parent view is `null` because it will be assigned by `AlertDialog`.
+
+        // Set the view.  The parent view is `null` because it will be assigned by `AlertDialog`.
         dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.move_to_folder_dialog, null));
 
         // Set an `onClick()` listener for the negative button.
index 78108d0a4d6ac9770b376d34e1c6e08a410e2e98..f0d5a69f860846f963b4162eb72e06107713740f 100644 (file)
@@ -37,6 +37,7 @@ import android.view.LayoutInflater;
 import android.widget.TextView;
 
 import com.stoutner.privacybrowser.R;
+import com.stoutner.privacybrowser.activities.MainWebViewActivity;
 
 import java.text.DateFormat;
 import java.util.Date;
@@ -134,10 +135,20 @@ public class SslCertificateErrorDialog extends AppCompatDialogFragment {
         // Get the activity's layout inflater.
         LayoutInflater layoutInflater = getActivity().getLayoutInflater();
 
-        // Use `AlertDialog.Builder` to create the `AlertDialog`.  `R.style.LightAlertDialog` formats the color of the button text.
-        AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+        // Use `AlertDialog.Builder` to create the `AlertDialog`.
+        AlertDialog.Builder dialogBuilder;
+
+        // Set the style according to the theme.
+        if (MainWebViewActivity.darkTheme) {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+        } else {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+        }
+
+        // Set the title.
         dialogBuilder.setTitle(R.string.ssl_certificate_error);
-        // The parent view is `null` because it will be assigned by `AlertDialog`.
+
+        // Set the view.  The parent view is `null` because it will be assigned by `AlertDialog`.
         dialogBuilder.setView(layoutInflater.inflate(R.layout.ssl_certificate_error, null));
 
         // Set an `onClick` listener on the negative button.  `null` doesn't do anything extra when the button is pressed.  The `Dialog` will automatically close.
@@ -196,9 +207,20 @@ public class SslCertificateErrorDialog extends AppCompatDialogFragment {
         SpannableStringBuilder startDateStringBuilder = new SpannableStringBuilder(startDateLabel + startDate);
         SpannableStringBuilder endDateStringBuilder = new SpannableStringBuilder((endDateLabel + endDate));
 
-        // Create the `ForegroundColorSpan`.  We have to use the deprecated `getColor` until API >= 23.
-        ForegroundColorSpan blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_700));
-        ForegroundColorSpan redColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.red_a700));
+        // Create a red `ForegroundColorSpan`.  We have to use the deprecated `getColor` until API >= 23.
+        @SuppressWarnings("deprecation") ForegroundColorSpan redColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.red_a700));
+
+        // Create a blue `ForegroundColorSpan`.
+        ForegroundColorSpan blueColorSpan;
+
+        // Set `blueColorSpan` according to the theme.  We have to use the deprecated `getColor()` until API >= 23.
+        if (MainWebViewActivity.darkTheme) {
+            //noinspection deprecation
+            blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_400));
+        } else {
+            //noinspection deprecation
+            blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_700));
+        }
 
         // Setup the spans to display the certificate information in blue.  `SPAN_INCLUSIVE_INCLUSIVE` allows the span to grow in either direction.
         urlStringBuilder.setSpan(blueColorSpan, urlLabel.length(), urlStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
index 3c418d393887053fe77caead7878fb73f9ebf140..299180320acb22ac841352115a166efac7a93591 100644 (file)
@@ -41,6 +41,7 @@ import android.widget.AdapterView;
 import android.widget.ListView;
 
 import com.stoutner.privacybrowser.R;
+import com.stoutner.privacybrowser.activities.MainWebViewActivity;
 import com.stoutner.privacybrowser.adapters.HistoryArrayAdapter;
 import com.stoutner.privacybrowser.definitions.History;
 
@@ -182,8 +183,15 @@ public class UrlHistoryDialog extends AppCompatDialogFragment{
         // Get the activity's layout inflater.
         LayoutInflater layoutInflater = getActivity().getLayoutInflater();
 
-        // Use `AlertDialog.Builder` to create the `AlertDialog`.  `R.style.lightAlertDialog` formats the color of the button text.
-        AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+        // Use `AlertDialog.Builder` to create the `AlertDialog`.
+        AlertDialog.Builder dialogBuilder;
+
+        // Set the style according to the theme.
+        if (MainWebViewActivity.darkTheme) {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+        } else {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+        }
 
         // Set the title.
         dialogBuilder.setTitle(R.string.history);
index 597a20f1cec1b9eb40868a3999bcd69b369a40e7..67395b829f32853168b82e7d94a649a8e9744e70 100644 (file)
@@ -50,8 +50,17 @@ public class ViewSslCertificateDialog extends DialogFragment {
         // Create a drawable version of the favorite icon.
         Drawable favoriteIconDrawable = new BitmapDrawable(getResources(), MainWebViewActivity.favoriteIconBitmap);
 
-        // Use `AlertDialog.Builder` to create the `AlertDialog`.  `R.style.LightAlertDialog` formats the color of the button text.
-        AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+        // Use `AlertDialog.Builder` to create the `AlertDialog`.
+        AlertDialog.Builder dialogBuilder;
+
+        // Set the style according to the theme.
+        if (MainWebViewActivity.darkTheme) {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+        } else {
+            dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+        }
+
+        // Set the icon.
         dialogBuilder.setIcon(favoriteIconDrawable);
 
         // Set an `onClick` listener on the negative button.  Using `null` closes the dialog without doing anything else.
@@ -127,10 +136,21 @@ public class ViewSslCertificateDialog extends DialogFragment {
             SpannableStringBuilder startDateStringBuilder = new SpannableStringBuilder(startDateLabel + DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.LONG).format(startDate));
             SpannableStringBuilder endDateStringBuilder = new SpannableStringBuilder(endDateLabel + DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.LONG).format(endDate));
 
-            // Create a blue `ForegroundColorSpan`.  We have to use the deprecated `getColor` until API >= 23.
-            @SuppressWarnings("deprecation") ForegroundColorSpan blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_700));
+            // Create a red `ForegroundColorSpan`.  We have to use the deprecated `getColor` until API >= 23.
             @SuppressWarnings("deprecation") ForegroundColorSpan redColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.red_a700));
 
+            // Create a blue `ForegroundColorSpan`.
+            ForegroundColorSpan blueColorSpan;
+
+            // Set `blueColorSpan` according to the theme.  We have to use the deprecated `getColor()` until API >= 23.
+            if (MainWebViewActivity.darkTheme) {
+                //noinspection deprecation
+                blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_400));
+            } else {
+                //noinspection deprecation
+                blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_700));
+            }
+
             // Setup the spans to display the certificate information in blue.  `SPAN_INCLUSIVE_INCLUSIVE` allows the span to grow in either direction.
             issuedToCNameStringBuilder.setSpan(blueColorSpan, cNameLabel.length(), issuedToCNameStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
             issuedToONameStringBuilder.setSpan(blueColorSpan, oNameLabel.length(), issuedToONameStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
index 2e1b22b692f6fb79b75cdcd80917da76662f8cf2..ef49afe1f9fc331da9f160050460aff800451ba7 100644 (file)
@@ -95,9 +95,20 @@ public class OrbotProxyHelper {
                     privacyBrowserContext.sendBroadcast(orbotIntent);
                 }
             } catch (PackageManager.NameNotFoundException exception){  // If an exception is thrown, Orbot is not installed.
-                // Build an `AlertDialog`.  `R.style.LightAlertDialog` formats the color of the button text.
-                AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(parentActivity, R.style.LightAlertDialog);
+                // Use `AlertDialog.Builder` to create the `AlertDialog`.
+                AlertDialog.Builder dialogBuilder;
+
+                // Set the style according to the theme.
+                if (MainWebViewActivity.darkTheme) {
+                    dialogBuilder = new AlertDialog.Builder(parentActivity, R.style.PrivacyBrowserAlertDialogDark);
+                } else {
+                    dialogBuilder = new AlertDialog.Builder(parentActivity, R.style.PrivacyBrowserAlertDialogLight);
+                }
+
+                // Set the message.
                 dialogBuilder.setMessage(R.string.orbot_proxy_not_installed);
+
+                // Set the positive button.
                 dialogBuilder.setPositiveButton(R.string.close, new DialogInterface.OnClickListener() {
                     @Override
                     public void onClick(DialogInterface dialog, int which) {
@@ -105,8 +116,10 @@ public class OrbotProxyHelper {
                     }
                 });
 
-                // Convert `dialogBuilder` to `alertDialog` and display it on the screen.
+                // Convert `dialogBuilder` to `alertDialog`.
                 AlertDialog alertDialog = dialogBuilder.create();
+
+                // Make it so.
                 alertDialog.show();
             }
         }
index 0d9309514c314b46480a55d35e9edc9cf1e7c4bb..eab00e8bda8fc33e4d4c14ded3ab1b49b194d50e 100644 (file)
@@ -33,7 +33,7 @@
         android:layout_marginEnd="4dp" >
 
         <!-- `android:imeOptions="actionGo"` sets the keyboard to have a `go` key instead of a `new line` key.
-            `android:inputType="textUri"` disables spell check in the `EditText`. -->
+             `android:inputType="textUri"` disables spell check in the `EditText`. -->
         <android.support.design.widget.TextInputEditText
             android:id="@+id/shortcut_name_edittext"
             android:layout_width="match_parent"
index 677626290045c87cc38dac80671b56d379fb29e5..2b6771a1cb3bcbb7d8bbd99183e04eb908ba465c 100644 (file)
   You should have received a copy of the GNU General Public License
   along with Privacy Browser.  If not, see <http://www.gnu.org/licenses/>. -->
 
-<LinearLayout
+<ScrollView
     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:orientation="vertical">
+    android:layout_height="wrap_content"
+    android:layout_width="match_parent" >
 
-    <!-- The icon selection rows. -->
     <LinearLayout
+        xmlns:tools="http://schemas.android.com/tools"
         android:layout_height="wrap_content"
         android:layout_width="match_parent"
-        android:orientation="horizontal">
+        android:orientation="vertical" >
 
-        <!-- The column displaying the icons. -->
+        <!-- The icon selection rows. -->
         <LinearLayout
-            android:layout_height="wrap_content"
-            android:layout_width="wrap_content"
-            android:layout_marginStart="16dp"
-            android:layout_marginEnd="10dp"
-            android:orientation="vertical" >
-
-            <ImageView
-                android:id="@+id/edit_bookmark_current_icon"
-                android:layout_width="30dp"
-                android:layout_height="30dp"
-                android:layout_marginTop="12dp"
-                android:layout_marginBottom="6dp"
-                android:layout_gravity="center_vertical"
-                tools:ignore="ContentDescription" />
-
-            <ImageView
-                android:id="@+id/edit_bookmark_web_page_favorite_icon"
-                android:layout_width="30dp"
-                android:layout_height="30dp"
-                android:layout_marginTop="6dp"
-                android:layout_marginBottom="6dp"
-                tools:ignore="ContentDescription" />
-        </LinearLayout>
-
-        <!-- The column with the `RadioGroup`. -->
-        <RadioGroup
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
-            android:checkedButton="@+id/edit_bookmark_current_icon_radiobutton" >
+            android:orientation="horizontal" >
 
-            <RadioButton
-                android:id="@id/edit_bookmark_current_icon_radiobutton"
+            <!-- The column displaying the icons. -->
+            <LinearLayout
                 android:layout_height="wrap_content"
                 android:layout_width="wrap_content"
-                android:layout_marginTop="12dp"
-                android:layout_marginBottom="4dp"
-                android:text="@string/current_bookmark_icon"
-                android:textSize="18sp" />
-
-            <RadioButton
-                android:id="@+id/edit_bookmark_web_page_favorite_icon_radiobutton"
+                android:layout_marginStart="16dp"
+                android:layout_marginEnd="10dp"
+                android:orientation="vertical" >
+
+                <ImageView
+                    android:id="@+id/edit_bookmark_current_icon"
+                    android:layout_width="30dp"
+                    android:layout_height="30dp"
+                    android:layout_marginTop="12dp"
+                    android:layout_marginBottom="6dp"
+                    android:layout_gravity="center_vertical"
+                    tools:ignore="ContentDescription" />
+
+                <ImageView
+                    android:id="@+id/edit_bookmark_web_page_favorite_icon"
+                    android:layout_width="30dp"
+                    android:layout_height="30dp"
+                    android:layout_marginTop="6dp"
+                    android:layout_marginBottom="6dp"
+                    tools:ignore="ContentDescription" />
+            </LinearLayout>
+
+            <!-- The column with the `RadioGroup`. -->
+            <RadioGroup
                 android:layout_height="wrap_content"
-                android:layout_width="wrap_content"
-                android:layout_marginTop="5dp"
-                android:text="@string/web_page_favorite_icon"
-                android:textSize="18sp" />
-        </RadioGroup>
-    </LinearLayout>
+                android:layout_width="match_parent"
+                android:checkedButton="@+id/edit_bookmark_current_icon_radiobutton" >
+
+                <RadioButton
+                    android:id="@id/edit_bookmark_current_icon_radiobutton"
+                    android:layout_height="wrap_content"
+                    android:layout_width="wrap_content"
+                    android:layout_marginTop="12dp"
+                    android:layout_marginBottom="4dp"
+                    android:text="@string/current_bookmark_icon"
+                    android:textSize="18sp" />
+
+                <RadioButton
+                    android:id="@+id/edit_bookmark_web_page_favorite_icon_radiobutton"
+                    android:layout_height="wrap_content"
+                    android:layout_width="wrap_content"
+                    android:layout_marginTop="5dp"
+                    android:text="@string/web_page_favorite_icon"
+                    android:textSize="18sp" />
+            </RadioGroup>
+        </LinearLayout>
 
-    <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
-    <android.support.design.widget.TextInputLayout
-        android:layout_height="wrap_content"
-        android:layout_width="match_parent"
-        android:layout_marginTop="12dp"
-        android:layout_marginBottom="6dp"
-        android:layout_marginStart="4dp"
-        android:layout_marginEnd="4dp" >
-
-        <!-- `android:imeOptions="actionGo"` sets the keyboard to have a `go` key instead of a `new line` key.
-            `android:inputType="textUri"` disables spell check in the `EditText`. -->
-        <android.support.design.widget.TextInputEditText
-            android:id="@+id/edit_bookmark_name_edittext"
+        <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
+        <android.support.design.widget.TextInputLayout
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
-            android:hint="@string/bookmark_name"
-            android:imeOptions="actionGo"
-            android:inputType="textUri" />
-    </android.support.design.widget.TextInputLayout>
-
-    <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
-    <android.support.design.widget.TextInputLayout
-        android:layout_height="wrap_content"
-        android:layout_width="match_parent"
-        android:layout_marginTop="6dp"
-        android:layout_marginBottom="12dp"
-        android:layout_marginStart="4dp"
-        android:layout_marginEnd="4dp" >
-
-        <!-- `android:imeOptions="actionGo"` sets the keyboard to have a "go" key instead of a "new line" key.
-            `android:inputType="textUri"` disables spell check in the EditText.
-            `android:singleLine="true"` is not needed in a Dialog.-->
-        <EditText
-            android:id="@+id/edit_bookmark_url_edittext"
+            android:layout_marginTop="12dp"
+            android:layout_marginBottom="6dp"
+            android:layout_marginStart="4dp"
+            android:layout_marginEnd="4dp" >
+
+            <!-- `android:imeOptions="actionGo"` sets the keyboard to have a `go` key instead of a `new line` key.
+                `android:inputType="textUri"` disables spell check in the `EditText`. -->
+            <android.support.design.widget.TextInputEditText
+                android:id="@+id/edit_bookmark_name_edittext"
+                android:layout_height="wrap_content"
+                android:layout_width="match_parent"
+                android:hint="@string/bookmark_name"
+                android:imeOptions="actionGo"
+                android:inputType="textUri" />
+        </android.support.design.widget.TextInputLayout>
+
+        <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
+        <android.support.design.widget.TextInputLayout
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
-            android:hint="@string/bookmark_url"
-            android:imeOptions="actionGo"
-            android:inputType="textUri" />
-    </android.support.design.widget.TextInputLayout>
-</LinearLayout>
\ No newline at end of file
+            android:layout_marginTop="6dp"
+            android:layout_marginBottom="12dp"
+            android:layout_marginStart="4dp"
+            android:layout_marginEnd="4dp" >
+
+            <!-- `android:imeOptions="actionGo"` sets the keyboard to have a "go" key instead of a "new line" key.
+                `android:inputType="textUri"` disables spell check in the EditText.
+                `android:singleLine="true"` is not needed in a Dialog.-->
+            <EditText
+                android:id="@+id/edit_bookmark_url_edittext"
+                android:layout_height="wrap_content"
+                android:layout_width="match_parent"
+                android:hint="@string/bookmark_url"
+                android:imeOptions="actionGo"
+                android:inputType="textUri" />
+        </android.support.design.widget.TextInputLayout>
+    </LinearLayout>
+</ScrollView>
\ No newline at end of file
index 469cb2e315947168cbbc42913138b51541287d3b..f7d69b655174ca8793afd09f60b498292186ec5c 100644 (file)
   You should have received a copy of the GNU General Public License
   along with Privacy Browser.  If not, see <http://www.gnu.org/licenses/>. -->
 
-<LinearLayout
+<ScrollView
     xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
     android:layout_height="wrap_content"
-    android:layout_width="match_parent"
-    android:orientation="vertical" >
+    android:layout_width="match_parent" >
 
-    <!-- The icon selection rows. -->
     <LinearLayout
+        xmlns:android="http://schemas.android.com/apk/res/android"
+        xmlns:tools="http://schemas.android.com/tools"
         android:layout_height="wrap_content"
         android:layout_width="match_parent"
-        android:orientation="horizontal">
+        android:orientation="vertical" >
 
-        <!-- The column displaying the icons. -->
+        <!-- The icon selection rows. -->
         <LinearLayout
             android:layout_height="wrap_content"
-            android:layout_width="wrap_content"
-            android:orientation="vertical"
-            android:layout_marginStart="16dp"
-            android:layout_marginEnd="10dp" >
-
-            <ImageView
-                android:id="@+id/edit_folder_current_icon"
-                android:layout_height="30dp"
-                android:layout_width="30dp"
-                android:layout_marginTop="12dp"
-                android:layout_marginBottom="6dp"
-                android:layout_gravity="center_vertical"
-                tools:ignore="ContentDescription" />
-
-            <ImageView
-                android:id="@+id/edit_folder_default_icon"
-                android:layout_height="30dp"
-                android:layout_width="30dp"
-                android:layout_marginTop="6dp"
-                android:layout_marginBottom="6dp"
-                android:layout_gravity="center_vertical"
-                android:src="@drawable/folder_blue_bitmap"
-                tools:ignore="ContentDescription" />
-
-            <ImageView
-                android:id="@+id/edit_folder_web_page_favorite_icon"
-                android:layout_height="30dp"
-                android:layout_width="30dp"
-                android:layout_marginTop="6dp"
-                android:layout_marginBottom="12dp"
-                android:layout_gravity="center_vertical"
-                tools:ignore="ContentDescription" />
-        </LinearLayout>
-
-        <!-- The column with the `RadioGroup`. -->
-        <RadioGroup
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:checkedButton="@+id/edit_folder_current_icon_radiobutton">
+            android:orientation="horizontal">
 
-            <RadioButton
-                android:id="@id/edit_folder_current_icon_radiobutton"
+            <!-- The column displaying the icons. -->
+            <LinearLayout
                 android:layout_height="wrap_content"
                 android:layout_width="wrap_content"
-                android:layout_marginTop="12dp"
-                android:layout_marginBottom="4dp"
-                android:text="@string/current_folder_icon"
-                android:textSize="18sp"/>
-
-            <RadioButton
-                android:id="@+id/edit_folder_default_icon_radiobutton"
-                android:layout_width="wrap_content"
+                android:orientation="vertical"
+                android:layout_marginStart="16dp"
+                android:layout_marginEnd="10dp" >
+
+                <ImageView
+                    android:id="@+id/edit_folder_current_icon"
+                    android:layout_height="30dp"
+                    android:layout_width="30dp"
+                    android:layout_marginTop="12dp"
+                    android:layout_marginBottom="6dp"
+                    android:layout_gravity="center_vertical"
+                    tools:ignore="ContentDescription" />
+
+                <ImageView
+                    android:id="@+id/edit_folder_default_icon"
+                    android:layout_height="30dp"
+                    android:layout_width="30dp"
+                    android:layout_marginTop="6dp"
+                    android:layout_marginBottom="6dp"
+                    android:layout_gravity="center_vertical"
+                    android:src="@drawable/folder_blue_bitmap"
+                    tools:ignore="ContentDescription" />
+
+                <ImageView
+                    android:id="@+id/edit_folder_web_page_favorite_icon"
+                    android:layout_height="30dp"
+                    android:layout_width="30dp"
+                    android:layout_marginTop="6dp"
+                    android:layout_marginBottom="12dp"
+                    android:layout_gravity="center_vertical"
+                    tools:ignore="ContentDescription" />
+            </LinearLayout>
+
+            <!-- The column with the `RadioGroup`. -->
+            <RadioGroup
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="5dp"
-                android:layout_marginBottom="4dp"
-                android:text="@string/default_folder_icon"
-                android:textSize="18sp" />
+                android:checkedButton="@+id/edit_folder_current_icon_radiobutton">
+
+                <RadioButton
+                    android:id="@id/edit_folder_current_icon_radiobutton"
+                    android:layout_height="wrap_content"
+                    android:layout_width="wrap_content"
+                    android:layout_marginTop="12dp"
+                    android:layout_marginBottom="4dp"
+                    android:text="@string/current_folder_icon"
+                    android:textSize="18sp"/>
+
+                <RadioButton
+                    android:id="@+id/edit_folder_default_icon_radiobutton"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="5dp"
+                    android:layout_marginBottom="4dp"
+                    android:text="@string/default_folder_icon"
+                    android:textSize="18sp" />
+
+                <RadioButton
+                    android:id="@+id/edit_folder_web_page_icon_radiobutton"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="5dp"
+                    android:text="@string/web_page_favorite_icon"
+                    android:textSize="18sp" />
+            </RadioGroup>
+        </LinearLayout>
 
-            <RadioButton
-                android:id="@+id/edit_folder_web_page_icon_radiobutton"
-                android:layout_width="wrap_content"
+        <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
+        <android.support.design.widget.TextInputLayout
+            android:layout_height="wrap_content"
+            android:layout_width="match_parent"
+            android:layout_marginTop="6dp"
+            android:layout_marginBottom="12dp"
+            android:layout_marginStart="4dp"
+            android:layout_marginEnd="4dp" >
+
+            <!-- `android:imeOptions="actionGo"` sets the keyboard to have a "go" key instead of a "new line" key.
+                `android:inputType="textUri"` disables spell check in the EditText. -->
+            <android.support.design.widget.TextInputEditText
+                android:id="@+id/edit_folder_name_edittext"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="5dp"
-                android:text="@string/web_page_favorite_icon"
-                android:textSize="18sp" />
-        </RadioGroup>
-    </LinearLayout>
+                android:layout_width="match_parent"
+                android:hint="@string/folder_name"
+                android:imeOptions="actionGo"
+                android:inputType="textUri" />
+        </android.support.design.widget.TextInputLayout>
 
-    <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
-    <android.support.design.widget.TextInputLayout
-        android:layout_height="wrap_content"
-        android:layout_width="match_parent"
-        android:layout_marginTop="6dp"
-        android:layout_marginBottom="12dp"
-        android:layout_marginStart="4dp"
-        android:layout_marginEnd="4dp" >
-
-        <!-- `android:imeOptions="actionGo"` sets the keyboard to have a "go" key instead of a "new line" key.
-            `android:inputType="textUri"` disables spell check in the EditText. -->
-        <android.support.design.widget.TextInputEditText
-            android:id="@+id/edit_folder_name_edittext"
+        <TextView
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
-            android:hint="@string/folder_name"
-            android:imeOptions="actionGo"
-            android:inputType="textUri" />
-    </android.support.design.widget.TextInputLayout>
-
-    <TextView
-        android:layout_height="wrap_content"
-        android:layout_width="match_parent"
-        android:gravity="center_horizontal"
-        android:text="@string/folder_names_must_be_unique" />
-</LinearLayout>
\ No newline at end of file
+            android:gravity="center_horizontal"
+            android:text="@string/folder_names_must_be_unique" />
+    </LinearLayout>
+</ScrollView>
\ No newline at end of file
index d94e8da98e1f821efd905e1fb20f9361b06d3db2..6c95fbfa28f828926bd86f1219b2640d17496f82 100644 (file)
@@ -45,7 +45,7 @@
             android:text="@string/url"
             android:textAllCaps="true"
             android:textStyle="bold"
-            android:textColor="@color/blue_900" />
+            android:textColor="?attr/sslTitle" />
 
         <TextView
             android:id="@+id/url_error_dialog"
@@ -60,7 +60,7 @@
             android:text="@string/issued_to"
             android:textAllCaps="true"
             android:textStyle="bold"
-            android:textColor="@color/blue_900" />
+            android:textColor="?attr/sslTitle" />
 
         <TextView
             android:id="@+id/issued_to_cname_error_dialog"
@@ -87,7 +87,7 @@
             android:text="@string/issued_by"
             android:textAllCaps="true"
             android:textStyle="bold"
-            android:textColor="@color/blue_900"/>
+            android:textColor="?attr/sslTitle"/>
 
         <TextView
             android:id="@+id/issued_by_cname_error_dialog"
             android:text="@string/valid_dates"
             android:textAllCaps="true"
             android:textStyle="bold"
-            android:textColor="@color/blue_900"/>
+            android:textColor="?attr/sslTitle"/>
 
         <TextView
             android:id="@+id/start_date_error_dialog"
index 1efcfacc7b5c77bafe2b4efa594c17636c37b8c8..01f6cb02268b58502aba7906a3d02cd37c575119 100644 (file)
@@ -24,5 +24,5 @@
     android:id="@+id/history_listview"
     android:layout_height="wrap_content"
     android:layout_width="wrap_content"
-    android:divider="@color/white"
+    android:divider="@color/transparent"
     android:dividerHeight="0dp" />
\ No newline at end of file
index be8481731b3cea7d4867d3ded078915904957f4a..df4a1363536bbd34b74160d501ee4f417c2690a2 100644 (file)
@@ -25,7 +25,7 @@
     android:layout_height="wrap_content"
     android:layout_width="match_parent"
     android:orientation="horizontal"
-    android:background="@drawable/listview_item_background_selector" >
+    tools:ignore="UseCompoundDrawables" >
 
     <ImageView
         android:id="@+id/history_favorite_icon_imageview"
@@ -39,7 +39,7 @@
         android:id="@+id/history_url_textview"
         android:layout_height="wrap_content"
         android:layout_width="wrap_content"
-        android:textColor="@color/black"
+        android:textColor="?attr/urlHistoryText"
         android:textSize="16sp"
         android:layout_margin="10dp"
         android:maxLines="1"
index 09676380384d39aab42f5555077f971813312b53..d33ab53efead850f7e65e3e641e3eece248b6162 100644 (file)
@@ -36,7 +36,7 @@
             android:text="@string/issued_to"
             android:textAllCaps="true"
             android:textStyle="bold"
-            android:textColor="@color/blue_900" />
+            android:textColor="?attr/sslTitle" />
 
         <TextView
             android:id="@+id/issued_to_cname"
@@ -62,7 +62,7 @@
             android:text="@string/issued_by"
             android:textAllCaps="true"
             android:textStyle="bold"
-            android:textColor="@color/blue_900"/>
+            android:textColor="?attr/sslTitle"/>
 
         <TextView
             android:id="@+id/issued_by_cname"
@@ -88,7 +88,7 @@
             android:text="@string/valid_dates"
             android:textAllCaps="true"
             android:textStyle="bold"
-            android:textColor="@color/blue_900"/>
+            android:textColor="?attr/sslTitle"/>
 
         <TextView
             android:id="@+id/start_date"
index 0529ec559eda7e5fcabf47afb60c5de5f0caa1df..594f906bdaec853035afb5b4044e59caf947d5d0 100644 (file)
@@ -25,6 +25,8 @@
 
     <attr name="aboutTitle" format="reference" />
     <attr name="aboutText" format="reference" />
+    <attr name="sslTitle" format="reference" />
+    <attr name="urlHistoryText" format="reference" />
 
     <attr name="navigationHeaderBackground" format="reference" />
     <attr name="navigationHeaderTextColor" format="reference" />
index e454aaad46366d2f75ffa62383acf009646eb4df..e51f0471529010621da87d0d9359747ad79891a9 100644 (file)
@@ -47,6 +47,7 @@
     <color name="dark_green_15">#FF163317</color>
 
     <color name="gray_100">#FFF5F5F5</color>
+    <color name="gray_200">#FFEEEEEE</color>
     <color name="gray_300">#FFE0E0E0</color>
     <color name="gray_400">#FFBDBDBD</color>
     <color name="gray_500">#FF9E9E9E</color>
index 8832ee83dafa80ead0628404cb7cb892223faba5..41ddc897161ee0346f3029cf622a8fea6c7f39b0 100644 (file)
@@ -33,6 +33,8 @@
         <item name="progressTintColor">@color/blue_700</item>
         <item name="navigationIconTintColor">@color/blue_800</item>
         <item name="findOnPageIconTintColor">@color/blue_700</item>
+        <item name="sslTitle">@color/blue_900</item>
+        <item name="urlHistoryText">@color/black</item>
     </style>
 
     <!-- `windowActionModeOverlay` makes the contextual app bar cover the support app bar.
@@ -72,7 +74,7 @@
         <item name="tabIndicatorColor">@color/white</item>
     </style>
 
-    <style name="LightAlertDialog" parent="Theme.AppCompat.Light.Dialog.Alert" >
+    <style name="PrivacyBrowserAlertDialogLight" parent="Theme.AppCompat.Light.Dialog.Alert" >
         <item name="colorAccent">@color/blue_700</item>
     </style>
 
@@ -91,6 +93,8 @@
         <item name="progressTintColor">@color/blue_800</item>
         <item name="navigationIconTintColor">@color/blue_900</item>
         <item name="findOnPageIconTintColor">@color/blue_900</item>
+        <item name="sslTitle">@color/blue_700</item>
+        <item name="urlHistoryText">@color/gray_200</item>
     </style>
 
     <style name="PrivacyBrowserDark.SecondaryActivity" >
         <item name="tabIndicatorColor">@color/gray_300</item>
     </style>
 
+    <style name="PrivacyBrowserAlertDialogDark" parent="Theme.AppCompat.Dialog.Alert" >
+        <item name="android:windowBackground">@color/gray_900</item>
+        <item name="android:textColor">@color/gray_300</item>
+    </style>
+
     <!-- `ThemeOverlay.AppCompat.Dark` makes the popups have a dark background with light text. -->
     <!-- <style name="PrivacyBrowserPopupOverlayDark" parent="ThemeOverlay.AppCompat.Dark" /> -->