updatePrivacyIcons(false);
// Get handles for the menu items.
+ MenuItem bookmarksMenuItem = menu.findItem(R.id.bookmarks);
MenuItem toggleFirstPartyCookiesMenuItem = menu.findItem(R.id.toggle_first_party_cookies);
MenuItem toggleThirdPartyCookiesMenuItem = menu.findItem(R.id.toggle_third_party_cookies);
- MenuItem toggleDomStorageMenuItem = menu.findItem(R.id.toggle_dom_storage);
MenuItem toggleSaveFormDataMenuItem = menu.findItem(R.id.toggle_save_form_data); // Form data can be removed once the minimum API >= 26.
MenuItem clearFormDataMenuItem = menu.findItem(R.id.clear_form_data); // Form data can be removed once the minimum API >= 26.
MenuItem refreshMenuItem = menu.findItem(R.id.refresh);
// Get the shared preferences.
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
- // Get the dark theme and app bar preferences..
- boolean displayAdditionalAppBarIcons = sharedPreferences.getBoolean("display_additional_app_bar_icons", false);
+ // Get the dark theme and app bar preferences.
+ boolean displayAdditionalAppBarIcons = sharedPreferences.getBoolean(getString(R.string.display_additional_app_bar_icons_key), false);
// Set the status of the additional app bar icons. Setting the refresh menu item to `SHOW_AS_ACTION_ALWAYS` makes it appear even on small devices like phones.
if (displayAdditionalAppBarIcons) {
- toggleFirstPartyCookiesMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
- toggleDomStorageMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
refreshMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
+ bookmarksMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
+ toggleFirstPartyCookiesMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
} else { //Do not display the additional icons.
- toggleFirstPartyCookiesMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
- toggleDomStorageMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
refreshMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
+ bookmarksMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
+ toggleFirstPartyCookiesMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
}
// Replace Refresh with Stop if a URL is already loading.
// Set the icon according to the current theme status.
if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
- refreshMenuItem.setIcon(R.drawable.close_day);
+ refreshMenuItem.setIcon(R.drawable.close_blue_day);
} else {
- refreshMenuItem.setIcon(R.drawable.close_night);
+ refreshMenuItem.setIcon(R.drawable.close_blue_night);
}
}
}
// Get handles for the menu items.
MenuItem privacyMenuItem = optionsMenu.findItem(R.id.toggle_javascript);
MenuItem firstPartyCookiesMenuItem = optionsMenu.findItem(R.id.toggle_first_party_cookies);
- MenuItem domStorageMenuItem = optionsMenu.findItem(R.id.toggle_dom_storage);
MenuItem refreshMenuItem = optionsMenu.findItem(R.id.refresh);
// Update the privacy icon.
}
}
- // Update the DOM storage icon.
- if (currentWebView.getSettings().getJavaScriptEnabled() && currentWebView.getSettings().getDomStorageEnabled()) { // Both JavaScript and DOM storage are enabled.
- domStorageMenuItem.setIcon(R.drawable.dom_storage_enabled);
- } else if (currentWebView.getSettings().getJavaScriptEnabled()) { // JavaScript is enabled but DOM storage is disabled.
+ // Update the refresh icon.
+ if (refreshMenuItem.getTitle() == getString(R.string.refresh)) { // The refresh icon is displayed.
+ // Set the icon according to the theme.
if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
- domStorageMenuItem.setIcon(R.drawable.dom_storage_disabled_day);
+ refreshMenuItem.setIcon(R.drawable.refresh_enabled_day);
} else {
- domStorageMenuItem.setIcon(R.drawable.dom_storage_disabled_night);
+ refreshMenuItem.setIcon(R.drawable.refresh_enabled_night);
}
- } else { // JavaScript is disabled, so DOM storage is ghosted.
+ } else { // The stop icon is displayed.
+ // Set the icon according to the theme.
if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
- domStorageMenuItem.setIcon(R.drawable.dom_storage_ghosted_day);
+ refreshMenuItem.setIcon(R.drawable.close_blue_day);
} else {
- domStorageMenuItem.setIcon(R.drawable.dom_storage_ghosted_night);
+ refreshMenuItem.setIcon(R.drawable.close_blue_night);
}
}
- // Update the refresh icon.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
- refreshMenuItem.setIcon(R.drawable.refresh_enabled_day);
- } else {
- refreshMenuItem.setIcon(R.drawable.refresh_enabled_night);
- }
-
// `invalidateOptionsMenu()` calls `onPrepareOptionsMenu()` and redraws the icons in the app bar.
if (runInvalidateOptionsMenu) {
invalidateOptionsMenu();
refreshMenuItem.setTitle(R.string.stop);
// Get the app bar and theme preferences.
- boolean displayAdditionalAppBarIcons = sharedPreferences.getBoolean("display_additional_app_bar_icons", false);
+ boolean displayAdditionalAppBarIcons = sharedPreferences.getBoolean(getString(R.string.display_additional_app_bar_icons_key), false);
// If the icon is displayed in the AppBar, set it according to the theme.
if (displayAdditionalAppBarIcons) {
// Set the stop icon according to the theme.
if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
- refreshMenuItem.setIcon(R.drawable.close_day);
+ refreshMenuItem.setIcon(R.drawable.close_blue_day);
} else {
- refreshMenuItem.setIcon(R.drawable.close_night);
+ refreshMenuItem.setIcon(R.drawable.close_blue_night);
}
}
}
refreshMenuItem.setTitle(R.string.refresh);
// Get the app bar and theme preferences.
- boolean displayAdditionalAppBarIcons = sharedPreferences.getBoolean("display_additional_app_bar_icons", false);
+ boolean displayAdditionalAppBarIcons = sharedPreferences.getBoolean(getString(R.string.display_additional_app_bar_icons_key), false);
// If the icon is displayed in the app bar, reset it according to the theme.
if (displayAdditionalAppBarIcons) {
+++ /dev/null
-<!-- This file comes from the Android Material icon set, where it is called `bookmarks`. It is released under the Apache License 2.0. -->
-
-<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true"` not applying to API < 21. -->
-<vector
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:height="24dp"
- android:width="24dp"
- android:viewportHeight="24"
- android:viewportWidth="24"
- tools:ignore="VectorRaster"
- android:autoMirrored="true" >
-
- <!-- A hard coded color must be used until API >= 21. Then `@color` or `?attr/colorControlNormal` may be used. -->
- <path
- android:fillColor="#FFFFFFFF"
- android:pathData="M19,18l2,1V3c0,-1.1 -0.9,-2 -2,-2H8.99C7.89,1 7,1.9 7,3h10c1.1,0 2,0.9 2,2v13zM15,5H5c-1.1,0 -2,0.9 -2,2v16l7,-3 7,3V7c0,-1.1 -0.9,-2 -2,-2z"/>
-</vector>
--- /dev/null
+<!-- This file comes from the Android Material icon set, where it is called `bookmarks`. It is released under the Apache License 2.0. -->
+
+<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true"` not applying to API < 21. -->
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportHeight="24"
+ android:viewportWidth="24"
+ tools:ignore="VectorRaster"
+ android:autoMirrored="true" >
+
+ <!-- A hard coded color must be used until API >= 21. Then `@color` or `?attr/colorControlNormal` may be used. -->
+ <path
+ android:fillColor="#FF1565C0"
+ android:pathData="M19,18l2,1V3c0,-1.1 -0.9,-2 -2,-2H8.99C7.89,1 7,1.9 7,3h10c1.1,0 2,0.9 2,2v13zM15,5H5c-1.1,0 -2,0.9 -2,2v16l7,-3 7,3V7c0,-1.1 -0.9,-2 -2,-2z"/>
+</vector>
--- /dev/null
+<!-- This file comes from the Android Material icon set, where it is called `bookmarks`. It is released under the Apache License 2.0. -->
+
+<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true"` not applying to API < 21. -->
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportHeight="24"
+ android:viewportWidth="24"
+ tools:ignore="VectorRaster"
+ android:autoMirrored="true" >
+
+ <!-- A hard coded color must be used until API >= 21. Then `@color` or `?attr/colorControlNormal` may be used. -->
+ <path
+ android:fillColor="#FF8AB4F8"
+ android:pathData="M19,18l2,1V3c0,-1.1 -0.9,-2 -2,-2H8.99C7.89,1 7,1.9 7,3h10c1.1,0 2,0.9 2,2v13zM15,5H5c-1.1,0 -2,0.9 -2,2v16l7,-3 7,3V7c0,-1.1 -0.9,-2 -2,-2z"/>
+</vector>
--- /dev/null
+<!-- This file comes from the Android Material icon set, where it is called `close`. 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"
+ android:viewportWidth="24" >
+
+ <!-- A hard coded color must be used until API >= 21. Then `@color` or `?attr/colorControlNormal` may be used instead. -->
+ <path
+ android:fillColor="#FF1565C0"
+ android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z" />
+</vector>
--- /dev/null
+<!-- This file comes from the Android Material icon set, where it is called `close`. 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"
+ android:viewportWidth="24" >
+
+ <!-- A hard coded color must be used until API >= 21. Then `@color` or `?attr/colorControlNormal` may be used instead. -->
+ <path
+ android:fillColor="#FF8AB4F8"
+ android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z" />
+</vector>
android:layout_gravity="bottom|end"
android:layout_marginEnd="16dp"
android:layout_marginBottom="155dp"
- android:src="@drawable/bookmarks"
- android:tint="?attr/fabIconTintColor" />
+ android:src="@drawable/bookmarks_day"
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/bookmarks" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/create_bookmark_folder_fab"
android:layout_marginEnd="16dp"
android:layout_marginBottom="85dp"
android:src="@drawable/create_folder"
- android:tint="?attr/fabIconTintColor" />
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/create_folder" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/create_bookmark_fab"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:src="@drawable/create_bookmark"
- android:tint="?attr/fabIconTintColor" />
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/create_bookmark" />
</FrameLayout>
\ No newline at end of file
android:layout_gravity="bottom|end"
android:layout_marginEnd="16dp"
android:layout_marginBottom="155dp"
- android:src="@drawable/bookmarks"
- android:tint="?attr/fabIconTintColor" />
+ android:src="@drawable/bookmarks_day"
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/bookmarks" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/create_bookmark_folder_fab"
android:layout_marginEnd="16dp"
android:layout_marginBottom="85dp"
android:src="@drawable/create_folder"
- android:tint="?attr/fabIconTintColor" />
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/create_folder" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/create_bookmark_fab"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:src="@drawable/create_bookmark"
- android:tint="?attr/fabIconTintColor" />
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/create_bookmark" />
</FrameLayout>
\ No newline at end of file
android:orderInCategory="200"
app:showAsAction="never" />
+ <!-- `android:iconTint` can be used once the minimum API >= 26 instead of including a separate drawable for each theme. -->
<item
android:id="@+id/bookmarks"
android:title="@string/bookmarks"
android:orderInCategory="300"
+ android:icon="?attr/bookmarksAppBarIcon"
app:showAsAction="never" />
<item
android:title="@string/dom_storage"
android:orderInCategory="600"
android:checkable="true"
- android:icon="@drawable/dom_storage_disabled_day"
app:showAsAction="never" />
<item
<string name="scroll_app_bar">App-Leiste scrollen</string>
<string name="scroll_app_bar_summary">Scrollt die App-Leiste mit der URL nach oben, wenn die Webseite gescrollt wird.</string>
<string name="display_additional_app_bar_icons">Weitere Icons in der Titelleiste</string>
- <string name="display_additional_app_bar_icons_summary">Zeigt in der App-Leiste die Icons zum Neu-Laden der Webseite und - sofern Platz vorhanden ist -
- zum Umschalten von Cookies und DOM Storage.</string>
<string name="app_theme">Erscheinungsbild</string>
<string-array name="app_theme_entries">
<item>System-Einstellung</item>
<string name="scroll_app_bar">Desplazar la barra de aplicaciones</string>
<string name="scroll_app_bar_summary">Desplazar la barra de aplicaciones desde la parte superior de la pantalla cuando el WebView se desplaza hacia abajo.</string>
<string name="display_additional_app_bar_icons">Mostrar iconos adicionales en la barra de aplicación</string>
- <string name="display_additional_app_bar_icons_summary">Mostrar iconos en la barra de aplicaciones para refrescar el WebView y, si hay espacio, para alternar entre cookies y almacenamiento DOM.</string>
<string name="app_theme">Tema de la app</string>
<string-array name="app_theme_entries">
<item>Por defecto del sistema</item>
<string name="scroll_app_bar">Défilement barre d\'applications</string>
<string name="scroll_app_bar_summary">Faites défiler la barre d\'applications en haut de l\'écran lorsque WebView défile vers le bas.</string>
<string name="display_additional_app_bar_icons">Icônes supplémentaires dans la barre d\'applications</string>
- <string name="display_additional_app_bar_icons_summary">Affichez des icônes dans la barre d\'applications pour actualiser WebView et, le cas échéant,
- pour activer/désactiver les cookies et le stockage DOM.</string>
<string name="app_theme">Thème de l\'application</string>
<string-array name="app_theme_entries">
<item>Par défaut</item>
<string name="scroll_app_bar">Permetti lo scrolling della barra dell\'applicazione</string>
<string name="scroll_app_bar_summary">Permette lo scorrere della barra dell\'applicazione dalla parte alta dello schermo quando si effettua lo scrolling.</string>
<string name="display_additional_app_bar_icons">Mostra icone addizionali nella barra dell\'applicazione</string>
- <string name="display_additional_app_bar_icons_summary">Mostra nella barra dell\'applicazione le icone per l\'aggiornamento di WebView e, se lo spazio è sufficiente,
- per l\'attivazione dei cookie e del DOM storage.</string>
<string name="app_theme">Tema Applicazione</string>
<string-array name="app_theme_entries">
<item>Predefinito</item>
<!-- Drawables. -->
<item name="listSelectorDrawable">@drawable/list_selector_night</item>
+ <!-- Main App Bar Icons. -->
+ <item name="bookmarksAppBarIcon">@drawable/bookmarks_night</item>
+
<!-- Options Icons. -->
<item name="aboutIcon">@drawable/about_night</item>
<item name="closeIcon">@drawable/close_night</item>
<!-- Drawables. -->
<item name="listSelectorDrawable">@drawable/list_selector_night</item>
+ <!-- Main App Bar Icons. -->
+ <item name="bookmarksAppBarIcon">@drawable/bookmarks_night</item>
+
<!-- Options Icons. -->
<item name="aboutIcon">@drawable/about_night</item>
<item name="closeIcon">@drawable/close_night</item>
<!-- Drawables. -->
<item name="listSelectorDrawable">@drawable/list_selector_night</item>
+ <!-- Main App Bar Icons. -->
+ <item name="bookmarksAppBarIcon">@drawable/bookmarks_night</item>
+
<!-- Options Icons. -->
<item name="aboutIcon">@drawable/about_night</item>
<item name="closeIcon">@drawable/close_night</item>
<string name="scroll_app_bar">Role a barra de aplicativos</string>
<string name="scroll_app_bar_summary">Role a barra de aplicativos para fora da parte superior da tela quando o WebView rola para baixo.</string>
<string name="display_additional_app_bar_icons">Exibir ícones adicionais da barra de aplicativos</string>
- <string name="display_additional_app_bar_icons_summary">Exibe ícones na barra de aplicativos para atualizar o WebView e, se houver espaço, para alternar cookies e armazenamento DOM.</string>
<string name="app_theme">Tema do aplicativo</string>
<string-array name="app_theme_entries">
<item>Padrão do Sitema</item>
<string name="scroll_app_bar">Прокручивать панель приложения</string>
<string name="scroll_app_bar_summary">Прокручивает панель приложения вверху экрана при прокрутке WebView вниз.</string>
<string name="display_additional_app_bar_icons">Отображать дополнительные значки на панели приложения</string>
- <string name="display_additional_app_bar_icons_summary">Отображать значки на панели приложения для обновления WebView и, при наличии места, для переключения файлов cookie и хранилища DOM</string>
<string name="app_theme">Тема приложения</string>
<string-array name="app_theme_entries">
<item>По умолчанию</item>
<string name="scroll_app_bar">Uygulama çubuğunu kaydır</string>
<string name="scroll_app_bar_summary">WebView aşağı kaydırıldığında, ekranın üst kısmından uygulama çubuğunu kaydırır.</string>
<string name="display_additional_app_bar_icons">Ek uygulama çubuğu simgelerini göster</string>
- <string name="display_additional_app_bar_icons_summary">WebView\'ı yenilemek, yer varsa çerezleri ve DOM depolamayı değiştirmek için simgeleri uygulama çubuğunda gösterir.</string>
<string name="wide_viewport_preference">Geniş ekran</string>
<string name="wide_viewport_summary">Geniş ekran kullanmak, bazı web sayfalarının düzenini masaüstü versiyonları gibi yapar.</string>
<string name="display_webpage_images">Web sayfasının görsellerini göster</string>
<!-- Drawables. -->
<item name="listSelectorDrawable">@drawable/list_selector_day</item>
+ <!-- Main App Bar Icons. -->
+ <item name="bookmarksAppBarIcon">@drawable/bookmarks_day</item>
+
<!-- Options Icons. -->
<item name="aboutIcon">@drawable/about_day</item>
<item name="closeIcon">@drawable/close_day</item>
<!-- Drawables. -->
<item name="listSelectorDrawable">@drawable/list_selector_day</item>
+ <!-- Main App Bar Icons. -->
+ <item name="bookmarksAppBarIcon">@drawable/bookmarks_day</item>
+
<!-- Options Icons. -->
<item name="aboutIcon">@drawable/about_day</item>
<item name="closeIcon">@drawable/close_day</item>
<!-- Drawables. -->
<attr name="listSelectorDrawable" format="reference" />
+ <!-- Main App Bar Icons. -->
+ <attr name="bookmarksAppBarIcon" format="reference" />
+
<!-- Options Icons. -->
<attr name="aboutIcon" format="reference" />
<attr name="appThemeIcon" format="reference" />
<string name="scroll_app_bar">Scroll the app bar</string>
<string name="scroll_app_bar_summary">Scroll the app bar off the top of the screen when the WebView scrolls down.</string>
<string name="display_additional_app_bar_icons">Display additional app bar icons</string>
- <string name="display_additional_app_bar_icons_summary">Display icons in the app bar for refreshing the WebView and, if there is room, for toggling cookies and DOM storage.</string>
+ <string name="display_additional_app_bar_icons_summary">Display icons in the app bar for refreshing the WebView and, if there is room, for opening the bookmarks drawer and toggling cookies.</string>
<string name="app_theme">App theme</string>
<string-array name="app_theme_entries">
<item>System default</item>
<!-- Non-translatable preference keys. -->
<string name="allow_screenshots_key" translatable="false">allow_screenshots</string>
<string name="clear_logcat_key" translatable="false">clear_logcat</string>
+ <string name="display_additional_app_bar_icons_key" translatable="false">display_additional_app_bar_icons</string>
<!-- Non-translatable preference default values. -->
- <string name="user_agent_default_value" translatable="false">Privacy Browser</string>
+ <string name="app_theme_default_value" translatable="false">System default</string>
<string name="custom_user_agent_default_value" translatable="false">PrivacyBrowser/1.0</string>
- <string name="search_default_value" translatable="false">https://www.startpage.com/do/search?query=</string>
- <string name="search_custom_url_default_value" translatable="false" />
- <string name="proxy_default_value" translatable="false">None</string>
- <string name="proxy_custom_url_default_value" translatable="false">http://localhost:8118</string>
- <string name="homepage_default_value" translatable="false">https://www.startpage.com/</string>
- <string name="download_location_default_value" translatable="false">Auto</string>
<string name="download_custom_location_default_value" translatable="false" />
+ <string name="download_location_default_value" translatable="false">Auto</string>
<string name="font_size_default_value" translatable="false">100</string>
- <string name="app_theme_default_value" translatable="false">System default</string>
+ <string name="homepage_default_value" translatable="false">https://www.startpage.com/</string>
+ <string name="proxy_custom_url_default_value" translatable="false">http://localhost:8118</string>
+ <string name="proxy_default_value" translatable="false">None</string>
+ <string name="search_custom_url_default_value" translatable="false" />
+ <string name="search_default_value" translatable="false">https://www.startpage.com/do/search?query=</string>
+ <string name="user_agent_default_value" translatable="false">Privacy Browser</string>
<string name="webview_theme_default_value" translatable="false">System default</string>
<!-- Ad Control. There are no ads in the standard flavor, but these strings must exist because they are referenced in the code. -->
<!-- Drawables. -->
<item name="listSelectorDrawable">@drawable/list_selector_day</item>
+ <!-- Main App Bar Icons. -->
+ <item name="bookmarksAppBarIcon">@drawable/bookmarks_day</item>
+
<!-- Options Icons. -->
<item name="aboutIcon">@drawable/about_day</item>
<item name="closeIcon">@drawable/close_day</item>