From d241bba6d474908fdcf398f5508652fddc18cc67 Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Wed, 21 Jun 2017 14:06:33 -0700 Subject: [PATCH] Create a dark theme for `DomainsActivity` and `DomainsSettingsActivity`. --- app/src/main/AndroidManifest.xml | 2 - .../activities/DomainSettingsActivity.java | 10 + .../activities/DomainsActivity.java | 35 ++-- .../activities/MainWebViewActivity.java | 4 +- .../fragments/DomainSettingsFragment.java | 177 +++++++++++++++--- ...l => primary_text_color_selector_dark.xml} | 4 +- .../primary_text_color_selector_light.xml | 25 +++ app/src/main/res/drawable/add_dark.xml | 13 ++ .../res/drawable/{add.xml => add_light.xml} | 2 +- app/src/main/res/drawable/delete_dark.xml | 13 ++ .../drawable/{delete.xml => delete_light.xml} | 2 +- .../drawable/domains_list_selector_dark.xml | 26 +++ .../drawable/domains_list_selector_light.xml | 26 +++ .../main/res/layout-w900dp/domains_list.xml | 2 +- .../layout/bookmarks_coordinatorlayout.xml | 2 +- .../res/layout/domain_name_linearlayout.xml | 4 +- app/src/main/res/layout/domain_settings.xml | 9 +- .../domain_settings_coordinatorlayout.xml | 10 +- .../res/layout/domains_coordinatorlayout.xml | 12 +- app/src/main/res/layout/domains_list.xml | 2 +- .../main/res/menu/bookmarks_context_menu.xml | 2 +- .../main/res/menu/domains_options_menu.xml | 2 +- app/src/main/res/values/attrs.xml | 7 + app/src/main/res/values/colors.xml | 1 + app/src/main/res/values/styles.xml | 27 ++- 25 files changed, 338 insertions(+), 81 deletions(-) rename app/src/main/res/color/{dark_primary_text_color_selector.xml => primary_text_color_selector_dark.xml} (89%) create mode 100644 app/src/main/res/color/primary_text_color_selector_light.xml create mode 100644 app/src/main/res/drawable/add_dark.xml rename app/src/main/res/drawable/{add.xml => add_light.xml} (74%) create mode 100644 app/src/main/res/drawable/delete_dark.xml rename app/src/main/res/drawable/{delete.xml => delete_light.xml} (75%) create mode 100644 app/src/main/res/drawable/domains_list_selector_dark.xml create mode 100644 app/src/main/res/drawable/domains_list_selector_light.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 015c4ecb..004984e5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -121,7 +121,6 @@ = 21. diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/DomainsActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/DomainsActivity.java index 320cddb8..e98b5fc1 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/DomainsActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/DomainsActivity.java @@ -71,15 +71,25 @@ public class DomainsActivity extends AppCompatActivity implements AddDomainDialo @Override protected void onCreate(Bundle savedInstanceState) { + // Set the activity theme. + if (MainWebViewActivity.darkTheme) { + setTheme(R.style.PrivacyBrowserDark_SecondaryActivity); + } else { + setTheme(R.style.PrivacyBrowserLight_SecondaryActivity); + } + + // Run the default commands. super.onCreate(savedInstanceState); + + // Set the content view. setContentView(R.layout.domains_coordinatorlayout); // Get a handle for the context. context = this; // We need to use the `SupportActionBar` from `android.support.v7.app.ActionBar` until the minimum API is >= 21. - final Toolbar bookmarksAppBar = (Toolbar) findViewById(R.id.domains_toolbar); - setSupportActionBar(bookmarksAppBar); + final Toolbar domainsAppBar = (Toolbar) findViewById(R.id.domains_toolbar); + setSupportActionBar(domainsAppBar); // Display the home arrow on `SupportActionBar`. ActionBar appBar = getSupportActionBar(); @@ -90,7 +100,7 @@ public class DomainsActivity extends AppCompatActivity implements AddDomainDialo // The `0` specifies the database version, but that is ignored and set instead using a constant in `DomainsDatabaseHelper`. domainsDatabaseHelper = new DomainsDatabaseHelper(this, null, null, 0); - // Determine if we are in two pane mode. `domains_settings_linearlayout` is only populated if two panes are present. + // Determine if we are in two pane mode. `domains_settings_scrollview` is only populated if two panes are present. twoPaneMode = ((findViewById(R.id.domain_settings_scrollview)) != null); // Initialize `domainsListView`. @@ -104,10 +114,6 @@ public class DomainsActivity extends AppCompatActivity implements AddDomainDialo // Display the Domain Settings. if (twoPaneMode) { // Display a fragment in two paned mode. - // Enable the options `MenuItems`. - saveMenuItem.setEnabled(true); - deleteMenuItem.setEnabled(true); - // Store `databaseId` in `argumentsBundle`. Bundle argumentsBundle = new Bundle(); argumentsBundle.putInt(DomainSettingsFragment.DATABASE_ID, databaseId); @@ -118,11 +124,6 @@ public class DomainsActivity extends AppCompatActivity implements AddDomainDialo // Display `domainSettingsFragment`. getSupportFragmentManager().beginTransaction().replace(R.id.domain_settings_scrollview, domainSettingsFragment).commit(); - - // Enable the options `MenuItems`. - deleteMenuItem.setEnabled(true); - deleteMenuItem.setIcon(R.drawable.delete); - saveMenuItem.setEnabled(true); } else { // Load the second activity on smaller screens. // Create `domainSettingsActivityIntent` with the `databaseId`. Intent domainSettingsActivityIntent = new Intent(context, DomainSettingsActivity.class); @@ -309,7 +310,7 @@ public class DomainsActivity extends AppCompatActivity implements AddDomainDialo // Enable the options `MenuItems`. deleteMenuItem.setEnabled(true); - deleteMenuItem.setIcon(R.drawable.delete); + deleteMenuItem.setIcon(R.drawable.delete_light); saveMenuItem.setEnabled(true); break; @@ -399,8 +400,14 @@ public class DomainsActivity extends AppCompatActivity implements AddDomainDialo // Enable the options `MenuItems`. deleteMenuItem.setEnabled(true); - deleteMenuItem.setIcon(R.drawable.delete); saveMenuItem.setEnabled(true); + + // Set the delete icon according to the theme. + if (MainWebViewActivity.darkTheme) { + deleteMenuItem.setIcon(R.drawable.delete_dark); + } else { + deleteMenuItem.setIcon(R.drawable.delete_light); + } } else { // Disable the options `MenuItems`. deleteMenuItem.setEnabled(false); diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java index ff129178..24acf916 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -122,8 +122,8 @@ 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`, `GuideActivity`, `AddDomainDialog`, `SettingsActivity`, `CreateBookmarkDialog`, `CreateBookmarkFolderDialog`, `DownloadFileDialog`, `DownloadImageDialog`, `EditBookmarkDialog`, - // `EditBookmarkFolderDialog`, `MoveToFolderDialog`, `SslCertificateErrorDialog`, `UrlHistoryDialog`, `ViewSslCertificateDialog`, `CreateHomeScreenShortcutDialog`, and `OrbotProxyHelper`. + // `darkTheme` is public static so it can be accessed from `AboutActivity`, `GuideActivity`, `AddDomainDialog`, `SettingsActivity`, `DomainsActivity`, `DomainsSettingsActivity`, `CreateBookmarkDialog`, `CreateBookmarkFolderDialog`, + // `DownloadFileDialog`, `DownloadImageDialog`, `EditBookmarkDialog`, `EditBookmarkFolderDialog`, `MoveToFolderDialog`, `SslCertificateErrorDialog`, `UrlHistoryDialog`, `ViewSslCertificateDialog`, `CreateHomeScreenShortcutDialog`, and `OrbotProxyHelper`. // It is also used in `onCreate()`, `applyAppSettings()`, `applyDomainSettings()`, and `updatePrivacyIcons()`. public static boolean darkTheme; diff --git a/app/src/main/java/com/stoutner/privacybrowser/fragments/DomainSettingsFragment.java b/app/src/main/java/com/stoutner/privacybrowser/fragments/DomainSettingsFragment.java index a231391c..ff18669c 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/fragments/DomainSettingsFragment.java +++ b/app/src/main/java/com/stoutner/privacybrowser/fragments/DomainSettingsFragment.java @@ -152,7 +152,13 @@ public class DomainSettingsFragment extends Fragment { firstPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_enabled)); } else { // First-party cookies are disabled. firstPartyCookiesEnabledSwitch.setChecked(false); - firstPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_disabled_light)); + + // Set the icon according to the theme. + if (MainWebViewActivity.darkTheme) { + firstPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_disabled_dark)); + } else { + firstPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_disabled_light)); + } } // Only display third-party cookies if SDK_INT >= 21. @@ -165,17 +171,29 @@ public class DomainSettingsFragment extends Fragment { thirdPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_warning)); } else { // First party cookies are enabled but third-party cookies are disabled. thirdPartyCookiesEnabledSwitch.setChecked(false); - thirdPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_disabled_light)); + + // Set the icon according to the theme. + if (MainWebViewActivity.darkTheme) { + thirdPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_disabled_dark)); + } else { + thirdPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_disabled_light)); + } } } else { // First-party cookies are disabled. - // Set the status of third-party cookies, but disable it. - if (thirdPartyCookiesEnabledInt == 1) { // Third-party cookies are enabled but first-party cookies are disabled. + // Set the status of third-party cookies. + if (thirdPartyCookiesEnabledInt == 1) { thirdPartyCookiesEnabledSwitch.setChecked(true); - thirdPartyCookiesEnabledSwitch.setEnabled(false); - thirdPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_ghosted_light)); - } else { // Both first party and third-party cookies are disabled. + } else { thirdPartyCookiesEnabledSwitch.setChecked(false); - thirdPartyCookiesEnabledSwitch.setEnabled(false); + } + + // Disable the third-party cookies switch. + thirdPartyCookiesEnabledSwitch.setEnabled(false); + + // Set the icon according to the theme. + if (MainWebViewActivity.darkTheme) { + thirdPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_ghosted_dark)); + } else { thirdPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_ghosted_light)); } } @@ -191,8 +209,15 @@ public class DomainSettingsFragment extends Fragment { domStorageEnabledSwitch.setChecked(true); domStorageImageView.setImageDrawable(getResources().getDrawable(R.drawable.dom_storage_enabled)); } else { // JavaScript is enabled but DOM storage is disabled. + // Set the DOM storage switch to off. domStorageEnabledSwitch.setChecked(false); - domStorageImageView.setImageDrawable(getResources().getDrawable(R.drawable.dom_storage_disabled_light)); + + // Set the icon according to the theme. + if (MainWebViewActivity.darkTheme) { + domStorageImageView.setImageDrawable(getResources().getDrawable(R.drawable.dom_storage_disabled_dark)); + } else { + domStorageImageView.setImageDrawable(getResources().getDrawable(R.drawable.dom_storage_disabled_light)); + } } } else { // JavaScript is disabled. // Set the checked status of DOM storage. @@ -202,9 +227,15 @@ public class DomainSettingsFragment extends Fragment { domStorageEnabledSwitch.setChecked(false); } - // Disable `domStorageEnabledSwitch` and set the icon to be ghosted. + // Disable `domStorageEnabledSwitch`. domStorageEnabledSwitch.setEnabled(false); - domStorageImageView.setImageDrawable(getResources().getDrawable(R.drawable.dom_storage_ghosted_light)); + + // Set the icon according to the theme. + if (MainWebViewActivity.darkTheme) { + domStorageImageView.setImageDrawable(getResources().getDrawable(R.drawable.dom_storage_ghosted_dark)); + } else { + domStorageImageView.setImageDrawable(getResources().getDrawable(R.drawable.dom_storage_ghosted_light)); + } } // Set the form data status. Once minimum API >= 21 we can use a selector as the tint mode instead of specifying different icons. @@ -212,8 +243,15 @@ public class DomainSettingsFragment extends Fragment { formDataEnabledSwitch.setChecked(true); formDataImageView.setImageDrawable(getResources().getDrawable(R.drawable.form_data_enabled)); } else { // Form data is disabled. + // Set the form data switch to off. formDataEnabledSwitch.setChecked(false); - formDataImageView.setImageDrawable(getResources().getDrawable(R.drawable.form_data_disabled_light)); + + // Set the icon according to the theme. + if (MainWebViewActivity.darkTheme) { + formDataImageView.setImageDrawable(getResources().getDrawable(R.drawable.form_data_disabled_dark)); + } else { + formDataImageView.setImageDrawable(getResources().getDrawable(R.drawable.form_data_disabled_light)); + } } // We need to inflated a `WebView` to get the default user agent. @@ -269,18 +307,38 @@ public class DomainSettingsFragment extends Fragment { switch (displayImagesInt) { case DomainsDatabaseHelper.DISPLAY_WEBPAGE_IMAGES_SYSTEM_DEFAULT: if (MainWebViewActivity.displayWebpageImagesBoolean) { - displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_enabled_light)); + // Set the icon according to the theme. + if (MainWebViewActivity.darkTheme) { + displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_enabled_dark)); + } else { + displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_enabled_light)); + } } else { - displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_disabled_light)); + // Set the icon according to the theme. + if (MainWebViewActivity.darkTheme) { + displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_disabled_dark)); + } else { + displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_disabled_light)); + } } break; case DomainsDatabaseHelper.DISPLAY_WEBPAGE_IMAGES_ENABLED: - displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_enabled_light)); + // Set the icon according to the theme. + if (MainWebViewActivity.darkTheme) { + displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_enabled_dark)); + } else { + displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_enabled_light)); + } break; case DomainsDatabaseHelper.DISPLAY_WEBPAGE_IMAGES_DISABLED: - displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_disabled_light)); + // Set the icon according to the theme. + if (MainWebViewActivity.darkTheme) { + displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_disabled_dark)); + } else { + displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_disabled_light)); + } break; } @@ -300,7 +358,12 @@ public class DomainSettingsFragment extends Fragment { if (domStorageEnabledSwitch.isChecked()) { // DOM storage is enabled. domStorageImageView.setImageDrawable(getResources().getDrawable(R.drawable.dom_storage_enabled)); } else { // DOM storage is disabled. - domStorageImageView.setImageDrawable(getResources().getDrawable(R.drawable.dom_storage_disabled_light)); + // Set the icon according to the theme. + if (MainWebViewActivity.darkTheme) { + domStorageImageView.setImageDrawable(getResources().getDrawable(R.drawable.dom_storage_disabled_dark)); + } else { + domStorageImageView.setImageDrawable(getResources().getDrawable(R.drawable.dom_storage_disabled_light)); + } } } else { // JavaScript is disabled. // Update the JavaScript icon. @@ -309,8 +372,12 @@ public class DomainSettingsFragment extends Fragment { // Disable the DOM storage `Switch`. domStorageEnabledSwitch.setEnabled(false); - // Set the DOM storage icon to be ghosted. - domStorageImageView.setImageDrawable(getResources().getDrawable(R.drawable.dom_storage_ghosted_light)); + // Set the DOM storage icon according to the theme. + if (MainWebViewActivity.darkTheme) { + domStorageImageView.setImageDrawable(getResources().getDrawable(R.drawable.dom_storage_ghosted_dark)); + } else { + domStorageImageView.setImageDrawable(getResources().getDrawable(R.drawable.dom_storage_ghosted_light)); + } } } }); @@ -330,17 +397,30 @@ public class DomainSettingsFragment extends Fragment { if (thirdPartyCookiesEnabledSwitch.isChecked()) { // Third-party cookies are enabled. thirdPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_warning)); } else { // Third-party cookies are disabled. - thirdPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_disabled_light)); + // Set the third-party cookies icon according to the theme. + if (MainWebViewActivity.darkTheme) { + thirdPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_disabled_dark)); + } else { + thirdPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_disabled_light)); + } } } else { // First-party cookies are disabled. - // Update the first-party cookies icon. - firstPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_disabled_light)); + // Update the first-party cookies icon according to the theme. + if (MainWebViewActivity.darkTheme) { + firstPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_disabled_dark)); + } else { + firstPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_disabled_light)); + } // Disable the third-party cookies `Switch`. thirdPartyCookiesEnabledSwitch.setEnabled(false); - // Set the third-party cookies icon to be ghosted. - thirdPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_ghosted_light)); + // Set the third-party cookies icon according to the theme. + if (MainWebViewActivity.darkTheme) { + thirdPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_ghosted_dark)); + } else { + thirdPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_ghosted_light)); + } } } }); @@ -353,7 +433,12 @@ public class DomainSettingsFragment extends Fragment { if (isChecked) { thirdPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_warning)); } else { - thirdPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_disabled_light)); + // Update the third-party cookies icon according to the theme. + if (MainWebViewActivity.darkTheme) { + thirdPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_disabled_dark)); + } else { + thirdPartyCookiesImageView.setImageDrawable(getResources().getDrawable(R.drawable.cookies_disabled_light)); + } } } }); @@ -366,7 +451,12 @@ public class DomainSettingsFragment extends Fragment { if (isChecked) { domStorageImageView.setImageDrawable(getResources().getDrawable(R.drawable.dom_storage_enabled)); } else { - domStorageImageView.setImageDrawable(getResources().getDrawable(R.drawable.dom_storage_disabled_light)); + // Set the icon according to the theme. + if (MainWebViewActivity.darkTheme) { + domStorageImageView.setImageDrawable(getResources().getDrawable(R.drawable.dom_storage_disabled_dark)); + } else { + domStorageImageView.setImageDrawable(getResources().getDrawable(R.drawable.dom_storage_disabled_light)); + } } } }); @@ -379,7 +469,12 @@ public class DomainSettingsFragment extends Fragment { if (isChecked) { formDataImageView.setImageDrawable(getResources().getDrawable(R.drawable.form_data_enabled)); } else { - formDataImageView.setImageDrawable(getResources().getDrawable(R.drawable.form_data_disabled_light)); + // Set the icon according to the theme. + if (MainWebViewActivity.darkTheme) { + formDataImageView.setImageDrawable(getResources().getDrawable(R.drawable.form_data_disabled_dark)); + } else { + formDataImageView.setImageDrawable(getResources().getDrawable(R.drawable.form_data_disabled_light)); + } } } }); @@ -436,18 +531,38 @@ public class DomainSettingsFragment extends Fragment { switch (position) { case DomainsDatabaseHelper.DISPLAY_WEBPAGE_IMAGES_SYSTEM_DEFAULT: if (MainWebViewActivity.displayWebpageImagesBoolean) { - displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_enabled_light)); + // Set the icon according to the theme. + if (MainWebViewActivity.darkTheme) { + displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_enabled_dark)); + } else { + displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_enabled_light)); + } } else { - displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_disabled_light)); + // Set the icon according to the theme. + if (MainWebViewActivity.darkTheme) { + displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_disabled_dark)); + } else { + displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_disabled_light)); + } } break; case DomainsDatabaseHelper.DISPLAY_WEBPAGE_IMAGES_ENABLED: - displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_enabled_light)); + // Set the icon according to the theme. + if (MainWebViewActivity.darkTheme) { + displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_enabled_dark)); + } else { + displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_enabled_light)); + } break; case DomainsDatabaseHelper.DISPLAY_WEBPAGE_IMAGES_DISABLED: - displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_disabled_light)); + // Set the icon according to the theme. + if (MainWebViewActivity.darkTheme) { + displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_disabled_dark)); + } else { + displayWebpageImagesImageView.setImageDrawable(getResources().getDrawable(R.drawable.images_disabled_light)); + } break; } } diff --git a/app/src/main/res/color/dark_primary_text_color_selector.xml b/app/src/main/res/color/primary_text_color_selector_dark.xml similarity index 89% rename from app/src/main/res/color/dark_primary_text_color_selector.xml rename to app/src/main/res/color/primary_text_color_selector_dark.xml index 27f283e5..d4cd7f84 100644 --- a/app/src/main/res/color/dark_primary_text_color_selector.xml +++ b/app/src/main/res/color/primary_text_color_selector_dark.xml @@ -20,7 +20,7 @@ - - + + \ No newline at end of file diff --git a/app/src/main/res/color/primary_text_color_selector_light.xml b/app/src/main/res/color/primary_text_color_selector_light.xml new file mode 100644 index 00000000..4ed8c1f8 --- /dev/null +++ b/app/src/main/res/color/primary_text_color_selector_light.xml @@ -0,0 +1,25 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/add_dark.xml b/app/src/main/res/drawable/add_dark.xml new file mode 100644 index 00000000..1da26b74 --- /dev/null +++ b/app/src/main/res/drawable/add_dark.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/app/src/main/res/drawable/add.xml b/app/src/main/res/drawable/add_light.xml similarity index 74% rename from app/src/main/res/drawable/add.xml rename to app/src/main/res/drawable/add_light.xml index d902679e..a64e797b 100644 --- a/app/src/main/res/drawable/add.xml +++ b/app/src/main/res/drawable/add_light.xml @@ -1,4 +1,4 @@ - + + + + + + diff --git a/app/src/main/res/drawable/delete.xml b/app/src/main/res/drawable/delete_light.xml similarity index 75% rename from app/src/main/res/drawable/delete.xml rename to app/src/main/res/drawable/delete_light.xml index eb9ac2ce..db7980d8 100644 --- a/app/src/main/res/drawable/delete.xml +++ b/app/src/main/res/drawable/delete_light.xml @@ -1,4 +1,4 @@ - + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/domains_list_selector_light.xml b/app/src/main/res/drawable/domains_list_selector_light.xml new file mode 100644 index 00000000..904cf996 --- /dev/null +++ b/app/src/main/res/drawable/domains_list_selector_light.xml @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-w900dp/domains_list.xml b/app/src/main/res/layout-w900dp/domains_list.xml index 455045e4..a97d59ec 100644 --- a/app/src/main/res/layout-w900dp/domains_list.xml +++ b/app/src/main/res/layout-w900dp/domains_list.xml @@ -38,7 +38,7 @@ android:layout_width="0dp" android:layout_weight="2" android:choiceMode="singleChoice" - android:divider="@color/white" + android:divider="@color/transparent" android:dividerHeight="0dp" /> + android:src="?attr/addIcon" /> \ No newline at end of file diff --git a/app/src/main/res/layout/domain_name_linearlayout.xml b/app/src/main/res/layout/domain_name_linearlayout.xml index a821d448..67a0597a 100644 --- a/app/src/main/res/layout/domain_name_linearlayout.xml +++ b/app/src/main/res/layout/domain_name_linearlayout.xml @@ -24,13 +24,13 @@ android:layout_height="wrap_content" android:layout_width="match_parent" android:orientation="horizontal" - android:background="@drawable/domains_list_selector" > + android:background="?attr/domainsListSelectorColor" > @@ -104,6 +104,7 @@ android:layout_marginTop="14dp" android:layout_marginBottom="14dp" android:text="@string/javascript_enabled" + android:textColor="?attr/primaryTextColorSelector" android:textSize="18sp" /> @@ -130,6 +131,7 @@ android:layout_marginTop="14dp" android:layout_marginBottom="14dp" android:text="@string/first_party_cookies_enabled" + android:textColor="?attr/primaryTextColorSelector" android:textSize="18sp" /> @@ -157,6 +159,7 @@ android:layout_marginTop="14dp" android:layout_marginBottom="14dp" android:text="@string/third_party_cookies_enabled" + android:textColor="?attr/primaryTextColorSelector" android:textSize="18sp" /> @@ -183,6 +186,7 @@ android:layout_marginTop="14dp" android:layout_marginBottom="14dp" android:text="@string/dom_storage_enabled" + android:textColor="?attr/primaryTextColorSelector" android:textSize="18sp" /> @@ -209,6 +213,7 @@ android:layout_marginTop="14dp" android:layout_marginBottom="14dp" android:text="@string/form_data_enabled" + android:textColor="?attr/primaryTextColorSelector" android:textSize="18sp" /> @@ -232,6 +237,7 @@ android:layout_marginEnd="10dp" android:layout_gravity="center_vertical" android:src="@drawable/user_agent_light" + android:tint="?attr/iconTintColor" android:contentDescription="@string/user_agent" /> @@ -35,17 +34,14 @@ + android:layout_width="match_parent" > - + android:background="?attr/colorPrimaryDark" + android:theme="?attr/appBarTextTheme" /> true` to make the status bar a transparent, darkened overlay. --> @@ -34,17 +33,14 @@ + android:layout_width="match_parent" > - + android:background="?attr/colorPrimaryDark" + android:theme="?attr/appBarTextTheme" /> @@ -56,5 +52,5 @@ android:layout_width="wrap_content" android:layout_gravity="bottom|end" android:layout_margin="16dp" - android:src="@drawable/add" /> + android:src="?attr/addIcon" /> \ No newline at end of file diff --git a/app/src/main/res/layout/domains_list.xml b/app/src/main/res/layout/domains_list.xml index cd76c68b..312f41f4 100644 --- a/app/src/main/res/layout/domains_list.xml +++ b/app/src/main/res/layout/domains_list.xml @@ -26,5 +26,5 @@ tools:context=".activities.DomainsActivity" android:layout_height="match_parent" android:layout_width="match_parent" - android:divider="@color/white" + android:divider="@color/transparent" android:dividerHeight="0dp" /> \ No newline at end of file diff --git a/app/src/main/res/menu/bookmarks_context_menu.xml b/app/src/main/res/menu/bookmarks_context_menu.xml index 0b7ce4ef..7ace26ce 100644 --- a/app/src/main/res/menu/bookmarks_context_menu.xml +++ b/app/src/main/res/menu/bookmarks_context_menu.xml @@ -54,7 +54,7 @@ android:id="@+id/delete_bookmark" android:title="@string/delete" android:orderInCategory="50" - android:icon="@drawable/delete" + android:icon="@drawable/delete_light" app:showAsAction="ifRoom" /> + @@ -36,8 +37,14 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 46629aaa..48d1f7c0 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -34,6 +34,7 @@ #FF1976D2 #FF1565C0 #FF0D47A1 + #FF082B61 #FF2962FF #FF607D8B diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index d493579d..de28d132 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -44,8 +44,13 @@ @color/blue_700 @color/blue_200 @color/blue_700 + @color/primary_text_color_selector_light + @drawable/domains_list_selector_light @color/blue_900 @color/blue_700 + @color/blue_800 + @drawable/delete_light + @drawable/add_light @style/PrivacyBrowserPopupsLight @style/PrivacyBrowserAppBarWhiteText @style/PrivacyBrowserTabLayoutLight @@ -88,7 +93,7 @@ When it is specified the root layout should include `android:fitsSystemWindows="true"`. --> @@ -135,6 +148,10 @@ @color/gray_300 + + -- 2.45.2