<activity
android:name=".activities.DomainsActivity"
android:label="@string/domains"
- android:theme="@style/PrivacyBrowserLight.SecondaryActivity"
android:parentActivityName=".activities.MainWebViewActivity"
android:screenOrientation="fullUser"
android:persistableMode="persistNever"
<activity
android:name=".activities.DomainSettingsActivity"
android:label="@string/domain_settings"
- android:theme="@style/PrivacyBrowserLight.SecondaryActivity"
android:parentActivityName=".activities.DomainsActivity"
android:configChanges="orientation|screenSize"
android:screenOrientation="fullUser"
@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.domain_settings_coordinatorlayout);
// We ned to use `SupportActionBar` from `android.support.v7.app.ActionBar` until the minimum API is >= 21.
@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();
// 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`.
// 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);
// 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);
// Enable the options `MenuItems`.
deleteMenuItem.setEnabled(true);
- deleteMenuItem.setIcon(R.drawable.delete);
+ deleteMenuItem.setIcon(R.drawable.delete_light);
saveMenuItem.setEnabled(true);
break;
// 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);
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;
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.
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));
}
}
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.
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.
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.
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;
}
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.
// 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));
+ }
}
}
});
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));
+ }
}
}
});
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));
+ }
}
}
});
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));
+ }
}
}
});
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));
+ }
}
}
});
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;
}
}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- Copyright © 2016-2017 Soren Stoutner <soren@stoutner.com>.
-
- This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
-
- Privacy Browser is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Privacy Browser is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
-
-<!-- Change the dark theme enabled text from white to gray. -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android" >
- <!-- `#4Dffffff` comes from the built-in `@color/primary_text_disabled_material_dark`. -->
- <item android:state_enabled="false" android:color="#4Dffffff" />
- <item android:color="@color/gray_300" />
-</selector>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2016-2017 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+
+ Privacy Browser is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Browser is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
+
+<!-- Change the dark theme enabled text from white to gray. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android" >
+ <!-- `#4DFFFFFF` comes from the built-in `@color/primary_text_disabled_material_dark`. -->
+ <item android:state_enabled="false" android:color="#4DFFFFFF" />
+ <item android:color="@color/gray_300" />
+</selector>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2016-2017 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+
+ Privacy Browser is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Browser is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
+
+<!-- Change the dark theme enabled text from white to gray. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android" >
+ <item android:state_enabled="false" android:color="@color/gray_400" />
+ <item android:color="@color/black" />
+</selector>
\ No newline at end of file
+++ /dev/null
-<!-- `add.xml` comes from the Android Material icon set, where it is called `ic_add`. It is released under the Apache License 2.0. -->
-<vector
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:height="24dp"
- android:width="24dp"
- android:viewportHeight="24.0"
- android:viewportWidth="24.0" >
-
- <!-- We have to use a hard coded color until API >= 21. Then we can use `@color`. -->
- <path
- android:fillColor="#FFFFFFFF"
- android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
-</vector>
--- /dev/null
+<!-- `add_dark.xml` comes from the Android Material icon set, where it is called `ic_add`. It is released under the Apache License 2.0. -->
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0" >
+
+ <!-- We have to use a hard coded color until API >= 21. Then we can use `@color`. -->
+ <path
+ android:fillColor="#FFE0E0E0"
+ android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
+</vector>
--- /dev/null
+<!-- `add_light.xml` comes from the Android Material icon set, where it is called `ic_add`. It is released under the Apache License 2.0. -->
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0" >
+
+ <!-- We have to use a hard coded color until API >= 21. Then we can use `@color`. -->
+ <path
+ android:fillColor="#FFFFFFFF"
+ android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
+</vector>
+++ /dev/null
-<!-- `delete.xml` comes from the Android Material icon set, where it is called `ic_delete`. It is released under the Apache License 2.0. -->
-<vector
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:height="24dp"
- android:width="24dp"
- android:viewportHeight="24.0"
- android:viewportWidth="24.0" >
-
- <!-- We have to use a hard coded color until API >= 21. Then we can use `@color`. -->
- <path
- android:fillColor="#FFFFFFFF"
- android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
-</vector>
--- /dev/null
+<!-- `delete_dark.xml` comes from the Android Material icon set, where it is called `ic_delete`. It is released under the Apache License 2.0. -->
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0" >
+
+ <!-- We have to use a hard coded color until API >= 21. Then we can use `@color`. -->
+ <path
+ android:fillColor="#FFE0E0E0"
+ android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
+</vector>
--- /dev/null
+<!-- `delete_light.xml` comes from the Android Material icon set, where it is called `ic_delete`. It is released under the Apache License 2.0. -->
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0" >
+
+ <!-- We have to use a hard coded color until API >= 21. Then we can use `@color`. -->
+ <path
+ android:fillColor="#FFFFFFFF"
+ android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
+</vector>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2017 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+
+ Privacy Browser is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Browser is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
+
+<!-- This selector changes the background of activated items in the domains `ListView`. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:state_activated="true"
+ android:drawable="@color/blue_700" />
+</selector>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2017 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+
+ Privacy Browser is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Browser is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
+
+<!-- This selector changes the background of activated items in the domains `ListView`. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:state_activated="true"
+ android:drawable="@color/blue_200" />
+</selector>
\ No newline at end of file
android:layout_width="0dp"
android:layout_weight="2"
android:choiceMode="singleChoice"
- android:divider="@color/white"
+ android:divider="@color/transparent"
android:dividerHeight="0dp" />
<ScrollView
android:layout_width="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
- android:src="@drawable/add" />
+ android:src="?attr/addIcon" />
</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal"
- android:background="@drawable/domains_list_selector" >
+ android:background="?attr/domainsListSelectorColor" >
<TextView
android:id="@+id/domain_name_textview"
android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:textColor="@color/black"
+ android:textColor="?android:attr/textColorPrimary"
android:textSize="22sp"
android:layout_margin="10dp"
android:maxLines="1"
android:layout_marginBottom="12dp"
android:layout_gravity="bottom"
android:src="@drawable/domains"
- android:tint="@color/blue_800"
+ android:tint="?attr/iconTintColor"
tools:ignore="contentDescription" />
<!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
android:layout_marginTop="14dp"
android:layout_marginBottom="14dp"
android:text="@string/javascript_enabled"
+ android:textColor="?attr/primaryTextColorSelector"
android:textSize="18sp" />
</LinearLayout>
android:layout_marginTop="14dp"
android:layout_marginBottom="14dp"
android:text="@string/first_party_cookies_enabled"
+ android:textColor="?attr/primaryTextColorSelector"
android:textSize="18sp" />
</LinearLayout>
android:layout_marginTop="14dp"
android:layout_marginBottom="14dp"
android:text="@string/third_party_cookies_enabled"
+ android:textColor="?attr/primaryTextColorSelector"
android:textSize="18sp" />
</LinearLayout>
android:layout_marginTop="14dp"
android:layout_marginBottom="14dp"
android:text="@string/dom_storage_enabled"
+ android:textColor="?attr/primaryTextColorSelector"
android:textSize="18sp" />
</LinearLayout>
android:layout_marginTop="14dp"
android:layout_marginBottom="14dp"
android:text="@string/form_data_enabled"
+ android:textColor="?attr/primaryTextColorSelector"
android:textSize="18sp" />
</LinearLayout>
android:layout_marginEnd="10dp"
android:layout_gravity="center_vertical"
android:src="@drawable/user_agent_light"
+ android:tint="?attr/iconTintColor"
android:contentDescription="@string/user_agent" />
<Spinner
android:layout_marginEnd="10dp"
android:layout_gravity="center_vertical"
android:src="@drawable/font_size_light"
+ android:tint="?attr/iconTintColor"
android:contentDescription="@string/font_size" />
<Spinner
<android.support.design.widget.CoordinatorLayout
android:id="@+id/domain_settings_coordinatorlayout"
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:fitsSystemWindows="true" >
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:theme="@style/PrivacyBrowserAppBarLight" >
+ android:layout_width="match_parent" >
- <!-- `android:theme="@style/PrivacyBrowser.DarkAppBar"1 makes the text and icons in the `AppBar` white. -->
<android.support.v7.widget.Toolbar
android:id="@+id/domain_settings_toolbar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:background="@color/blue_700"
- android:theme="@style/PrivacyBrowserAppBarWhiteText"
- app:popupTheme="@style/PrivacyBrowserPopupsLight" />
+ android:background="?attr/colorPrimaryDark"
+ android:theme="?attr/appBarTextTheme" />
</android.support.design.widget.AppBarLayout>
<ScrollView
<!-- `android:fitsSystemWindows="true"` moves the AppBar below the status bar. When it is specified the theme should include `<item name="android:windowTranslucentStatus">true</item>` to make the status bar a transparent, darkened overlay. -->
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:fitsSystemWindows="true" >
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:theme="@style/PrivacyBrowserAppBarLight" >
+ android:layout_width="match_parent" >
- <!-- `android:theme="@style/PrivacyBrowser.DarkAppBar"` makes the text and icons in the `AppBar` white. -->
<android.support.v7.widget.Toolbar
android:id="@+id/domains_toolbar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:background="@color/blue_700"
- android:theme="@style/PrivacyBrowserAppBarWhiteText"
- app:popupTheme="@style/PrivacyBrowserPopupsLight" />
+ android:background="?attr/colorPrimaryDark"
+ android:theme="?attr/appBarTextTheme" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/domains_list" />
android:layout_width="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
- android:src="@drawable/add" />
+ android:src="?attr/addIcon" />
</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file
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
android:id="@+id/delete_bookmark"
android:title="@string/delete"
android:orderInCategory="50"
- android:icon="@drawable/delete"
+ android:icon="@drawable/delete_light"
app:showAsAction="ifRoom" />
<item
android:id="@+id/delete_domain"
android:title="@string/delete"
android:orderInCategory="10"
- android:icon="@drawable/delete"
+ android:icon="?attr/deleteIcon"
app:showAsAction="ifRoom" />
<item
<attr name="aboutText" format="reference" />
<attr name="sslTitle" format="reference" />
<attr name="urlHistoryText" format="reference" />
+ <attr name="primaryTextColorSelector" format="reference" />
<attr name="navigationHeaderBackground" format="reference" />
<attr name="navigationHeaderTextColor" format="reference" />
<attr name="findOnPageIconTintColor" format="reference" />
+ <attr name="domainsListSelectorColor" format="reference" />
+
+ <attr name="iconTintColor" format="reference" />
+
<attr name="userAgentIcon" format="reference" />
<attr name="searchIcon" format="reference" />
<attr name="homepageIcon" format="reference" />
<attr name="fontSizeIcon" format="reference" />
+ <attr name="deleteIcon" format="reference" />
+ <attr name="addIcon" format="reference" />
</resources>
\ No newline at end of file
<color name="blue_700">#FF1976D2</color>
<color name="blue_800">#FF1565C0</color>
<color name="blue_900">#FF0D47A1</color>
+ <color name="blue_1000">#FF082B61</color>
<color name="blue_a700">#FF2962FF</color>
<color name="blue_gray_500">#FF607D8B</color>
<item name="colorPrimaryDark">@color/blue_700</item>
<item name="android:textColorHighlight">@color/blue_200</item>
<item name="android:actionModeBackground">@color/blue_700</item>
+ <item name="primaryTextColorSelector">@color/primary_text_color_selector_light</item>
+ <item name="domainsListSelectorColor">@drawable/domains_list_selector_light</item>
<item name="aboutTitle">@color/blue_900</item>
<item name="aboutText">@color/blue_700</item>
+ <item name="iconTintColor">@color/blue_800</item>
+ <item name="deleteIcon">@drawable/delete_light</item>
+ <item name="addIcon">@drawable/add_light</item>
<item name="actionBarPopupTheme">@style/PrivacyBrowserPopupsLight</item>
<item name="appBarTextTheme">@style/PrivacyBrowserAppBarWhiteText</item>
<item name="tabLayoutTheme">@style/PrivacyBrowserTabLayoutLight</item>
When it is specified the root layout should include `android:fitsSystemWindows="true"`. -->
<style name="PrivacyBrowserDark" parent="Theme.AppCompat.NoActionBar" >
<item name="android:windowTranslucentStatus">true</item>
- <item name="android:textColorPrimary">@color/dark_primary_text_color_selector</item>
+ <item name="android:textColorPrimary">@color/primary_text_color_selector_dark</item>
<item name="colorAccent">@color/blue_600</item>
<item name="android:textColorHighlight">@color/blue_800</item>
<item name="navigationHeaderBackground">@color/blue_800</item>
</style>
<style name="PrivacyBrowserDark.SecondaryActivity" >
- <item name="colorPrimaryDark">@color/blue_900</item>
- <item name="aboutTitle">@color/blue_700</item>
+ <item name="colorPrimaryDark">@color/blue_800</item>
+ <item name="primaryTextColorSelector">@color/primary_text_color_selector_dark</item>
+ <item name="aboutTitle">@color/blue_600</item>
<item name="aboutText">@color/blue_400</item>
+ <item name="domainsListSelectorColor">@drawable/domains_list_selector_dark</item>
+ <item name="iconTintColor">@color/blue_600</item>
+ <item name="deleteIcon">@drawable/delete_dark</item>
+ <item name="addIcon">@drawable/add_dark</item>
<item name="appBarTextTheme">@style/PrivacyBrowserAppBarDark</item>
<item name="tabLayoutTheme">@style/PrivacyBrowserTabLayoutDark</item>
+ <item name="android:spinnerDropDownItemStyle">@style/PrivacyBrowserSpinnerDropDownItemStyleDark</item>
</style>
<style name="PrivacyBrowserSettingsDark" parent="Theme.AppCompat" >
- <item name="android:textColorPrimary">@color/dark_primary_text_color_selector</item>
+ <item name="colorPrimary">@color/blue_800</item>
+ <item name="colorPrimaryDark">@color/blue_900</item>
+ <item name="android:textColorPrimary">@color/primary_text_color_selector_dark</item>
<item name="colorAccent">@color/blue_600</item>
<item name="userAgentIcon">@drawable/user_agent_dark</item>
<item name="searchIcon">@drawable/search_enabled_dark</item>
<!-- Configure the About and Guide `TabLayouts`. -->
<style name="PrivacyBrowserTabLayoutDark" parent="Widget.Design.TabLayout" >
<item name="tabBackground">@color/blue_900</item>
- <item name="android:textColorSecondary">@color/blue_400</item>
+ <item name="android:textColorSecondary">@color/blue_300</item>
<item name="tabIndicatorColor">@color/gray_300</item>
</style>
<item name="android:textColor">@color/gray_300</item>
</style>
+ <style name="PrivacyBrowserSpinnerDropDownItemStyleDark" parent="Base.Widget.AppCompat.TextView.SpinnerItem" >
+ <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" /> -->