From 9cb208c1f5c7a905f787f4ec4795a92e72195fba Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Fri, 9 Oct 2020 12:50:30 -0700 Subject: [PATCH] Fix the app bar and options menu icon colors. https://redmine.stoutner.com/issues/618 --- app/build.gradle | 2 +- .../privacybrowser/dialogs/AboutViewSourceDialog.kt | 4 ++-- .../privacybrowser/dialogs/AddDomainDialog.kt | 2 +- .../privacybrowser/dialogs/FontSizeDialog.kt | 9 +-------- .../dialogs/HttpAuthenticationDialog.kt | 13 ++++--------- app/src/main/res/drawable/about_blue_day.xml | 13 +++++++++++++ app/src/main/res/drawable/about_blue_night.xml | 13 +++++++++++++ app/src/main/res/drawable/about_day.xml | 2 +- app/src/main/res/drawable/about_night.xml | 2 +- app/src/main/res/drawable/close_day.xml | 2 +- app/src/main/res/drawable/close_night.xml | 2 +- app/src/main/res/drawable/copy_day.xml | 2 +- app/src/main/res/drawable/copy_night.xml | 2 +- app/src/main/res/drawable/delete_day.xml | 2 +- app/src/main/res/drawable/delete_night.xml | 2 +- app/src/main/res/drawable/edit_day.xml | 2 +- app/src/main/res/drawable/edit_night.xml | 2 +- app/src/main/res/drawable/images_options_day.xml | 2 +- app/src/main/res/drawable/images_options_night.xml | 2 +- app/src/main/res/drawable/move_down_enabled_day.xml | 2 +- .../main/res/drawable/move_down_enabled_night.xml | 2 +- app/src/main/res/drawable/move_to_folder_day.xml | 2 +- app/src/main/res/drawable/move_to_folder_night.xml | 2 +- app/src/main/res/drawable/move_up_enabled_day.xml | 2 +- app/src/main/res/drawable/move_up_enabled_night.xml | 2 +- app/src/main/res/drawable/save_day.xml | 2 +- app/src/main/res/drawable/save_night.xml | 2 +- app/src/main/res/drawable/save_text_day.xml | 2 +- app/src/main/res/drawable/save_text_night.xml | 2 +- app/src/main/res/drawable/select_all_day.xml | 2 +- app/src/main/res/drawable/select_all_night.xml | 2 +- app/src/main/res/drawable/share_day.xml | 2 +- app/src/main/res/drawable/share_night.xml | 2 +- app/src/main/res/drawable/sort_day.xml | 2 +- app/src/main/res/drawable/sort_night.xml | 2 +- app/src/main/res/drawable/sort_selected_day.xml | 2 +- app/src/main/res/drawable/sort_selected_night.xml | 2 +- app/src/main/res/layout/about_coordinatorlayout.xml | 4 +++- .../main/res/layout/bookmarks_coordinatorlayout.xml | 4 +++- .../bookmarks_databaseview_coordinatorlayout.xml | 4 +++- .../main/res/layout/domains_coordinatorlayout.xml | 4 +++- app/src/main/res/layout/guide_coordinatorlayout.xml | 4 +++- .../res/layout/import_export_coordinatorlayout.xml | 4 +++- .../main/res/layout/logcat_coordinatorlayout.xml | 4 +++- app/src/main/res/layout/main_framelayout.xml | 4 +++- .../main/res/layout/requests_coordinatorlayout.xml | 4 +++- app/src/main/res/layout/view_source_app_bar.xml | 6 +++--- .../res/layout/view_source_coordinatorlayout.xml | 5 +++-- app/src/main/res/values-night-v23/styles.xml | 9 +++++++-- app/src/main/res/values-night-v27/styles.xml | 9 +++++++-- app/src/main/res/values-night/styles.xml | 9 +++++++-- app/src/main/res/values-v23/styles.xml | 9 +++++++-- app/src/main/res/values-v27/styles.xml | 9 +++++++-- app/src/main/res/values/attrs.xml | 9 +++++++-- app/src/main/res/values/styles.xml | 9 +++++++-- build.gradle | 2 +- 56 files changed, 148 insertions(+), 80 deletions(-) create mode 100644 app/src/main/res/drawable/about_blue_day.xml create mode 100644 app/src/main/res/drawable/about_blue_night.xml diff --git a/app/build.gradle b/app/build.gradle index ae709794..595aab29 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -82,7 +82,7 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0' - implementation "androidx.core:core-ktx:1.3.1" + implementation "androidx.core:core-ktx:1.3.2" implementation 'androidx.drawerlayout:drawerlayout:1.1.1' implementation 'androidx.preference:preference:1.1.1' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/AboutViewSourceDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/AboutViewSourceDialog.kt index 937dc3ab..1b9161eb 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/AboutViewSourceDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/AboutViewSourceDialog.kt @@ -34,8 +34,8 @@ class AboutViewSourceDialog: DialogFragment() { // Use a builder to create the alert dialog. val dialogBuilder: AlertDialog.Builder = AlertDialog.Builder(requireContext(), R.style.PrivacyBrowserAlertDialog) - // Set the style and the icon according to the theme. - dialogBuilder.setIconAttribute(R.attr.aboutIcon) + // Set the icon according to the theme. + dialogBuilder.setIconAttribute(R.attr.aboutBlueIcon) // Set the title. dialogBuilder.setTitle(R.string.about_view_source) diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/AddDomainDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/AddDomainDialog.kt index a646a78d..9860a04a 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/AddDomainDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/AddDomainDialog.kt @@ -94,7 +94,7 @@ class AddDomainDialog: DialogFragment() { val dialogBuilder: AlertDialog.Builder = AlertDialog.Builder(requireContext(), R.style.PrivacyBrowserAlertDialog) // Set the icon according to the theme. - dialogBuilder.setIconAttribute(R.attr.domainsIcon) + dialogBuilder.setIconAttribute(R.attr.domainsBlueIcon) // Set the title. dialogBuilder.setTitle(R.string.add_domain) diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/FontSizeDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/FontSizeDialog.kt index 75ef4e45..e6f3110b 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/FontSizeDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/FontSizeDialog.kt @@ -85,15 +85,8 @@ class FontSizeDialog: DialogFragment() { // Use a builder to create the alert dialog. val dialogBuilder = AlertDialog.Builder(requireContext(), R.style.PrivacyBrowserAlertDialog) - // Get the current theme status. - val currentThemeStatus = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK - // Set the icon according to the theme. - if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) { - dialogBuilder.setIcon(R.drawable.font_size_day) - } else { - dialogBuilder.setIcon(R.drawable.font_size_night) - } + dialogBuilder.setIconAttribute(R.attr.fontSizeBlueIcon) // Set the title. dialogBuilder.setTitle(R.string.font_size) diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/HttpAuthenticationDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/HttpAuthenticationDialog.kt index 7c94fcfb..dca6032d 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/HttpAuthenticationDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/HttpAuthenticationDialog.kt @@ -108,16 +108,8 @@ class HttpAuthenticationDialog: DialogFragment() { // Use an alert dialog builder to create the alert dialog. val dialogBuilder = AlertDialog.Builder(requireActivity(), R.style.PrivacyBrowserAlertDialog) - // Get the current theme status. - val currentThemeStatus = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK - // Set the icon according to the theme. - if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) { - dialogBuilder.setIcon(R.drawable.lock_day) - } else { - - dialogBuilder.setIcon(R.drawable.lock_night) - } + dialogBuilder.setIconAttribute(R.attr.lockBlueIcon) // Set the title. dialogBuilder.setTitle(R.string.http_authentication) @@ -180,6 +172,9 @@ class HttpAuthenticationDialog: DialogFragment() { val hostLabel = getString(R.string.host) + " " val hostStringBuilder = SpannableStringBuilder(hostLabel + httpAuthHost) + // Get the current theme status. + val currentThemeStatus = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK + // Create a blue foreground color span. val blueColorSpan: ForegroundColorSpan diff --git a/app/src/main/res/drawable/about_blue_day.xml b/app/src/main/res/drawable/about_blue_day.xml new file mode 100644 index 00000000..ce6ee324 --- /dev/null +++ b/app/src/main/res/drawable/about_blue_day.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/app/src/main/res/drawable/about_blue_night.xml b/app/src/main/res/drawable/about_blue_night.xml new file mode 100644 index 00000000..8506e915 --- /dev/null +++ b/app/src/main/res/drawable/about_blue_night.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/app/src/main/res/drawable/about_day.xml b/app/src/main/res/drawable/about_day.xml index 7a629334..ae8f192f 100644 --- a/app/src/main/res/drawable/about_day.xml +++ b/app/src/main/res/drawable/about_day.xml @@ -8,6 +8,6 @@ diff --git a/app/src/main/res/drawable/about_night.xml b/app/src/main/res/drawable/about_night.xml index cdba373c..4150caa8 100644 --- a/app/src/main/res/drawable/about_night.xml +++ b/app/src/main/res/drawable/about_night.xml @@ -8,6 +8,6 @@ diff --git a/app/src/main/res/drawable/close_day.xml b/app/src/main/res/drawable/close_day.xml index 24a94e9f..4d257722 100644 --- a/app/src/main/res/drawable/close_day.xml +++ b/app/src/main/res/drawable/close_day.xml @@ -8,6 +8,6 @@ diff --git a/app/src/main/res/drawable/close_night.xml b/app/src/main/res/drawable/close_night.xml index d087b647..87a6d967 100644 --- a/app/src/main/res/drawable/close_night.xml +++ b/app/src/main/res/drawable/close_night.xml @@ -8,6 +8,6 @@ diff --git a/app/src/main/res/drawable/copy_day.xml b/app/src/main/res/drawable/copy_day.xml index 22751522..05a8fa62 100644 --- a/app/src/main/res/drawable/copy_day.xml +++ b/app/src/main/res/drawable/copy_day.xml @@ -13,6 +13,6 @@ \ No newline at end of file diff --git a/app/src/main/res/drawable/copy_night.xml b/app/src/main/res/drawable/copy_night.xml index f1e7a828..1742244f 100644 --- a/app/src/main/res/drawable/copy_night.xml +++ b/app/src/main/res/drawable/copy_night.xml @@ -13,6 +13,6 @@ \ No newline at end of file diff --git a/app/src/main/res/drawable/delete_day.xml b/app/src/main/res/drawable/delete_day.xml index db6f4e50..4f5db2a2 100644 --- a/app/src/main/res/drawable/delete_day.xml +++ b/app/src/main/res/drawable/delete_day.xml @@ -8,6 +8,6 @@ diff --git a/app/src/main/res/drawable/delete_night.xml b/app/src/main/res/drawable/delete_night.xml index 423b5052..8c5e5ee2 100644 --- a/app/src/main/res/drawable/delete_night.xml +++ b/app/src/main/res/drawable/delete_night.xml @@ -8,6 +8,6 @@ diff --git a/app/src/main/res/drawable/edit_day.xml b/app/src/main/res/drawable/edit_day.xml index 45587511..3508d797 100644 --- a/app/src/main/res/drawable/edit_day.xml +++ b/app/src/main/res/drawable/edit_day.xml @@ -13,6 +13,6 @@ diff --git a/app/src/main/res/drawable/edit_night.xml b/app/src/main/res/drawable/edit_night.xml index 36a58547..bad07f55 100644 --- a/app/src/main/res/drawable/edit_night.xml +++ b/app/src/main/res/drawable/edit_night.xml @@ -13,6 +13,6 @@ diff --git a/app/src/main/res/drawable/images_options_day.xml b/app/src/main/res/drawable/images_options_day.xml index 04b2929b..26596282 100644 --- a/app/src/main/res/drawable/images_options_day.xml +++ b/app/src/main/res/drawable/images_options_day.xml @@ -13,6 +13,6 @@ diff --git a/app/src/main/res/drawable/images_options_night.xml b/app/src/main/res/drawable/images_options_night.xml index 840a8bee..ff0d06cb 100644 --- a/app/src/main/res/drawable/images_options_night.xml +++ b/app/src/main/res/drawable/images_options_night.xml @@ -13,6 +13,6 @@ diff --git a/app/src/main/res/drawable/move_down_enabled_day.xml b/app/src/main/res/drawable/move_down_enabled_day.xml index 7ff2e339..643f17c4 100644 --- a/app/src/main/res/drawable/move_down_enabled_day.xml +++ b/app/src/main/res/drawable/move_down_enabled_day.xml @@ -8,6 +8,6 @@ diff --git a/app/src/main/res/drawable/move_down_enabled_night.xml b/app/src/main/res/drawable/move_down_enabled_night.xml index 415811ba..bf73f3be 100644 --- a/app/src/main/res/drawable/move_down_enabled_night.xml +++ b/app/src/main/res/drawable/move_down_enabled_night.xml @@ -8,6 +8,6 @@ diff --git a/app/src/main/res/drawable/move_to_folder_day.xml b/app/src/main/res/drawable/move_to_folder_day.xml index 99d22510..b0adbd17 100644 --- a/app/src/main/res/drawable/move_to_folder_day.xml +++ b/app/src/main/res/drawable/move_to_folder_day.xml @@ -14,6 +14,6 @@ diff --git a/app/src/main/res/drawable/move_to_folder_night.xml b/app/src/main/res/drawable/move_to_folder_night.xml index a71f6b03..ca34bdc0 100644 --- a/app/src/main/res/drawable/move_to_folder_night.xml +++ b/app/src/main/res/drawable/move_to_folder_night.xml @@ -14,6 +14,6 @@ diff --git a/app/src/main/res/drawable/move_up_enabled_day.xml b/app/src/main/res/drawable/move_up_enabled_day.xml index ff8a8b45..26437dfd 100644 --- a/app/src/main/res/drawable/move_up_enabled_day.xml +++ b/app/src/main/res/drawable/move_up_enabled_day.xml @@ -8,6 +8,6 @@ diff --git a/app/src/main/res/drawable/move_up_enabled_night.xml b/app/src/main/res/drawable/move_up_enabled_night.xml index 9a9a292d..6f086af0 100644 --- a/app/src/main/res/drawable/move_up_enabled_night.xml +++ b/app/src/main/res/drawable/move_up_enabled_night.xml @@ -8,6 +8,6 @@ diff --git a/app/src/main/res/drawable/save_day.xml b/app/src/main/res/drawable/save_day.xml index 26559dfc..9c46e824 100644 --- a/app/src/main/res/drawable/save_day.xml +++ b/app/src/main/res/drawable/save_day.xml @@ -13,6 +13,6 @@ \ No newline at end of file diff --git a/app/src/main/res/drawable/save_night.xml b/app/src/main/res/drawable/save_night.xml index 4553fd0b..21e219fd 100644 --- a/app/src/main/res/drawable/save_night.xml +++ b/app/src/main/res/drawable/save_night.xml @@ -13,6 +13,6 @@ \ No newline at end of file diff --git a/app/src/main/res/drawable/save_text_day.xml b/app/src/main/res/drawable/save_text_day.xml index 7d5d4680..75b990f2 100644 --- a/app/src/main/res/drawable/save_text_day.xml +++ b/app/src/main/res/drawable/save_text_day.xml @@ -13,6 +13,6 @@ diff --git a/app/src/main/res/drawable/save_text_night.xml b/app/src/main/res/drawable/save_text_night.xml index ed5dc429..91469a3f 100644 --- a/app/src/main/res/drawable/save_text_night.xml +++ b/app/src/main/res/drawable/save_text_night.xml @@ -13,6 +13,6 @@ diff --git a/app/src/main/res/drawable/select_all_day.xml b/app/src/main/res/drawable/select_all_day.xml index 849cd9a1..e066dd5a 100644 --- a/app/src/main/res/drawable/select_all_day.xml +++ b/app/src/main/res/drawable/select_all_day.xml @@ -8,6 +8,6 @@ \ No newline at end of file diff --git a/app/src/main/res/drawable/select_all_night.xml b/app/src/main/res/drawable/select_all_night.xml index d0f5f6cc..6b33ab62 100644 --- a/app/src/main/res/drawable/select_all_night.xml +++ b/app/src/main/res/drawable/select_all_night.xml @@ -8,6 +8,6 @@ \ No newline at end of file diff --git a/app/src/main/res/drawable/share_day.xml b/app/src/main/res/drawable/share_day.xml index ee2f0e21..95d6c426 100644 --- a/app/src/main/res/drawable/share_day.xml +++ b/app/src/main/res/drawable/share_day.xml @@ -13,6 +13,6 @@ diff --git a/app/src/main/res/drawable/share_night.xml b/app/src/main/res/drawable/share_night.xml index 3d3652bf..1a7955fe 100644 --- a/app/src/main/res/drawable/share_night.xml +++ b/app/src/main/res/drawable/share_night.xml @@ -13,6 +13,6 @@ diff --git a/app/src/main/res/drawable/sort_day.xml b/app/src/main/res/drawable/sort_day.xml index 40ef0806..58d4b156 100644 --- a/app/src/main/res/drawable/sort_day.xml +++ b/app/src/main/res/drawable/sort_day.xml @@ -13,6 +13,6 @@ diff --git a/app/src/main/res/drawable/sort_night.xml b/app/src/main/res/drawable/sort_night.xml index 9153c62c..9aa55fbe 100644 --- a/app/src/main/res/drawable/sort_night.xml +++ b/app/src/main/res/drawable/sort_night.xml @@ -13,6 +13,6 @@ diff --git a/app/src/main/res/drawable/sort_selected_day.xml b/app/src/main/res/drawable/sort_selected_day.xml index ea40a786..16700851 100644 --- a/app/src/main/res/drawable/sort_selected_day.xml +++ b/app/src/main/res/drawable/sort_selected_day.xml @@ -19,6 +19,6 @@ diff --git a/app/src/main/res/drawable/sort_selected_night.xml b/app/src/main/res/drawable/sort_selected_night.xml index 8c9f8afb..2901466c 100644 --- a/app/src/main/res/drawable/sort_selected_night.xml +++ b/app/src/main/res/drawable/sort_selected_night.xml @@ -19,6 +19,6 @@ diff --git a/app/src/main/res/layout/about_coordinatorlayout.xml b/app/src/main/res/layout/about_coordinatorlayout.xml index 1681e367..b9c6dc06 100644 --- a/app/src/main/res/layout/about_coordinatorlayout.xml +++ b/app/src/main/res/layout/about_coordinatorlayout.xml @@ -31,11 +31,13 @@ android:layout_width="match_parent" android:orientation="vertical" > + + android:background="?android:attr/colorBackground" + android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" > + + android:background="?android:attr/colorBackground" + android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" > + + android:background="?android:attr/colorBackground" + android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" > + + android:background="?android:attr/colorBackground" + android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" > + + android:background="?android:attr/colorBackground" + android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" > + + android:background="?android:attr/colorBackground" + android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" > + + android:background="?android:attr/colorBackground" + android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" > + + android:layout_width="match_parent" + android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" > + + android:background="?android:attr/colorBackground" + android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" > + android:layout_width="match_parent" > + + android:background="?android:attr/colorBackground" + android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" > @drawable/list_selector_night - + @drawable/about_night @drawable/close_night @drawable/copy_night @drawable/delete_night - @drawable/domains_night @drawable/edit_night @drawable/move_to_folder_night @drawable/save_night @@ -60,6 +59,12 @@ @drawable/select_all_night @drawable/share_night @drawable/sort_night + + + @drawable/about_blue_night + @drawable/domains_night + @drawable/font_size_night + @drawable/lock_night