.gradle
/local.properties
-/.idea/caches
-/.idea/workspace.xml
-/.idea/libraries
+/.idea
.DS_Store
/build
/captures
<PersistentState>
<option name="values">
<map>
- <entry key="url" value="jar:file:/home/soren/Android/android-studio/plugins/android/lib/android.jar!/images/material/icons/materialicons/share/baseline_share_24.xml" />
+ <entry key="url" value="jar:file:/home/soren/Android/android-studio/plugins/android/lib/android.jar!/images/material/icons/materialicons/call_to_action/baseline_call_to_action_24.xml" />
</map>
</option>
</PersistentState>
</option>
<option name="values">
<map>
- <entry key="autoMirrored" value="true" />
- <entry key="outputName" value="share_day" />
+ <entry key="outputName" value="bottom_app_bar" />
<entry key="sourceFile" value="$USER_HOME$/ownCloud/Android/Privacy Browser/Icons/Icons/link_off_light.svg" />
</map>
</option>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- Copyright © 2016-2017,2019-2021 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/>. -->
-
-<!-- The ad size must be specified below to prevent an error being displayed on first app launch. <https://redmine.stoutner.com/issues/675> -->
-<com.google.android.gms.ads.AdView
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:ads="http://schemas.android.com/apk/res-auto"
- android:id="@+id/adview"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:layout_alignParentBottom="true"
- ads:adUnitId="@string/ad_unit_id"
- ads:adSize="SMART_BANNER" />
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2016-2017,2019-2021 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/>. -->
+
+<!-- The ad size must be specified below to prevent an error being displayed on first app launch. <https://redmine.stoutner.com/issues/675> -->
+<com.google.android.gms.ads.AdView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:ads="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/adview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_alignParentTop="true"
+ ads:adUnitId="@string/ad_unit_id"
+ ads:adSize="SMART_BANNER" />
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2016-2017,2019-2021 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/>. -->
+
+<!-- The ad size must be specified below to prevent an error being displayed on first app launch. <https://redmine.stoutner.com/issues/675> -->
+<com.google.android.gms.ads.AdView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:ads="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/adview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_alignParentBottom="true"
+ ads:adUnitId="@string/ad_unit_id"
+ ads:adSize="SMART_BANNER" />
\ No newline at end of file
<p><svg class="icon"><use href="../shared_images/arrow_forward.svg#icon"/></svg> arrow_forward.</p>
<p><svg class="icon"><use href="../shared_images/bookmarks.svg#icon"/></svg> bookmarks.</p>
<p><svg class="icon"><use href="../shared_images/bug_report.svg#icon"/></svg> bug_report.</p>
+ <p><svg class="icon"><use href="../shared_images/call_to_action.svg#icon"/></svg> call_to_action.</p>
<p><svg class="icon"><use href="../shared_images/camera_enhance.svg#icon"/></svg> camera_enhance.</p>
<p><svg class="icon"><use href="../shared_images/chrome_reader_mode.svg#icon"/></svg> chrome_reader_mode.</p>
<p><svg class="icon"><use href="../shared_images/close.svg#icon"/></svg> close.</p>
<p><svg class="icon"><use href="../shared_images/arrow_forward.svg#icon"/></svg> arrow_forward.</p>
<p><svg class="icon"><use href="../shared_images/bookmarks.svg#icon"/></svg> bookmarks.</p>
<p><svg class="icon"><use href="../shared_images/bug_report.svg#icon"/></svg> bug_report.</p>
+ <p><svg class="icon"><use href="../shared_images/call_to_action.svg#icon"/></svg> call_to_action.</p>
<p><svg class="icon"><use href="../shared_images/camera_enhance.svg#icon"/></svg> camera_enhance.</p>
<p><svg class="icon"><use href="../shared_images/chrome_reader_mode.svg#icon"/></svg> chrome_reader_mode.</p>
<p><svg class="icon"><use href="../shared_images/close.svg#icon"/></svg> close.</p>
<p><svg class="icon"><use href="../shared_images/arrow_forward.svg#icon"/></svg> arrow_forward.</p>
<p><svg class="icon"><use href="../shared_images/bookmarks.svg#icon"/></svg> bookmarks.</p>
<p><svg class="icon"><use href="../shared_images/bug_report.svg#icon"/></svg> bug_report.</p>
+ <p><svg class="icon"><use href="../shared_images/call_to_action.svg#icon"/></svg> call_to_action.</p>
<p><svg class="icon"><use href="../shared_images/camera_enhance.svg#icon"/></svg> camera_enhance.</p>
<p><svg class="icon"><use href="../shared_images/chrome_reader_mode.svg#icon"/></svg> chrome_reader_mode.</p>
<p><svg class="icon"><use href="../shared_images/close.svg#icon"/></svg> close.</p>
<p><svg class="icon"><use href="../shared_images/arrow_forward.svg#icon"/></svg> arrow_forward.</p>
<p><svg class="icon"><use href="../shared_images/bookmarks.svg#icon"/></svg> bookmarks.</p>
<p><svg class="icon"><use href="../shared_images/bug_report.svg#icon"/></svg> bug_report.</p>
+ <p><svg class="icon"><use href="../shared_images/call_to_action.svg#icon"/></svg> call_to_action.</p>
<p><svg class="icon"><use href="../shared_images/camera_enhance.svg#icon"/></svg> camera_enhance.</p>
<p><svg class="icon"><use href="../shared_images/chrome_reader_mode.svg#icon"/></svg> chrome_reader_mode.</p>
<p><svg class="icon"><use href="../shared_images/close.svg#icon"/></svg> close.</p>
<p>Il y a quelques années, le W3C (Consortium World Wide Web) a créé un mécanisme permettant aux navigateurs d'informer les serveurs Web qu'ils ne voudraient pas être suivis.
Ceci est réalisé en incluant un <a href="https://en.wikipedia.org/wiki/Do_Not_Track"> en-tête DNT (Ne pas suivre)</a> avec les requêtes Web.</p>
- <p>L'en-tête DNT ne fournit pas vraiment de confidentialité car la plupart des serveurs Web l'ignorent.
- Par exemple, Yahoo, Google, Microsoft et Facebook ignorent tous au moins certains en-têtes DNT.
- Beginning with version 3.8, Privacy Browser no longer has the option to send a DNT header.</p>
+ <p>L'en-tête DNT ne fournit pas vraiment de confidentialité car la plupart des serveurs Web l'ignorent. Par exemple, Yahoo, Google, Microsoft et Facebook ignorent tous au moins certains en-têtes DNT.
+ À partir de la version 3.8, Privacy Browser n'a plus l'option d'envoyer un en-tête DNT.</p>
<h3><svg class="header"><use href="../shared_images/link_off.svg#icon"/></svg> Modification d'URLs</h3>
<p><svg class="icon"><use href="../shared_images/arrow_forward.svg#icon"/></svg> arrow_forward.</p>
<p><svg class="icon"><use href="../shared_images/bookmarks.svg#icon"/></svg> bookmarks.</p>
<p><svg class="icon"><use href="../shared_images/bug_report.svg#icon"/></svg> bug_report.</p>
+ <p><svg class="icon"><use href="../shared_images/call_to_action.svg#icon"/></svg> call_to_action.</p>
<p><svg class="icon"><use href="../shared_images/camera_enhance.svg#icon"/></svg> camera_enhance.</p>
<p><svg class="icon"><use href="../shared_images/chrome_reader_mode.svg#icon"/></svg> chrome_reader_mode.</p>
<p><svg class="icon"><use href="../shared_images/close.svg#icon"/></svg> close.</p>
<p><svg class="icon"><use href="../shared_images/arrow_forward.svg#icon"/></svg> arrow_forward.</p>
<p><svg class="icon"><use href="../shared_images/bookmarks.svg#icon"/></svg> bookmarks.</p>
<p><svg class="icon"><use href="../shared_images/bug_report.svg#icon"/></svg> bug_report.</p>
+ <p><svg class="icon"><use href="../shared_images/call_to_action.svg#icon"/></svg> call_to_action.</p>
<p><svg class="icon"><use href="../shared_images/camera_enhance.svg#icon"/></svg> camera_enhance.</p>
<p><svg class="icon"><use href="../shared_images/chrome_reader_mode.svg#icon"/></svg> chrome_reader_mode.</p>
<p><svg class="icon"><use href="../shared_images/close.svg#icon"/></svg> close.</p>
<p><svg class="icon"><use href="../shared_images/arrow_forward.svg#icon"/></svg> arrow_forward.</p>
<p><svg class="icon"><use href="../shared_images/bookmarks.svg#icon"/></svg> bookmarks.</p>
<p><svg class="icon"><use href="../shared_images/bug_report.svg#icon"/></svg> bug_report.</p>
+ <p><svg class="icon"><use href="../shared_images/call_to_action.svg#icon"/></svg> call_to_action.</p>
<p><svg class="icon"><use href="../shared_images/camera_enhance.svg#icon"/></svg> camera_enhance.</p>
<p><svg class="icon"><use href="../shared_images/chrome_reader_mode.svg#icon"/></svg> chrome_reader_mode.</p>
<p><svg class="icon"><use href="../shared_images/close.svg#icon"/></svg> close.</p>
--- /dev/null
+<!--
+ Copyright © 2021 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+
+ It is a modified version of `call_to_action`, which is part of the Android Material icon set and is released under the Apache License 2.0.
+
+ 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/>. -->
+
+<svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 24 24"
+ id="icon" >
+
+ <path
+ d="M0 0h24v24H0V0z"
+ fill="none" />
+
+ <path
+ d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3v-3h18v3z" />
+</svg>
\ No newline at end of file
<p><svg class="icon"><use href="../shared_images/arrow_forward.svg#icon"/></svg> arrow_forward.</p>
<p><svg class="icon"><use href="../shared_images/bookmarks.svg#icon"/></svg> bookmarks.</p>
<p><svg class="icon"><use href="../shared_images/bug_report.svg#icon"/></svg> bug_report.</p>
+ <p><svg class="icon"><use href="../shared_images/call_to_action.svg#icon"/></svg> call_to_action.</p>
<p><svg class="icon"><use href="../shared_images/camera_enhance.svg#icon"/></svg> camera_enhance.</p>
<p><svg class="icon"><use href="../shared_images/chrome_reader_mode.svg#icon"/></svg> chrome_reader_mode.</p>
<p><svg class="icon"><use href="../shared_images/close.svg#icon"/></svg> close.</p>
// Get a handle for the shared preferences.
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this)
- // Get the screenshot preference.
+ // Get the preferences.
val allowScreenshots = sharedPreferences.getBoolean(getString(R.string.allow_screenshots_key), false)
+ val bottomAppBar = sharedPreferences.getBoolean(getString(R.string.bottom_app_bar_key), false)
// Disable screenshots if not allowed.
if (!allowScreenshots) {
val blocklistVersions = launchingIntent.getStringArrayExtra(BLOCKLIST_VERSIONS)!!
// Set the content view.
- setContentView(R.layout.about_coordinatorlayout)
+ if (bottomAppBar) {
+ setContentView(R.layout.about_coordinatorlayout_bottom_appbar)
+ } else {
+ setContentView(R.layout.about_coordinatorlayout_top_appbar)
+ }
// Get handles for the views.
val toolbar = findViewById<Toolbar>(R.id.about_toolbar)
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
+import android.view.Window;
import android.view.WindowManager;
import android.widget.AbsListView;
import android.widget.CursorAdapter;
// Get a handle for the shared preferences.
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
- // Get the screenshot preference.
- boolean allowScreenshots = sharedPreferences.getBoolean("allow_screenshots", false);
+ // Get the preferences.
+ boolean allowScreenshots = sharedPreferences.getBoolean(getString(R.string.allow_screenshots_key), false);
+ boolean bottomAppBar = sharedPreferences.getBoolean(getString(R.string.bottom_app_bar_key), false);
// Disable screenshots if not allowed.
if (!allowScreenshots) {
// Convert the favorite icon byte array to a bitmap.
Bitmap favoriteIconBitmap = BitmapFactory.decodeByteArray(favoriteIconByteArray, 0, favoriteIconByteArray.length);
- // Set the content view.
- setContentView(R.layout.bookmarks_coordinatorlayout);
+ // Set the content according to the app bar position.
+ if (bottomAppBar) {
+ // Set the content view.
+ setContentView(R.layout.bookmarks_coordinatorlayout_bottom_appbar);
+ } else {
+ // `Window.FEATURE_ACTION_MODE_OVERLAY` makes the contextual action mode cover the support action bar. It must be requested before the content is set.
+ supportRequestWindowFeature(Window.FEATURE_ACTION_MODE_OVERLAY);
+
+ // Set the content view.
+ setContentView(R.layout.bookmarks_coordinatorlayout_top_appbar);
+ }
- // The AndroidX toolbar must be used until the minimum API is >= 21.
+ // Get a handle for the toolbar.
final Toolbar toolbar = findViewById(R.id.bookmarks_toolbar);
+
+ // Set the support action bar.
setSupportActionBar(toolbar);
// Get handles for the views.
bookmarksListView.setItemChecked(i, true);
}
} else if (menuItemId == R.id.bookmarks_database_view) {
+ // Close the contextual action bar if it is displayed. This can happen if the bottom app bar is enabled.
+ if (contextualActionMode != null) {
+ contextualActionMode.finish();
+ }
+
// Create an intent to launch the bookmarks database view activity.
Intent bookmarksDatabaseViewIntent = new Intent(this, BookmarksDatabaseViewActivity.class);
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
+import android.view.Window;
import android.view.WindowManager;
import android.widget.AbsListView;
import android.widget.AdapterView;
// Get a handle for the shared preferences.
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
- // Get the screenshot preference.
- boolean allowScreenshots = sharedPreferences.getBoolean("allow_screenshots", false);
+ // Get the preferences.
+ boolean allowScreenshots = sharedPreferences.getBoolean(getString(R.string.allow_screenshots_key), false);
+ boolean bottomAppBar = sharedPreferences.getBoolean(getString(R.string.bottom_app_bar_key), false);
// Disable screenshots if not allowed.
if (!allowScreenshots) {
// Convert the favorite icon byte array to a bitmap and store it in a class variable.
Bitmap favoriteIconBitmap = BitmapFactory.decodeByteArray(favoriteIconByteArray, 0, favoriteIconByteArray.length);
- // Set the content view.
- setContentView(R.layout.bookmarks_databaseview_coordinatorlayout);
+ // Set the view according to the theme.
+ if (bottomAppBar) {
+ // Set the content view.
+ setContentView(R.layout.bookmarks_databaseview_coordinatorlayout_bottom_appbar);
+ } else {
+ // `Window.FEATURE_ACTION_MODE_OVERLAY` makes the contextual action mode cover the support action bar. It must be requested before the content is set.
+ supportRequestWindowFeature(Window.FEATURE_ACTION_MODE_OVERLAY);
+
+ // Set the content view.
+ setContentView(R.layout.bookmarks_databaseview_coordinatorlayout_top_appbar);
+ }
// Get a handle for the toolbar.
Toolbar toolbar = findViewById(R.id.bookmarks_databaseview_toolbar);
// Get a handle for the shared preferences.
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
- // Get the screenshot preference.
- boolean allowScreenshots = sharedPreferences.getBoolean("allow_screenshots", false);
+ // Get the preferences.
+ boolean allowScreenshots = sharedPreferences.getBoolean(getString(R.string.allow_screenshots_key), false);
+ boolean bottomAppBar = sharedPreferences.getBoolean(getString(R.string.bottom_app_bar_key), false);
// Disable screenshots if not allowed.
if (!allowScreenshots) {
sslEndDateLong = intent.getLongExtra("ssl_end_date", 0);
currentIpAddresses = intent.getStringExtra("current_ip_addresses");
- // Set the content view.
- setContentView(R.layout.domains_coordinatorlayout);
+ // Set the view.
+ if (bottomAppBar) {
+ setContentView(R.layout.domains_coordinatorlayout_bottom_appbar);
+ } else {
+ setContentView(R.layout.domains_coordinatorlayout_top_appbar);
+ }
// Populate the class variables.
coordinatorLayout = findViewById(R.id.domains_coordinatorlayout);
/*
- * Copyright © 2016-2020 Soren Stoutner <soren@stoutner.com>.
+ * Copyright © 2016-2021 Soren Stoutner <soren@stoutner.com>.
*
* This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
*
// Get a handle for the shared preferences.
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
- // Get the screenshot preference.
- boolean allowScreenshots = sharedPreferences.getBoolean("allow_screenshots", false);
+ // Get the preferences.
+ boolean allowScreenshots = sharedPreferences.getBoolean(getString(R.string.allow_screenshots_key), false);
+ boolean bottomAppBar = sharedPreferences.getBoolean(getString(R.string.bottom_app_bar_key), false);
// Disable screenshots if not allowed.
if (!allowScreenshots) {
super.onCreate(savedInstanceState);
// Set the content view.
- setContentView(R.layout.guide_coordinatorlayout);
+ if (bottomAppBar) {
+ setContentView(R.layout.guide_coordinatorlayout_bottom_appbar);
+ } else {
+ setContentView(R.layout.guide_coordinatorlayout_top_appbar);
+ }
- // The AndroidX toolbar must be used until the minimum API is >= 21.
+ // Get a handle for the toolbar.
Toolbar toolbar = findViewById(R.id.guide_toolbar);
+
+ // Set the support action bar.
setSupportActionBar(toolbar);
// Get a handle for the action bar.
// Get a handle for the shared preferences.
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
- // Get the screenshot preference.
- boolean allowScreenshots = sharedPreferences.getBoolean("allow_screenshots", false);
+ // Get the preferences.
+ boolean allowScreenshots = sharedPreferences.getBoolean(getString(R.string.allow_screenshots_key), false);
+ boolean bottomAppBar = sharedPreferences.getBoolean(getString(R.string.bottom_app_bar_key), false);
// Disable screenshots if not allowed.
if (!allowScreenshots) {
super.onCreate(savedInstanceState);
// Set the content view.
- setContentView(R.layout.import_export_coordinatorlayout);
+ if (bottomAppBar) {
+ setContentView(R.layout.import_export_coordinatorlayout_bottom_appbar);
+ } else {
+ setContentView(R.layout.import_export_coordinatorlayout_top_appbar);
+ }
- // Set the support action bar.
+ // Get a handle for the toolbar.
Toolbar toolbar = findViewById(R.id.import_export_toolbar);
+
+ // Set the support action bar.
setSupportActionBar(toolbar);
// Get a handle for the action bar.
// Get a handle for the shared preferences.
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
- // Get the screenshot preference.
+ // Get the preferences.
boolean allowScreenshots = sharedPreferences.getBoolean(getString(R.string.allow_screenshots_key), false);
+ boolean bottomAppBar = sharedPreferences.getBoolean(getString(R.string.bottom_app_bar_key), false);
// Disable screenshots if not allowed.
if (!allowScreenshots) {
super.onCreate(savedInstanceState);
// Set the content view.
- setContentView(R.layout.logcat_coordinatorlayout);
+ if (bottomAppBar) {
+ setContentView(R.layout.logcat_coordinatorlayout_bottom_appbar);
+ } else {
+ setContentView(R.layout.logcat_coordinatorlayout_top_appbar);
+ }
// Get handles for the views.
Toolbar toolbar = findViewById(R.id.logcat_toolbar);
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
+
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLDecoder;
import java.net.URLEncoder;
+
import java.text.NumberFormat;
+
import java.util.ArrayList;
+import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
private boolean downloadWithExternalApp;
private boolean hideAppBar;
private boolean scrollAppBar;
+ private boolean bottomAppBar;
private boolean loadingNewIntent;
private boolean reapplyDomainSettingsOnRestart;
private boolean reapplyAppSettingsOnRestart;
private boolean sanitizeFacebookClickIds;
private boolean sanitizeTwitterAmpRedirects;
+ // Define the class variables.
+ private long lastScrollUpdate = 0;
+
// Declare the class views.
private FrameLayout rootFrameLayout;
private DrawerLayout drawerLayout;
// Get a handle for the shared preferences.
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
- // Get the screenshot preference.
+ // Get the preferences.
String appTheme = sharedPreferences.getString("app_theme", getString(R.string.app_theme_default_value));
boolean allowScreenshots = sharedPreferences.getBoolean(getString(R.string.allow_screenshots_key), false);
+ bottomAppBar = sharedPreferences.getBoolean(getString(R.string.bottom_app_bar_key), false);
// Get the theme entry values string array.
String[] appThemeEntryValuesStringArray = getResources().getStringArray(R.array.app_theme_entry_values);
setTheme(R.style.PrivacyBrowser);
// Set the content view.
- setContentView(R.layout.main_framelayout);
+ if (bottomAppBar) {
+ setContentView(R.layout.main_framelayout_bottom_appbar);
+ } else {
+ setContentView(R.layout.main_framelayout_top_appbar);
+ }
// Get handles for the views.
rootFrameLayout = findViewById(R.id.root_framelayout);
});
// Implement swipe to refresh.
- swipeRefreshLayout.setOnRefreshListener(() -> currentWebView.reload());
+ swipeRefreshLayout.setOnRefreshListener(() -> {
+ // Check the visibility of the bottom app bar. Sometimes it is hidden if the WebView is the same size as the visible screen.
+ if (bottomAppBar && scrollAppBar && (appBarLayout.getVisibility() == View.GONE)) { // The bottom app bar is currently hidden.
+ // Show the app bar.
+ appBarLayout.setVisibility(View.VISIBLE);
+
+ // Disable the refreshing animation.
+ swipeRefreshLayout.setRefreshing(false);
+ } else { // A bottom app bar is not currently hidden.
+ // Reload the website.
+ currentWebView.reload();
+ }
+ });
// Store the default progress view offsets for use later in `initializeWebView()`.
defaultProgressViewStartOffset = swipeRefreshLayout.getProgressViewStartOffset();
// Apply the proxy.
applyProxy(false);
- // Get the current layout parameters. Using coordinator layout parameters allows the `setBehavior()` command and using app bar layout parameters allows the `setScrollFlags()` command.
- CoordinatorLayout.LayoutParams swipeRefreshLayoutParams = (CoordinatorLayout.LayoutParams) swipeRefreshLayout.getLayoutParams();
- AppBarLayout.LayoutParams toolbarLayoutParams = (AppBarLayout.LayoutParams) toolbar.getLayoutParams();
- AppBarLayout.LayoutParams findOnPageLayoutParams = (AppBarLayout.LayoutParams) findOnPageLinearLayout.getLayoutParams();
- AppBarLayout.LayoutParams tabsLayoutParams = (AppBarLayout.LayoutParams) tabsLinearLayout.getLayoutParams();
-
- // Add the scrolling behavior to the layout parameters.
- if (scrollAppBar) {
- // Enable scrolling of the app bar.
- swipeRefreshLayoutParams.setBehavior(new AppBarLayout.ScrollingViewBehavior());
- toolbarLayoutParams.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS | AppBarLayout.LayoutParams.SCROLL_FLAG_SNAP);
- findOnPageLayoutParams.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS | AppBarLayout.LayoutParams.SCROLL_FLAG_SNAP);
- tabsLayoutParams.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS | AppBarLayout.LayoutParams.SCROLL_FLAG_SNAP);
- } else {
- // Disable scrolling of the app bar.
- swipeRefreshLayoutParams.setBehavior(null);
- toolbarLayoutParams.setScrollFlags(0);
- findOnPageLayoutParams.setScrollFlags(0);
- tabsLayoutParams.setScrollFlags(0);
-
- // Expand the app bar if it is currently collapsed.
- appBarLayout.setExpanded(true);
- }
-
- // Apply the modified layout parameters.
- swipeRefreshLayout.setLayoutParams(swipeRefreshLayoutParams);
- toolbar.setLayoutParams(toolbarLayoutParams);
- findOnPageLinearLayout.setLayoutParams(findOnPageLayoutParams);
- tabsLinearLayout.setLayoutParams(tabsLayoutParams);
+ // Adjust the layout and scrolling parameters if the app bar is at the top of the screen.
+ if (!bottomAppBar) {
+ // Get the current layout parameters. Using coordinator layout parameters allows the `setBehavior()` command and using app bar layout parameters allows the `setScrollFlags()` command.
+ CoordinatorLayout.LayoutParams swipeRefreshLayoutParams = (CoordinatorLayout.LayoutParams) swipeRefreshLayout.getLayoutParams();
+ AppBarLayout.LayoutParams toolbarLayoutParams = (AppBarLayout.LayoutParams) toolbar.getLayoutParams();
+ AppBarLayout.LayoutParams findOnPageLayoutParams = (AppBarLayout.LayoutParams) findOnPageLinearLayout.getLayoutParams();
+ AppBarLayout.LayoutParams tabsLayoutParams = (AppBarLayout.LayoutParams) tabsLinearLayout.getLayoutParams();
+
+ // Add the scrolling behavior to the layout parameters.
+ if (scrollAppBar) {
+ // Enable scrolling of the app bar.
+ swipeRefreshLayoutParams.setBehavior(new AppBarLayout.ScrollingViewBehavior());
+ toolbarLayoutParams.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS | AppBarLayout.LayoutParams.SCROLL_FLAG_SNAP);
+ findOnPageLayoutParams.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS | AppBarLayout.LayoutParams.SCROLL_FLAG_SNAP);
+ tabsLayoutParams.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS | AppBarLayout.LayoutParams.SCROLL_FLAG_SNAP);
+ } else {
+ // Disable scrolling of the app bar.
+ swipeRefreshLayoutParams.setBehavior(null);
+ toolbarLayoutParams.setScrollFlags(0);
+ findOnPageLayoutParams.setScrollFlags(0);
+ tabsLayoutParams.setScrollFlags(0);
+
+ // Expand the app bar if it is currently collapsed.
+ appBarLayout.setExpanded(true);
+ }
- // Set the app bar scrolling for each WebView.
- for (int i = 0; i < webViewPagerAdapter.getCount(); i++) {
- // Get the WebView tab fragment.
- WebViewTabFragment webViewTabFragment = webViewPagerAdapter.getPageFragment(i);
+ // Set the app bar scrolling for each WebView.
+ for (int i = 0; i < webViewPagerAdapter.getCount(); i++) {
+ // Get the WebView tab fragment.
+ WebViewTabFragment webViewTabFragment = webViewPagerAdapter.getPageFragment(i);
- // Get the fragment view.
- View fragmentView = webViewTabFragment.getView();
+ // Get the fragment view.
+ View fragmentView = webViewTabFragment.getView();
- // Only modify the WebViews if they exist.
- if (fragmentView != null) {
- // Get the nested scroll WebView from the tab fragment.
- NestedScrollWebView nestedScrollWebView = fragmentView.findViewById(R.id.nestedscroll_webview);
+ // Only modify the WebViews if they exist.
+ if (fragmentView != null) {
+ // Get the nested scroll WebView from the tab fragment.
+ NestedScrollWebView nestedScrollWebView = fragmentView.findViewById(R.id.nestedscroll_webview);
- // Set the app bar scrolling.
- nestedScrollWebView.setNestedScrollingEnabled(scrollAppBar);
+ // Set the app bar scrolling.
+ nestedScrollWebView.setNestedScrollingEnabled(scrollAppBar);
+ }
}
}
// Hide the action bar.
actionBar.hide();
- // Check to see if the app bar is normally scrolled.
- if (scrollAppBar) { // The app bar is scrolled when it is displayed.
- // Get the swipe refresh layout parameters.
- CoordinatorLayout.LayoutParams swipeRefreshLayoutParams = (CoordinatorLayout.LayoutParams) swipeRefreshLayout.getLayoutParams();
-
- // Remove the off-screen scrolling layout.
- swipeRefreshLayoutParams.setBehavior(null);
- } else { // The app bar is not scrolled when it is displayed.
- // Remove the padding from the top of the swipe refresh layout.
- swipeRefreshLayout.setPadding(0, 0, 0, 0);
-
- // The swipe refresh circle must be moved above the now removed status bar location.
- swipeRefreshLayout.setProgressViewOffset(false, -200, defaultProgressViewEndOffset);
+ // Set layout and scrolling parameters if the app bar is at the top of the screen.
+ if (!bottomAppBar) {
+ // Check to see if the app bar is normally scrolled.
+ if (scrollAppBar) { // The app bar is scrolled when it is displayed.
+ // Get the swipe refresh layout parameters.
+ CoordinatorLayout.LayoutParams swipeRefreshLayoutParams = (CoordinatorLayout.LayoutParams) swipeRefreshLayout.getLayoutParams();
+
+ // Remove the off-screen scrolling layout.
+ swipeRefreshLayoutParams.setBehavior(null);
+ } else { // The app bar is not scrolled when it is displayed.
+ // Remove the padding from the top of the swipe refresh layout.
+ swipeRefreshLayout.setPadding(0, 0, 0, 0);
+
+ // The swipe refresh circle must be moved above the now removed status bar location.
+ swipeRefreshLayout.setProgressViewOffset(false, -200, defaultProgressViewEndOffset);
+ }
}
}
// Show the action bar.
actionBar.show();
- // Check to see if the app bar is normally scrolled.
- if (scrollAppBar) { // The app bar is scrolled when it is displayed.
- // Get the swipe refresh layout parameters.
- CoordinatorLayout.LayoutParams swipeRefreshLayoutParams = (CoordinatorLayout.LayoutParams) swipeRefreshLayout.getLayoutParams();
-
- // Add the off-screen scrolling layout.
- swipeRefreshLayoutParams.setBehavior(new AppBarLayout.ScrollingViewBehavior());
- } else { // The app bar is not scrolled when it is displayed.
- // The swipe refresh layout must be manually moved below the app bar layout.
- swipeRefreshLayout.setPadding(0, appBarHeight, 0, 0);
-
- // The swipe to refresh circle doesn't always hide itself completely unless it is moved up 10 pixels.
- swipeRefreshLayout.setProgressViewOffset(false, defaultProgressViewStartOffset - 10 + appBarHeight, defaultProgressViewEndOffset + appBarHeight);
+ // Set layout and scrolling parameters if the app bar is at the top of the screen.
+ if (!bottomAppBar) {
+ // Check to see if the app bar is normally scrolled.
+ if (scrollAppBar) { // The app bar is scrolled when it is displayed.
+ // Get the swipe refresh layout parameters.
+ CoordinatorLayout.LayoutParams swipeRefreshLayoutParams = (CoordinatorLayout.LayoutParams) swipeRefreshLayout.getLayoutParams();
+
+ // Add the off-screen scrolling layout.
+ swipeRefreshLayoutParams.setBehavior(new AppBarLayout.ScrollingViewBehavior());
+ } else { // The app bar is not scrolled when it is displayed.
+ // The swipe refresh layout must be manually moved below the app bar layout.
+ swipeRefreshLayout.setPadding(0, appBarHeight, 0, 0);
+
+ // The swipe to refresh circle doesn't always hide itself completely unless it is moved up 10 pixels.
+ swipeRefreshLayout.setProgressViewOffset(false, defaultProgressViewStartOffset - 10 + appBarHeight, defaultProgressViewEndOffset + appBarHeight);
+ }
}
}
// Update the status of swipe to refresh based on the scroll position of the nested scroll WebView. Also reinforce full screen browsing mode.
// On API < 23, `getViewTreeObserver().addOnScrollChangedListener()` must be used, but it is a little bit buggy and appears to get garbage collected from time to time.
if (Build.VERSION.SDK_INT >= 23) {
- nestedScrollWebView.setOnScrollChangeListener((view, i, i1, i2, i3) -> {
+ nestedScrollWebView.setOnScrollChangeListener((view, scrollX, scrollY, oldScrollX, oldScrollY) -> {
+ // Set the swipe to refresh status.
if (nestedScrollWebView.getSwipeToRefresh()) {
// Only enable swipe to refresh if the WebView is scrolled to the top.
swipeRefreshLayout.setEnabled(nestedScrollWebView.getScrollY() == 0);
swipeRefreshLayout.setEnabled(false);
}
+ // Set the visibility of the bottom app bar.
+ if (bottomAppBar && scrollAppBar && (Calendar.getInstance().getTimeInMillis() - lastScrollUpdate > 100)) {
+ if (scrollY - oldScrollY > 25) { // The WebView was scrolled down.
+ appBarLayout.setVisibility(View.GONE);
+ } else if (scrollY - oldScrollY < -25) { // The WebView was scrolled up.
+ appBarLayout.setVisibility(View.VISIBLE);
+ }
+
+ // Update the last scroll update variable. This prevents the app bar from flashing on and off at the bottom of the screen.
+ lastScrollUpdate = Calendar.getInstance().getTimeInMillis();
+ }
+
// Reinforce the system UI visibility flags if in full screen browsing mode.
// This hides the status and navigation bars, which are displayed if other elements are shown, like dialog boxes, the options menu, or the keyboard.
if (inFullScreenBrowsingMode) {
swipeRefreshLayout.setEnabled(false);
}
-
// Reinforce the system UI visibility flags if in full screen browsing mode.
// This hides the status and navigation bars, which are displayed if other elements are shown, like dialog boxes, the options menu, or the keyboard.
if (inFullScreenBrowsingMode) {
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
- // Get the preferences.
- boolean scrollAppBar = sharedPreferences.getBoolean("scroll_app_bar", true);
-
- // Set the top padding of the swipe refresh layout according to the app bar scrolling preference. This can't be done in `appAppSettings()` because the app bar is not yet populated there.
- if (scrollAppBar || (inFullScreenBrowsingMode && hideAppBar)) {
- // No padding is needed because it will automatically be placed below the app bar layout due to the scrolling layout behavior.
- swipeRefreshLayout.setPadding(0, 0, 0, 0);
-
- // The swipe to refresh circle doesn't always hide itself completely unless it is moved up 10 pixels.
- swipeRefreshLayout.setProgressViewOffset(false, defaultProgressViewStartOffset - 10, defaultProgressViewEndOffset);
- } else {
- // Get the app bar layout height. This can't be done in `applyAppSettings()` because the app bar is not yet populated there.
- appBarHeight = appBarLayout.getHeight();
-
- // The swipe refresh layout must be manually moved below the app bar layout.
- swipeRefreshLayout.setPadding(0, appBarHeight, 0, 0);
-
- // The swipe to refresh circle doesn't always hide itself completely unless it is moved up 10 pixels.
- swipeRefreshLayout.setProgressViewOffset(false, defaultProgressViewStartOffset - 10 + appBarHeight, defaultProgressViewEndOffset + appBarHeight);
+ // Set the padding and layout settings if the app bar is at the top of the screen.
+ if (!bottomAppBar) {
+ // Set the top padding of the swipe refresh layout according to the app bar scrolling preference. This can't be done in `appAppSettings()` because the app bar is not yet populated there.
+ if (scrollAppBar || (inFullScreenBrowsingMode && hideAppBar)) {
+ // No padding is needed because it will automatically be placed below the app bar layout due to the scrolling layout behavior.
+ swipeRefreshLayout.setPadding(0, 0, 0, 0);
+
+ // The swipe to refresh circle doesn't always hide itself completely unless it is moved up 10 pixels.
+ swipeRefreshLayout.setProgressViewOffset(false, defaultProgressViewStartOffset - 10, defaultProgressViewEndOffset);
+ } else {
+ // Get the app bar layout height. This can't be done in `applyAppSettings()` because the app bar is not yet populated there.
+ appBarHeight = appBarLayout.getHeight();
+
+ // The swipe refresh layout must be manually moved below the app bar layout.
+ swipeRefreshLayout.setPadding(0, appBarHeight, 0, 0);
+
+ // The swipe to refresh circle doesn't always hide itself completely unless it is moved up 10 pixels.
+ swipeRefreshLayout.setProgressViewOffset(false, defaultProgressViewStartOffset - 10 + appBarHeight, defaultProgressViewEndOffset + appBarHeight);
+ }
}
// Reset the list of resource requests.
// Get a handle for the shared preferences.
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
- // Get the screenshot preference.
- boolean allowScreenshots = sharedPreferences.getBoolean("allow_screenshots", false);
+ // Get the preferences.
+ boolean allowScreenshots = sharedPreferences.getBoolean(getString(R.string.allow_screenshots_key), false);
+ boolean bottomAppBar = sharedPreferences.getBoolean(getString(R.string.bottom_app_bar_key), false);
// Disable screenshots if not allowed.
if (!allowScreenshots) {
boolean blockAllThirdPartyRequests = intent.getBooleanExtra("block_all_third_party_requests", false);
// Set the content view.
- setContentView(R.layout.requests_coordinatorlayout);
+ if (bottomAppBar) {
+ setContentView(R.layout.requests_coordinatorlayout_bottom_appbar);
+ } else {
+ setContentView(R.layout.requests_coordinatorlayout_top_appbar);
+ }
// Use the AndroidX toolbar until the minimum API is >= 21.
Toolbar toolbar = findViewById(R.id.requests_toolbar);
// Get a handle for the shared preferences.
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(applicationContext)
- // Get the screenshot preference.
+ // Get the preferences.
val allowScreenshots = sharedPreferences.getBoolean(getString(R.string.allow_screenshots_key), false)
+ val bottomAppBar = sharedPreferences.getBoolean(getString(R.string.bottom_app_bar_key), false)
// Disable screenshots if not allowed.
if (!allowScreenshots) {
val userAgent = intent.getStringExtra(USER_AGENT)!!
// Set the content view.
- setContentView(R.layout.view_source_coordinatorlayout)
+ if (bottomAppBar) {
+ setContentView(R.layout.view_source_coordinatorlayout_bottom_appbar)
+ } else {
+ setContentView(R.layout.view_source_coordinatorlayout_top_appbar)
+ }
// Get a handle for the toolbar.
val toolbar = findViewById<Toolbar>(R.id.view_source_toolbar)
import com.stoutner.privacybrowser.R
import com.stoutner.privacybrowser.activities.MainWebViewActivity
import com.stoutner.privacybrowser.views.NestedScrollWebView
+
import java.io.ByteArrayOutputStream
import java.text.DateFormat
private Preference swipeToRefreshPreference;
private Preference downloadWithExternalAppPreference;
private Preference scrollAppBarPreference;
+ private Preference bottomAppBarPreference;
private Preference displayAdditionalAppBarIconsPreference;
private Preference appThemePreference;
private Preference webViewThemePreference;
swipeToRefreshPreference = findPreference("swipe_to_refresh");
downloadWithExternalAppPreference = findPreference(getString(R.string.download_with_external_app_key));
scrollAppBarPreference = findPreference("scroll_app_bar");
+ bottomAppBarPreference = findPreference(getString(R.string.bottom_app_bar_key));
displayAdditionalAppBarIconsPreference = findPreference(getString(R.string.display_additional_app_bar_icons_key));
appThemePreference = findPreference("app_theme");
webViewThemePreference = findPreference("webview_theme");
assert swipeToRefreshPreference != null;
assert downloadWithExternalAppPreference != null;
assert scrollAppBarPreference != null;
+ assert bottomAppBarPreference != null;
assert displayAdditionalAppBarIconsPreference != null;
assert appThemePreference != null;
assert webViewThemePreference != null;
}
}
+ // Set the bottom app bar preference icon.
+ if (sharedPreferences.getBoolean(getString(R.string.bottom_app_bar_key), false)) {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
+ bottomAppBarPreference.setIcon(R.drawable.bottom_app_bar_enabled_day);
+ } else {
+ bottomAppBarPreference.setIcon(R.drawable.bottom_app_bar_enabled_night);
+ }
+ } else {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
+ bottomAppBarPreference.setIcon(R.drawable.bottom_app_bar_disabled_day);
+ } else {
+ bottomAppBarPreference.setIcon(R.drawable.bottom_app_bar_disabled_night);
+ }
+ }
+
// Set the display additional app bar icons preference icon.
if (sharedPreferences.getBoolean(getString(R.string.display_additional_app_bar_icons_key), false)) {
if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
}
}
- // Create an intent to restart Privacy Browser.
- Intent allowScreenshotsRestartIntent = requireActivity().getParentActivityIntent();
-
- // Assert that the intent is not null to remove the lint error below.
- assert allowScreenshotsRestartIntent != null;
-
- // `Intent.FLAG_ACTIVITY_CLEAR_TASK` removes all activities from the stack. It requires `Intent.FLAG_ACTIVITY_NEW_TASK`.
- allowScreenshotsRestartIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
-
- // Create a handler to restart the activity.
- Handler allowScreenshotsRestartHandler = new Handler(Looper.getMainLooper());
-
- // Create a runnable to restart the activity.
- Runnable allowScreenshotsRestartRunnable = () -> {
- // Restart the activity.
- startActivity(allowScreenshotsRestartIntent);
-
- // Kill this instance of Privacy Browser. Otherwise, the app exhibits sporadic behavior after the restart.
- System.exit(0);
- };
-
- // Restart the activity after 150 milliseconds, so that the app has enough time to save the change to the preference.
- allowScreenshotsRestartHandler.postDelayed(allowScreenshotsRestartRunnable, 150);
+ // Restart Privacy Browser.
+ restartPrivacyBrowser();
break;
case "easylist":
}
break;
+ case "bottom_app_bar":
+ // Update the icon.
+ if (sharedPreferences.getBoolean(context.getString(R.string.bottom_app_bar_key), false)) {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
+ bottomAppBarPreference.setIcon(R.drawable.bottom_app_bar_enabled_day);
+ } else {
+ bottomAppBarPreference.setIcon(R.drawable.bottom_app_bar_enabled_night);
+ }
+ } else {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
+ bottomAppBarPreference.setIcon(R.drawable.bottom_app_bar_disabled_day);
+ } else {
+ bottomAppBarPreference.setIcon(R.drawable.bottom_app_bar_disabled_night);
+ }
+ }
+
+ // Restart Privacy Browser.
+ restartPrivacyBrowser();
+ break;
+
case "display_additional_app_bar_icons":
// Update the icon.
if (sharedPreferences.getBoolean(context.getString(R.string.display_additional_app_bar_icons_key), false)) {
}
};
}
+
+ private void restartPrivacyBrowser() {
+ // Create an intent to restart Privacy Browser.
+ Intent restartIntent = requireActivity().getParentActivityIntent();
+
+ // Assert that the intent is not null to remove the lint error below.
+ assert restartIntent != null;
+
+ // `Intent.FLAG_ACTIVITY_CLEAR_TASK` removes all activities from the stack. It requires `Intent.FLAG_ACTIVITY_NEW_TASK`.
+ restartIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
+
+ // Create a handler to restart the activity.
+ Handler restartHandler = new Handler(Looper.getMainLooper());
+
+ // Create a runnable to restart the activity.
+ Runnable restartRunnable = () -> {
+ // Restart the activity.
+ startActivity(restartIntent);
+
+ // Kill this instance of Privacy Browser. Otherwise, the app exhibits sporadic behavior after the restart.
+ System.exit(0);
+ };
+
+ // Restart the activity after 200 milliseconds, so that the app has enough time to save the change to the preference.
+ restartHandler.postDelayed(restartRunnable, 200);
+ }
}
\ No newline at end of file
private static final String SWIPE_TO_REFRESH = "swipe_to_refresh";
private static final String DOWNLOAD_WITH_EXTERNAL_APP = "download_with_external_app";
private static final String SCROLL_APP_BAR = "scroll_app_bar";
+ private static final String BOTTOM_APP_BAR = "bottom_app_bar";
private static final String DISPLAY_ADDITIONAL_APP_BAR_ICONS = "display_additional_app_bar_icons";
private static final String APP_THEME = "app_theme";
private static final String WEBVIEW_THEME = "webview_theme";
// Get the current clear logcat value.
boolean clearLogcat = sharedPreferences.getBoolean(CLEAR_LOGCAT, true);
- // Populate the preference table with the current clear logcat value.
+ // Populate the preferences table with the current clear logcat value.
if (clearLogcat) {
importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + CLEAR_LOGCAT + " = " + 1);
} else {
importDatabase.execSQL("UPDATE " + DomainsDatabaseHelper.DOMAINS_TABLE + " SET " + DomainsDatabaseHelper.COOKIES + " = enablefirstpartycookies");
importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + COOKIES + " = first_party_cookies");
- // Create the download with external app column.
+ // Create the new columns.
importDatabase.execSQL("ALTER TABLE " + PREFERENCES_TABLE + " ADD COLUMN " + DOWNLOAD_WITH_EXTERNAL_APP + " BOOLEAN");
+ importDatabase.execSQL("ALTER TABLE " + PREFERENCES_TABLE + " ADD COLUMN " + BOTTOM_APP_BAR + " BOOLEAN");
+
+ // Get the current values for the new columns.
+ boolean downloadWithExternalApp = sharedPreferences.getBoolean(DOWNLOAD_WITH_EXTERNAL_APP, false);
+ boolean bottomAppBar = sharedPreferences.getBoolean(BOTTOM_APP_BAR, false);
+
+ // Populate the preferences table with the current download with external app value.
+ if (downloadWithExternalApp) {
+ importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + DOWNLOAD_WITH_EXTERNAL_APP + " = " + 1);
+ } else {
+ importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + DOWNLOAD_WITH_EXTERNAL_APP + " = " + 0);
+ }
+
+ // Populate the preferences table with the current bottom app bar value.
+ if (bottomAppBar) {
+ importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + BOTTOM_APP_BAR + " = " + 1);
+ } else {
+ importDatabase.execSQL("UPDATE " + PREFERENCES_TABLE + " SET " + BOTTOM_APP_BAR + " = " + 0);
+ }
}
}
.putBoolean(SWIPE_TO_REFRESH, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(SWIPE_TO_REFRESH)) == 1)
.putBoolean(DOWNLOAD_WITH_EXTERNAL_APP, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(DOWNLOAD_WITH_EXTERNAL_APP)) == 1)
.putBoolean(SCROLL_APP_BAR, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(SCROLL_APP_BAR)) == 1)
+ .putBoolean(BOTTOM_APP_BAR, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(BOTTOM_APP_BAR)) == 1)
.putBoolean(DISPLAY_ADDITIONAL_APP_BAR_ICONS, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(DISPLAY_ADDITIONAL_APP_BAR_ICONS)) == 1)
.putString(APP_THEME, importPreferencesCursor.getString(importPreferencesCursor.getColumnIndex(APP_THEME)))
.putString(WEBVIEW_THEME, importPreferencesCursor.getString(importPreferencesCursor.getColumnIndex(WEBVIEW_THEME)))
SWIPE_TO_REFRESH + " BOOLEAN, " +
DOWNLOAD_WITH_EXTERNAL_APP + " BOOLEAN, " +
SCROLL_APP_BAR + " BOOLEAN, " +
+ BOTTOM_APP_BAR + " BOOLEAN, " +
DISPLAY_ADDITIONAL_APP_BAR_ICONS + " BOOLEAN, " +
APP_THEME + " TEXT, " +
WEBVIEW_THEME + " TEXT, " +
preferencesContentValues.put(SWIPE_TO_REFRESH, sharedPreferences.getBoolean(SWIPE_TO_REFRESH, true));
preferencesContentValues.put(DOWNLOAD_WITH_EXTERNAL_APP, sharedPreferences.getBoolean(DOWNLOAD_WITH_EXTERNAL_APP, false));
preferencesContentValues.put(SCROLL_APP_BAR, sharedPreferences.getBoolean(SCROLL_APP_BAR, true));
+ preferencesContentValues.put(BOTTOM_APP_BAR, sharedPreferences.getBoolean(BOTTOM_APP_BAR, false));
preferencesContentValues.put(DISPLAY_ADDITIONAL_APP_BAR_ICONS, sharedPreferences.getBoolean(DISPLAY_ADDITIONAL_APP_BAR_ICONS, false));
preferencesContentValues.put(APP_THEME, sharedPreferences.getString(APP_THEME, context.getString(R.string.app_theme_default_value)));
preferencesContentValues.put(WEBVIEW_THEME, sharedPreferences.getString(WEBVIEW_THEME, context.getString(R.string.webview_theme_default_value)));
<!-- This file comes from the Android Material icon set, where it is called `payment`. It is released under the Apache License 2.0. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
android:height="24dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0" >
+ android:width="24dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0" >
<!-- A hard coded color must be used until API >= 21. Then `@color` or `?attr/colorControlNormal` may be used. -->
<path
android:fillColor="#FF757575"
android:pathData="M20,4L4,4c-1.11,0 -1.99,0.89 -1.99,2L2,18c0,1.11 0.89,2 2,2h16c1.11,0 2,-0.89 2,-2L22,6c0,-1.11 -0.89,-2 -2,-2zM20,18L4,18v-6h16v6zM20,8L4,8L4,6h16v2z" />
-</vector>
+</vector>
\ No newline at end of file
<!-- This file comes from the Android Material icon set, where it is called `payment`. It is released under the Apache License 2.0. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
android:height="24dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0" >
+ android:width="24dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0" >
<!-- A hard coded color must be used until API >= 21. Then `@color` or `?attr/colorControlNormal` may be used instead. -->
<path
android:fillColor="#FF9E9E9E"
android:pathData="M20,4L4,4c-1.11,0 -1.99,0.89 -1.99,2L2,18c0,1.11 0.89,2 2,2h16c1.11,0 2,-0.89 2,-2L22,6c0,-1.11 -0.89,-2 -2,-2zM20,18L4,18v-6h16v6zM20,8L4,8L4,6h16v2z" />
-</vector>
+</vector>
\ No newline at end of file
<path
android:fillColor="#FF1565C0"
android:pathData="M20,4L4,4c-1.11,0 -1.99,0.89 -1.99,2L2,18c0,1.11 0.89,2 2,2h16c1.11,0 2,-0.89 2,-2L22,6c0,-1.11 -0.89,-2 -2,-2zM20,18L4,18v-6h16v6zM20,8L4,8L4,6h16v2z" />
-</vector>
+</vector>
\ No newline at end of file
<path
android:fillColor="#FF8AB4F8"
android:pathData="M20,4L4,4c-1.11,0 -1.99,0.89 -1.99,2L2,18c0,1.11 0.89,2 2,2h16c1.11,0 2,-0.89 2,-2L22,6c0,-1.11 -0.89,-2 -2,-2zM20,18L4,18v-6h16v6zM20,8L4,8L4,6h16v2z" />
-</vector>
+</vector>
\ No newline at end of file
--- /dev/null
+<!-- This file comes from the Android Material icon set, where it is called `call_to_action`. 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="#FF757575"
+ android:pathData="M21,3L3,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2L23,5c0,-1.1 -0.9,-2 -2,-2zM21,19L3,19v-3h18v3z"/>
+</vector>
\ No newline at end of file
--- /dev/null
+<!-- This file comes from the Android Material icon set, where it is called `call_to_action`. 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="#FF9E9E9E"
+ android:pathData="M21,3L3,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2L23,5c0,-1.1 -0.9,-2 -2,-2zM21,19L3,19v-3h18v3z"/>
+</vector>
\ No newline at end of file
--- /dev/null
+<!-- This file comes from the Android Material icon set, where it is called `call_to_action`. 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="M21,3L3,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2L23,5c0,-1.1 -0.9,-2 -2,-2zM21,19L3,19v-3h18v3z"/>
+</vector>
\ No newline at end of file
--- /dev/null
+<!-- This file comes from the Android Material icon set, where it is called `call_to_action`. 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="M21,3L3,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2L23,5c0,-1.1 -0.9,-2 -2,-2zM21,19L3,19v-3h18v3z"/>
+</vector>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- Copyright © 2017,2019-2020 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/>. -->
-
-<!-- `android:layout_width="400dp"` keeps the bookmarks drawer from filling the whole screen on a tablet. -->
-<FrameLayout
- android:id="@+id/bookmarks_framelayout"
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_height="match_parent"
- android:layout_width="400dp"
- android:layout_gravity="end" >
-
- <LinearLayout
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:orientation="vertical"
- android:background="?android:attr/colorBackground" >
-
- <!-- A compound drawable doesn't work well because only the image view should execute the `onClick()`. -->
- <LinearLayout
- android:id="@+id/bookmarks_header_linearlayout"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:orientation="horizontal"
- tools:ignore="UseCompoundDrawables" >
-
- <ImageView
- android:layout_height="match_parent"
- android:layout_width="wrap_content"
- android:layout_gravity="center_vertical"
- android:paddingStart="15dp"
- android:paddingEnd="15dp"
- android:src="@drawable/back"
- android:background="?attr/selectableItemBackground"
- android:onClick="bookmarksBack"
- android:contentDescription="@string/back"
- app:tint="?android:attr/textColorPrimary" />
-
- <TextView
- android:id="@+id/bookmarks_title_textview"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:textStyle="bold"
- android:textSize="20sp"
- android:textColor="?android:attr/textColorPrimary"
- android:layout_margin="10dp" />
- </LinearLayout>
-
- <ListView
- android:id="@+id/bookmarks_drawer_listview"
- android:layout_height="0dp"
- android:layout_width="match_parent"
- android:layout_weight="1"
- android:divider="@color/transparent"
- android:dividerHeight="0dp" />
- </LinearLayout>
-
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:id="@+id/launch_bookmarks_activity_fab"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="bottom|end"
- android:layout_marginEnd="16dp"
- android:layout_marginBottom="155dp"
- 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_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="bottom|end"
- android:layout_marginEnd="16dp"
- android:layout_marginBottom="85dp"
- android:src="@drawable/create_folder"
- android:tint="?attr/fabIconTintColor"
- android:contentDescription="@string/create_folder" />
-
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:id="@+id/create_bookmark_fab"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="bottom|end"
- android:layout_margin="16dp"
- android:src="@drawable/create_bookmark"
- android:tint="?attr/fabIconTintColor"
- android:contentDescription="@string/create_bookmark" />
-</FrameLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2017,2019-2021 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/>. -->
+
+<!-- `android:layout_width="400dp"` keeps the bookmarks drawer from filling the whole screen on a tablet. -->
+<FrameLayout
+ android:id="@+id/bookmarks_framelayout"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_height="match_parent"
+ android:layout_width="400dp"
+ android:layout_gravity="end" >
+
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:background="?android:attr/colorBackground" >
+
+ <ListView
+ android:id="@+id/bookmarks_drawer_listview"
+ android:layout_height="0dp"
+ android:layout_width="match_parent"
+ android:layout_weight="1"
+ android:divider="@color/transparent"
+ android:dividerHeight="0dp" />
+
+ <!-- A compound drawable doesn't work well because only the image view should execute the `onClick()`. -->
+ <LinearLayout
+ android:id="@+id/bookmarks_header_linearlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal"
+ tools:ignore="UseCompoundDrawables" >
+
+ <ImageView
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:paddingStart="15dp"
+ android:paddingEnd="15dp"
+ android:src="@drawable/back"
+ android:background="?attr/selectableItemBackground"
+ android:onClick="bookmarksBack"
+ android:contentDescription="@string/back"
+ app:tint="?android:attr/textColorPrimary" />
+
+ <TextView
+ android:id="@+id/bookmarks_title_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textStyle="bold"
+ android:textSize="20sp"
+ android:textColor="?android:attr/textColorPrimary"
+ android:layout_margin="10dp" />
+ </LinearLayout>
+ </LinearLayout>
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/launch_bookmarks_activity_fab"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="155dp"
+ 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_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="85dp"
+ android:src="@drawable/create_folder"
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/create_folder" />
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/create_bookmark_fab"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_margin="16dp"
+ android:src="@drawable/create_bookmark"
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/create_bookmark" />
+</FrameLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2017,2019-2020 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/>. -->
+
+<!-- `android:layout_width="400dp"` keeps the bookmarks drawer from filling the whole screen on a tablet. -->
+<FrameLayout
+ android:id="@+id/bookmarks_framelayout"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_height="match_parent"
+ android:layout_width="400dp"
+ android:layout_gravity="end" >
+
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:background="?android:attr/colorBackground" >
+
+ <!-- A compound drawable doesn't work well because only the image view should execute the `onClick()`. -->
+ <LinearLayout
+ android:id="@+id/bookmarks_header_linearlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal"
+ tools:ignore="UseCompoundDrawables" >
+
+ <ImageView
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:paddingStart="15dp"
+ android:paddingEnd="15dp"
+ android:src="@drawable/back"
+ android:background="?attr/selectableItemBackground"
+ android:onClick="bookmarksBack"
+ android:contentDescription="@string/back"
+ app:tint="?android:attr/textColorPrimary" />
+
+ <TextView
+ android:id="@+id/bookmarks_title_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textStyle="bold"
+ android:textSize="20sp"
+ android:textColor="?android:attr/textColorPrimary"
+ android:layout_margin="10dp" />
+ </LinearLayout>
+
+ <ListView
+ android:id="@+id/bookmarks_drawer_listview"
+ android:layout_height="0dp"
+ android:layout_width="match_parent"
+ android:layout_weight="1"
+ android:divider="@color/transparent"
+ android:dividerHeight="0dp" />
+ </LinearLayout>
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/launch_bookmarks_activity_fab"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="155dp"
+ 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_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="85dp"
+ android:src="@drawable/create_folder"
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/create_folder" />
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/create_bookmark_fab"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_margin="16dp"
+ android:src="@drawable/create_bookmark"
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/create_bookmark" />
+</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright © 2017 Soren Stoutner <soren@stoutner.com>.
+ Copyright © 2017,2021 Soren Stoutner <soren@stoutner.com>.
This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
You should have received a copy of the GNU General Public License
along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
-<!-- `android:baselineAligned="False"` reduces unneeded computational overhead with `RecyclerViews`. -->
+<!-- `android:baselineAligned="False"` reduces unneeded computational overhead with the linear layout. -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".activities.DomainsActivity"
+ android:layout_height="0dp"
android:layout_width="match_parent"
- android:layout_height="match_parent"
+ android:layout_weight="1"
android:orientation="horizontal"
android:baselineAligned="false"
android:divider="?android:attr/dividerHorizontal"
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- Copyright © 2016-2017,2019-2020 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/>. -->
-
-<androidx.coordinatorlayout.widget.CoordinatorLayout
- android:id="@+id/about_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" >
-
- <!-- The linear layout with `orientation="vertical"` moves the view pager below the app bar layout. -->
- <LinearLayout
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:orientation="vertical" >
-
- <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
- <com.google.android.material.appbar.AppBarLayout
- android:id="@+id/about_appbarlayout"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:background="?android:attr/colorBackground"
- android:theme="@style/PrivacyBrowserAppBar" >
-
- <androidx.appcompat.widget.Toolbar
- android:id="@+id/about_toolbar"
- android:layout_height="wrap_content"
- android:layout_width="match_parent" />
-
- <com.google.android.material.tabs.TabLayout
- android:id="@+id/about_tablayout"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- app:tabMode="scrollable" />
- </com.google.android.material.appbar.AppBarLayout>
-
- <!-- `android:layout_weight="1"` makes the view pager fill the rest of the screen. -->
- <androidx.viewpager.widget.ViewPager
- android:id="@+id/about_viewpager"
- android:layout_height="0dp"
- android:layout_width="match_parent"
- android:layout_weight="1" />
- </LinearLayout>
-</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2016-2017,2019-2021 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/>. -->
+
+<androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:id="@+id/about_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" >
+
+ <!-- The linear layout with `orientation="vertical"` keeps the view pager above the app bar layout.
+ `app:layout_dodgeInsetEdges="bottom"` as a child of a coordinator layout moves the view above snackbars. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ app:layout_dodgeInsetEdges="bottom" >
+
+ <!-- `android:layout_weight="1"` makes the view pager fill the rest of the screen. -->
+ <androidx.viewpager.widget.ViewPager
+ android:id="@+id/about_viewpager"
+ android:layout_height="0dp"
+ android:layout_width="match_parent"
+ android:layout_weight="1" />
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/about_appbarlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?android:attr/colorBackground"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <com.google.android.material.tabs.TabLayout
+ android:id="@+id/about_tablayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ app:tabMode="scrollable" />
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/about_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+ </com.google.android.material.appbar.AppBarLayout>
+ </LinearLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2016-2017,2019-2020 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/>. -->
+
+<androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:id="@+id/about_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" >
+
+ <!-- The linear layout with `orientation="vertical"` moves the view pager below the app bar layout. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical" >
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/about_appbarlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?android:attr/colorBackground"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/about_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+
+ <com.google.android.material.tabs.TabLayout
+ android:id="@+id/about_tablayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ app:tabMode="scrollable" />
+ </com.google.android.material.appbar.AppBarLayout>
+
+ <!-- `android:layout_weight="1"` makes the view pager fill the rest of the screen. -->
+ <androidx.viewpager.widget.ViewPager
+ android:id="@+id/about_viewpager"
+ android:layout_height="0dp"
+ android:layout_width="match_parent"
+ android:layout_weight="1" />
+ </LinearLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- Copyright © 2016-2017,2019 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 text view has an id of `adView` so that the ad commands (which do nothing in the standard flavor) don't produce errors. -->
-<TextView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/adview"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:visibility="gone" />
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2016-2017,2019 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 text view has an id of `adView` so that the ad commands (which do nothing in the standard flavor) don't produce errors. -->
+<TextView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/adview"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:visibility="gone" />
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2016-2017,2019 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 text view has an id of `adView` so that the ad commands (which do nothing in the standard flavor) don't produce errors. -->
+<TextView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/adview"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:visibility="gone" />
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- Copyright © 2016-2020 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/>. -->
-
-<androidx.coordinatorlayout.widget.CoordinatorLayout
- android:id="@+id/bookmarks_coordinatorlayout"
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_height="match_parent"
- android:layout_width="match_parent" >
-
- <!-- The linear layout with `orientation="vertical"` moves the content below the app bar layout. -->
- <LinearLayout
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:orientation="vertical" >
-
- <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
- <com.google.android.material.appbar.AppBarLayout
- android:id="@+id/bookmarks_appbarlayout"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:background="?android:attr/colorBackground"
- android:theme="@style/PrivacyBrowserAppBar" >
-
- <androidx.appcompat.widget.Toolbar
- android:id="@+id/bookmarks_toolbar"
- android:layout_height="wrap_content"
- android:layout_width="match_parent" />
- </com.google.android.material.appbar.AppBarLayout>
-
- <!-- `android:choiceMode="multipleChoiceModal"` allows the contextual action menu to select more than one item at a time.
- `android:dividerHeight` must be at least `1dp` or the list view is inconsistent in calculating how many bookmarks are displayed. -->
- <ListView
- android:id="@+id/bookmarks_listview"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:choiceMode="multipleChoiceModal"
- android:divider="@color/transparent"
- android:dividerHeight="1dp" />
- </LinearLayout>
-
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:id="@+id/create_bookmark_folder_fab"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="bottom|end"
- android:layout_marginEnd="16dp"
- android:layout_marginBottom="85dp"
- android:src="@drawable/create_folder"
- android:tint="?attr/fabIconTintColor" />
-
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:id="@+id/create_bookmark_fab"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="bottom|end"
- android:layout_margin="16dp"
- android:src="@drawable/create_bookmark"
- android:tint="?attr/fabIconTintColor" />
-</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2016-2021 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/>. -->
+
+<androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:id="@+id/bookmarks_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" >
+
+ <!-- The linear layout with `orientation="vertical"` keeps the content above the app bar layout. `app:layout_dodgeInsetEdges="bottom"` as a child of a coordinator layout moves the view above snackbars. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ app:layout_dodgeInsetEdges="bottom" >
+
+ <!-- `android:choiceMode="multipleChoiceModal"` allows the contextual action menu to select more than one item at a time.
+ `android:dividerHeight` must be at least `1dp` or the list view is inconsistent in calculating how many bookmarks are displayed. -->
+ <ListView
+ android:id="@+id/bookmarks_listview"
+ android:layout_height="0dp"
+ android:layout_width="match_parent"
+ android:layout_weight="1"
+ android:choiceMode="multipleChoiceModal"
+ android:divider="@color/transparent"
+ android:dividerHeight="1dp" />
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/bookmarks_appbarlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?android:attr/colorBackground"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/bookmarks_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+ </com.google.android.material.appbar.AppBarLayout>
+ </LinearLayout>
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/create_bookmark_folder_fab"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="140dp"
+ android:src="@drawable/create_folder"
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/create_folder" />
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/create_bookmark_fab"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="70dp"
+ android:src="@drawable/create_bookmark"
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/create_bookmark" />
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2016-2021 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/>. -->
+
+<androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:id="@+id/bookmarks_coordinatorlayout"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent" >
+
+ <!-- The linear layout with `orientation="vertical"` moves the content below the app bar layout. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical" >
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/bookmarks_appbarlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?android:attr/colorBackground"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/bookmarks_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+ </com.google.android.material.appbar.AppBarLayout>
+
+ <!-- `android:choiceMode="multipleChoiceModal"` allows the contextual action menu to select more than one item at a time.
+ `android:dividerHeight` must be at least `1dp` or the list view is inconsistent in calculating how many bookmarks are displayed. -->
+ <ListView
+ android:id="@+id/bookmarks_listview"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:choiceMode="multipleChoiceModal"
+ android:divider="@color/transparent"
+ android:dividerHeight="1dp" />
+ </LinearLayout>
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/create_bookmark_folder_fab"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="85dp"
+ android:src="@drawable/create_folder"
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/create_folder" />
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/create_bookmark_fab"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_margin="16dp"
+ android:src="@drawable/create_bookmark"
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/create_bookmark" />
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- Copyright © 2016-2020 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/>. -->
-
-<androidx.coordinatorlayout.widget.CoordinatorLayout
- android:id="@+id/bookmarks_databaseview_coordinatorlayout"
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_height="match_parent"
- android:layout_width="match_parent" >
-
- <!-- The linear layout with `orientation="vertical"` moves the list view below the app bar layout. -->
- <LinearLayout
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:orientation="vertical" >
-
- <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
- <com.google.android.material.appbar.AppBarLayout
- android:id="@+id/bookmarks_databaseview_appbarlayout"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:background="?android:attr/colorBackground"
- android:theme="@style/PrivacyBrowserAppBar" >
-
- <androidx.appcompat.widget.Toolbar
- android:id="@+id/bookmarks_databaseview_toolbar"
- android:layout_height="wrap_content"
- android:layout_width="match_parent" />
- </com.google.android.material.appbar.AppBarLayout>
-
- <!-- `android:choiceMode="multipleChoiceModal"` allows the contextual action menu to select more than one item at a time. -->
- <ListView
- android:id="@+id/bookmarks_databaseview_listview"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:choiceMode="multipleChoiceModal" />
- </LinearLayout>
-</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2016-2021 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/>. -->
+
+<androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:id="@+id/bookmarks_databaseview_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" >
+
+ <!-- The linear layout with `orientation="vertical"` keeps the list view above the app bar layout.
+ `app:layout_dodgeInsetEdges="bottom"` as a child of a coordinator layout moves the view above snackbars.-->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ app:layout_dodgeInsetEdges="bottom" >
+
+ <!-- `android:choiceMode="multipleChoiceModal"` allows the contextual action menu to select more than one item at a time. -->
+ <ListView
+ android:id="@+id/bookmarks_databaseview_listview"
+ android:layout_height="0dp"
+ android:layout_width="match_parent"
+ android:layout_weight="1"
+ android:choiceMode="multipleChoiceModal" />
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/bookmarks_databaseview_appbarlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?android:attr/colorBackground"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/bookmarks_databaseview_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+ </com.google.android.material.appbar.AppBarLayout>
+ </LinearLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2016-2020 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/>. -->
+
+<androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:id="@+id/bookmarks_databaseview_coordinatorlayout"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent" >
+
+ <!-- The linear layout with `orientation="vertical"` moves the list view below the app bar layout. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical" >
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/bookmarks_databaseview_appbarlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?android:attr/colorBackground"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/bookmarks_databaseview_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+ </com.google.android.material.appbar.AppBarLayout>
+
+ <!-- `android:choiceMode="multipleChoiceModal"` allows the contextual action menu to select more than one item at a time. -->
+ <ListView
+ android:id="@+id/bookmarks_databaseview_listview"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:choiceMode="multipleChoiceModal" />
+ </LinearLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- Copyright © 2017-2020 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/>. -->
-
-<FrameLayout
- android:id="@+id/bookmarks_framelayout"
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:layout_gravity="end">
-
- <LinearLayout
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:orientation="vertical"
- android:background="?android:attr/colorBackground" >
-
- <!-- A compound drawable doesn't work well because only the image view should execute the `onClick()`. -->
- <LinearLayout
- android:id="@+id/bookmarks_header_linearlayout"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:orientation="horizontal"
- tools:ignore="UseCompoundDrawables" >
-
- <ImageView
- android:layout_height="match_parent"
- android:layout_width="wrap_content"
- android:layout_gravity="center_vertical"
- android:paddingStart="15dp"
- android:paddingEnd="15dp"
- android:src="@drawable/back"
- android:background="?attr/selectableItemBackground"
- android:onClick="bookmarksBack"
- android:contentDescription="@string/back"
- app:tint="?android:attr/textColorPrimary" />
-
- <TextView
- android:id="@+id/bookmarks_title_textview"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:textStyle="bold"
- android:textSize="20sp"
- android:textColor="?android:attr/textColorPrimary"
- android:layout_margin="10dp" />
- </LinearLayout>
-
- <ListView
- android:id="@+id/bookmarks_drawer_listview"
- android:layout_height="0dp"
- android:layout_width="match_parent"
- android:layout_weight="1"
- android:divider="@color/transparent"
- android:dividerHeight="0dp" />
- </LinearLayout>
-
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:id="@+id/launch_bookmarks_activity_fab"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="bottom|end"
- android:layout_marginEnd="16dp"
- android:layout_marginBottom="155dp"
- 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_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="bottom|end"
- android:layout_marginEnd="16dp"
- android:layout_marginBottom="85dp"
- android:src="@drawable/create_folder"
- android:tint="?attr/fabIconTintColor"
- android:contentDescription="@string/create_folder" />
-
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:id="@+id/create_bookmark_fab"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="bottom|end"
- android:layout_margin="16dp"
- android:src="@drawable/create_bookmark"
- android:tint="?attr/fabIconTintColor"
- android:contentDescription="@string/create_bookmark" />
-</FrameLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2017-2021 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/>. -->
+
+<FrameLayout
+ android:id="@+id/bookmarks_framelayout"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:layout_gravity="end">
+
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:background="?android:attr/colorBackground" >
+
+ <ListView
+ android:id="@+id/bookmarks_drawer_listview"
+ android:layout_height="0dp"
+ android:layout_width="match_parent"
+ android:layout_weight="1"
+ android:divider="@color/transparent"
+ android:dividerHeight="0dp" />
+
+ <!-- A compound drawable doesn't work well because only the image view should execute the `onClick()`. -->
+ <LinearLayout
+ android:id="@+id/bookmarks_header_linearlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal"
+ tools:ignore="UseCompoundDrawables" >
+
+ <ImageView
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:paddingStart="15dp"
+ android:paddingEnd="15dp"
+ android:src="@drawable/back"
+ android:background="?attr/selectableItemBackground"
+ android:onClick="bookmarksBack"
+ android:contentDescription="@string/back"
+ app:tint="?android:attr/textColorPrimary" />
+
+ <TextView
+ android:id="@+id/bookmarks_title_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textStyle="bold"
+ android:textSize="20sp"
+ android:textColor="?android:attr/textColorPrimary"
+ android:layout_margin="10dp" />
+ </LinearLayout>
+ </LinearLayout>
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/launch_bookmarks_activity_fab"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="200dp"
+ 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_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="130dp"
+ android:src="@drawable/create_folder"
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/create_folder" />
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/create_bookmark_fab"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="60dp"
+ android:src="@drawable/create_bookmark"
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/create_bookmark" />
+</FrameLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2017-2020 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/>. -->
+
+<FrameLayout
+ android:id="@+id/bookmarks_framelayout"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:layout_gravity="end">
+
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:background="?android:attr/colorBackground" >
+
+ <!-- A compound drawable doesn't work well because only the image view should execute the `onClick()`. -->
+ <LinearLayout
+ android:id="@+id/bookmarks_header_linearlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal"
+ tools:ignore="UseCompoundDrawables" >
+
+ <ImageView
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:paddingStart="15dp"
+ android:paddingEnd="15dp"
+ android:src="@drawable/back"
+ android:background="?attr/selectableItemBackground"
+ android:onClick="bookmarksBack"
+ android:contentDescription="@string/back"
+ app:tint="?android:attr/textColorPrimary" />
+
+ <TextView
+ android:id="@+id/bookmarks_title_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textStyle="bold"
+ android:textSize="20sp"
+ android:textColor="?android:attr/textColorPrimary"
+ android:layout_margin="10dp" />
+ </LinearLayout>
+
+ <ListView
+ android:id="@+id/bookmarks_drawer_listview"
+ android:layout_height="0dp"
+ android:layout_width="match_parent"
+ android:layout_weight="1"
+ android:divider="@color/transparent"
+ android:dividerHeight="0dp" />
+ </LinearLayout>
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/launch_bookmarks_activity_fab"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="155dp"
+ 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_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="85dp"
+ android:src="@drawable/create_folder"
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/create_folder" />
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/create_bookmark_fab"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_margin="16dp"
+ android:src="@drawable/create_bookmark"
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/create_bookmark" />
+</FrameLayout>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- Copyright © 2017,2019-2020 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/>. -->
-
-<androidx.coordinatorlayout.widget.CoordinatorLayout
- android:id="@+id/domains_coordinatorlayout"
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:fitsSystemWindows="true" >
-
- <!-- The linear layout with `orientation="vertical"` moves the content below the app bar layout. -->
- <LinearLayout
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:orientation="vertical" >
-
- <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
- <com.google.android.material.appbar.AppBarLayout
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:background="?android:attr/colorBackground"
- android:theme="@style/PrivacyBrowserAppBar" >
-
- <androidx.appcompat.widget.Toolbar
- android:id="@+id/domains_toolbar"
- android:layout_height="wrap_content"
- android:layout_width="match_parent" />
- </com.google.android.material.appbar.AppBarLayout>
-
- <include layout="@layout/domains_fragments" />
- </LinearLayout>
-
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:id="@+id/add_domain_fab"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="bottom|end"
- android:layout_margin="16dp"
- android:src="@drawable/add"
- android:tint="?attr/fabIconTintColor" />
-</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2017,2019-2021 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/>. -->
+
+<androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:id="@+id/domains_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" >
+
+ <!-- The linear layout with `orientation="vertical"` keeps the content above the app bar layout. `app:layout_dodgeInsetEdges="bottom"` as a child of a coordinator layout moves the view above snackbars. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ app:layout_dodgeInsetEdges="bottom" >
+
+ <include layout="@layout/domains_fragments" />
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?android:attr/colorBackground"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/domains_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+ </com.google.android.material.appbar.AppBarLayout>
+ </LinearLayout>
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/add_domain_fab"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="70dp"
+ android:src="@drawable/add"
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/add_domain" />
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2017,2019-2020 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/>. -->
+
+<androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:id="@+id/domains_coordinatorlayout"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:fitsSystemWindows="true" >
+
+ <!-- The linear layout with `orientation="vertical"` moves the content below the app bar layout. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical" >
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?android:attr/colorBackground"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/domains_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+ </com.google.android.material.appbar.AppBarLayout>
+
+ <include layout="@layout/domains_fragments" />
+ </LinearLayout>
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/add_domain_fab"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_margin="16dp"
+ android:src="@drawable/add"
+ android:tint="?attr/fabIconTintColor"
+ android:contentDescription="@string/add_domain" />
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright © 2017 Soren Stoutner <soren@stoutner.com>.
+ Copyright © 2017,2021 Soren Stoutner <soren@stoutner.com>.
This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
<RelativeLayout
android:id="@+id/domains_listview_fragment_container"
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_height="match_parent"
- android:layout_width="match_parent" />
\ No newline at end of file
+ android:layout_height="0dp"
+ android:layout_width="match_parent"
+ android:layout_weight="1" />
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- Copyright © 2016-2017,2019-2020 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/>. -->
-
-<androidx.coordinatorlayout.widget.CoordinatorLayout
- android:id="@+id/guide_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" >
-
- <!-- The linear layout with `orientation="vertical"` moves the view pager below the app bar layout. -->
- <LinearLayout
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:orientation="vertical" >
-
- <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
- <com.google.android.material.appbar.AppBarLayout
- android:id="@+id/guide_appbarlayout"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:background="?android:attr/colorBackground"
- android:theme="@style/PrivacyBrowserAppBar" >
-
- <androidx.appcompat.widget.Toolbar
- android:id="@+id/guide_toolbar"
- android:layout_height="wrap_content"
- android:layout_width="match_parent" />
-
- <com.google.android.material.tabs.TabLayout
- android:id="@+id/guide_tablayout"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- app:tabMode="scrollable" />
- </com.google.android.material.appbar.AppBarLayout>
-
- <!-- `android:layout_weight="1"` makes `about_viewpager` fill the rest of the screen. -->
- <androidx.viewpager.widget.ViewPager
- android:id="@+id/guide_viewpager"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1" />
- </LinearLayout>
-</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2016-2017,2019-2021 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/>. -->
+
+<androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:id="@+id/guide_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" >
+
+ <!-- The linear layout with `orientation="vertical"` keeps the view pager above the app bar layout.
+ `app:layout_dodgeInsetEdges="bottom"` as a child of a coordinator layout moves the view above snackbars. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ app:layout_dodgeInsetEdges="bottom" >
+
+ <!-- `android:layout_weight="1"` makes the view pager fill the rest of the screen. -->
+ <androidx.viewpager.widget.ViewPager
+ android:id="@+id/guide_viewpager"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/guide_appbarlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?android:attr/colorBackground"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <com.google.android.material.tabs.TabLayout
+ android:id="@+id/guide_tablayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ app:tabMode="scrollable" />
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/guide_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+ </com.google.android.material.appbar.AppBarLayout>
+ </LinearLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2016-2017,2019-2021 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/>. -->
+
+<androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:id="@+id/guide_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" >
+
+ <!-- The linear layout with `orientation="vertical"` moves the view pager below the app bar layout. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical" >
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/guide_appbarlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?android:attr/colorBackground"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <com.google.android.material.tabs.TabLayout
+ android:id="@+id/guide_tablayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ app:tabMode="scrollable" />
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/guide_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+ </com.google.android.material.appbar.AppBarLayout>
+
+ <!-- `android:layout_weight="1"` makes the view pager fill the rest of the screen. -->
+ <androidx.viewpager.widget.ViewPager
+ android:id="@+id/guide_viewpager"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
+ </LinearLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- Copyright © 2018-2021 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/>. -->
-
-<androidx.coordinatorlayout.widget.CoordinatorLayout
- android:id="@+id/import_export_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" >
-
- <!-- the linear layout with `orientation="vertical"` moves the content below the app bar layout. -->
- <LinearLayout
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:orientation="vertical" >
-
- <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
- <com.google.android.material.appbar.AppBarLayout
- android:id="@+id/import_export_appbarlayout"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:background="?android:attr/colorBackground"
- android:theme="@style/PrivacyBrowserAppBar" >
-
- <androidx.appcompat.widget.Toolbar
- android:id="@+id/import_export_toolbar"
- android:layout_height="wrap_content"
- android:layout_width="match_parent" />
- </com.google.android.material.appbar.AppBarLayout>
-
- <ScrollView
- android:layout_height="match_parent"
- android:layout_width="match_parent" >
-
- <!-- Align the cards vertically. -->
- <LinearLayout
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:orientation="vertical" >
-
- <!-- The encryption card. -->
- <androidx.cardview.widget.CardView
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:layout_marginTop="10dp"
- android:layout_marginBottom="5dp"
- android:layout_marginStart="10dp"
- android:layout_marginEnd="10dp" >
-
- <!-- Align the contents of the card vertically. -->
- <LinearLayout
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:orientation="vertical"
- android:layout_marginTop="10dp"
- android:layout_marginBottom="20dp"
- android:layout_marginStart="10dp"
- android:layout_marginEnd="10dp" >
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:layout_marginBottom="6dp"
- android:text="@string/encryption"
- android:textSize="25sp"
- android:textStyle="bold"
- android:textColor="?colorAccent" />
-
- <Spinner
- android:id="@+id/encryption_spinner"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal" />
-
- <!-- The encryption password. -->
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/encryption_password_textinputlayout"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- app:passwordToggleEnabled="true" >
-
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/encryption_password_edittext"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:hint="@string/password"
- android:inputType="textPassword"/>
- </com.google.android.material.textfield.TextInputLayout>
-
- <!-- KitKat password encryption message. -->
- <TextView
- android:id="@+id/kitkat_password_encryption_textview"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:layout_marginTop="10dp"
- android:text="@string/kitkat_password_encryption_message"
- android:textAlignment="center" />
-
- <!-- OpenKeychain required message. -->
- <TextView
- android:id="@+id/openkeychain_required_textview"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:layout_marginTop="10dp"
- android:text="@string/openkeychain_required"
- android:textAlignment="center" />
- </LinearLayout>
- </androidx.cardview.widget.CardView>
-
- <!-- The file location card. -->
- <androidx.cardview.widget.CardView
- android:id="@+id/file_location_cardview"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:layout_marginTop="5dp"
- android:layout_marginBottom="5dp"
- android:layout_marginStart="10dp"
- android:layout_marginEnd="10dp" >
-
- <!-- Align the contents of the card vertically. -->
- <LinearLayout
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:orientation="vertical"
- android:layout_marginTop="10dp"
- android:layout_marginBottom="20dp"
- android:layout_marginStart="10dp"
- android:layout_marginEnd="10dp" >
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:layout_marginBottom="6dp"
- android:text="@string/file_location"
- android:textSize="25sp"
- android:textStyle="bold"
- android:textColor="?colorAccent" />
-
- <RadioGroup
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:orientation="horizontal" >
-
- <RadioButton
- android:id="@+id/import_radiobutton"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:text="@string/import_button"
- android:layout_marginEnd="10dp"
- android:onClick="onClickRadioButton" />
-
- <RadioButton
- android:id="@+id/export_radiobutton"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:text="@string/export"
- android:onClick="onClickRadioButton" />
- </RadioGroup>
-
- <!-- Align the edit text and the select file button horizontally. -->
- <LinearLayout
- android:id="@+id/file_name_linearlayout"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:orientation="horizontal"
- android:layout_marginTop="10dp">
-
- <!-- The text input layout makes the hint float above the edit text. -->
- <com.google.android.material.textfield.TextInputLayout
- android:layout_height="wrap_content"
- android:layout_width="0dp"
- android:layout_weight="1" >
-
- <!-- `android:inputType="textUri" disables spell check and places an `/` on the main keyboard. -->
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/file_name_edittext"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:hint="@string/file_name"
- android:inputType="textMultiLine|textUri" />
- </com.google.android.material.textfield.TextInputLayout>
-
- <Button
- android:id="@+id/browse_button"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_vertical"
- android:text="@string/browse"
- android:onClick="browse" />
- </LinearLayout>
-
- <!-- OpenKeychain import instructions -->
- <TextView
- android:id="@+id/openkeychain_import_instructions_textview"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:layout_margin="5dp"
- android:text="@string/openkeychain_import_instructions"
- android:textAlignment="center" />
-
- <Button
- android:id="@+id/import_export_button"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:layout_marginTop="10dp"
- android:text="@string/import_button"
- android:textSize="18sp"
- android:onClick="importExport"
- app:backgroundTint="?attr/buttonBackgroundColorSelector"
- android:textColor="?attr/buttonTextColorSelector" />
- </LinearLayout>
- </androidx.cardview.widget.CardView>
- </LinearLayout>
- </ScrollView>
- </LinearLayout>
-</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2018-2021 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/>. -->
+
+<androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:id="@+id/import_export_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" >
+
+ <!-- the linear layout with `orientation="vertical"` keeps the content above the app bar layout. `app:layout_dodgeInsetEdges="bottom"` as a child of a coordinator layout moves the view above snackbars.-->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ app:layout_dodgeInsetEdges="bottom" >
+
+ <ScrollView
+ android:layout_height="0dp"
+ android:layout_width="match_parent"
+ android:layout_weight="1" >
+
+ <!-- Align the cards vertically. -->
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="vertical" >
+
+ <!-- The encryption card. -->
+ <androidx.cardview.widget.CardView
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_marginTop="10dp"
+ android:layout_marginBottom="5dp"
+ android:layout_marginStart="10dp"
+ android:layout_marginEnd="10dp" >
+
+ <!-- Align the contents of the card vertically. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:layout_marginTop="10dp"
+ android:layout_marginBottom="20dp"
+ android:layout_marginStart="10dp"
+ android:layout_marginEnd="10dp" >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginBottom="6dp"
+ android:text="@string/encryption"
+ android:textSize="25sp"
+ android:textStyle="bold"
+ android:textColor="?colorAccent" />
+
+ <Spinner
+ android:id="@+id/encryption_spinner"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal" />
+
+ <!-- The encryption password. -->
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/encryption_password_textinputlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ app:passwordToggleEnabled="true" >
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:id="@+id/encryption_password_edittext"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:hint="@string/password"
+ android:inputType="textPassword"/>
+ </com.google.android.material.textfield.TextInputLayout>
+
+ <!-- KitKat password encryption message. -->
+ <TextView
+ android:id="@+id/kitkat_password_encryption_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginTop="10dp"
+ android:text="@string/kitkat_password_encryption_message"
+ android:textAlignment="center" />
+
+ <!-- OpenKeychain required message. -->
+ <TextView
+ android:id="@+id/openkeychain_required_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginTop="10dp"
+ android:text="@string/openkeychain_required"
+ android:textAlignment="center" />
+ </LinearLayout>
+ </androidx.cardview.widget.CardView>
+
+ <!-- The file location card. -->
+ <androidx.cardview.widget.CardView
+ android:id="@+id/file_location_cardview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_marginTop="5dp"
+ android:layout_marginBottom="5dp"
+ android:layout_marginStart="10dp"
+ android:layout_marginEnd="10dp" >
+
+ <!-- Align the contents of the card vertically. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:layout_marginTop="10dp"
+ android:layout_marginBottom="20dp"
+ android:layout_marginStart="10dp"
+ android:layout_marginEnd="10dp" >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginBottom="6dp"
+ android:text="@string/file_location"
+ android:textSize="25sp"
+ android:textStyle="bold"
+ android:textColor="?colorAccent" />
+
+ <RadioGroup
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:orientation="horizontal" >
+
+ <RadioButton
+ android:id="@+id/import_radiobutton"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:text="@string/import_button"
+ android:layout_marginEnd="10dp"
+ android:onClick="onClickRadioButton" />
+
+ <RadioButton
+ android:id="@+id/export_radiobutton"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:text="@string/export"
+ android:onClick="onClickRadioButton" />
+ </RadioGroup>
+
+ <!-- Align the edit text and the select file button horizontally. -->
+ <LinearLayout
+ android:id="@+id/file_name_linearlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal"
+ android:layout_marginTop="10dp">
+
+ <!-- The text input layout makes the hint float above the edit text. -->
+ <com.google.android.material.textfield.TextInputLayout
+ android:layout_height="wrap_content"
+ android:layout_width="0dp"
+ android:layout_weight="1" >
+
+ <!-- `android:inputType="textUri" disables spell check and places an `/` on the main keyboard. -->
+ <com.google.android.material.textfield.TextInputEditText
+ android:id="@+id/file_name_edittext"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:hint="@string/file_name"
+ android:inputType="textMultiLine|textUri" />
+ </com.google.android.material.textfield.TextInputLayout>
+
+ <Button
+ android:id="@+id/browse_button"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:text="@string/browse"
+ android:onClick="browse" />
+ </LinearLayout>
+
+ <!-- OpenKeychain import instructions -->
+ <TextView
+ android:id="@+id/openkeychain_import_instructions_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_margin="5dp"
+ android:text="@string/openkeychain_import_instructions"
+ android:textAlignment="center" />
+
+ <Button
+ android:id="@+id/import_export_button"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginTop="10dp"
+ android:text="@string/import_button"
+ android:textSize="18sp"
+ android:onClick="importExport"
+ app:backgroundTint="?attr/buttonBackgroundColorSelector"
+ android:textColor="?attr/buttonTextColorSelector" />
+ </LinearLayout>
+ </androidx.cardview.widget.CardView>
+ </LinearLayout>
+ </ScrollView>
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/import_export_appbarlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?android:attr/colorBackground"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/import_export_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+ </com.google.android.material.appbar.AppBarLayout>
+ </LinearLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2018-2021 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/>. -->
+
+<androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:id="@+id/import_export_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" >
+
+ <!-- the linear layout with `orientation="vertical"` moves the content below the app bar layout. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical" >
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/import_export_appbarlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?android:attr/colorBackground"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/import_export_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+ </com.google.android.material.appbar.AppBarLayout>
+
+ <ScrollView
+ android:layout_height="match_parent"
+ android:layout_width="match_parent" >
+
+ <!-- Align the cards vertically. -->
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="vertical" >
+
+ <!-- The encryption card. -->
+ <androidx.cardview.widget.CardView
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_marginTop="10dp"
+ android:layout_marginBottom="5dp"
+ android:layout_marginStart="10dp"
+ android:layout_marginEnd="10dp" >
+
+ <!-- Align the contents of the card vertically. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:layout_marginTop="10dp"
+ android:layout_marginBottom="20dp"
+ android:layout_marginStart="10dp"
+ android:layout_marginEnd="10dp" >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginBottom="6dp"
+ android:text="@string/encryption"
+ android:textSize="25sp"
+ android:textStyle="bold"
+ android:textColor="?colorAccent" />
+
+ <Spinner
+ android:id="@+id/encryption_spinner"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal" />
+
+ <!-- The encryption password. -->
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/encryption_password_textinputlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ app:passwordToggleEnabled="true" >
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:id="@+id/encryption_password_edittext"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:hint="@string/password"
+ android:inputType="textPassword"/>
+ </com.google.android.material.textfield.TextInputLayout>
+
+ <!-- KitKat password encryption message. -->
+ <TextView
+ android:id="@+id/kitkat_password_encryption_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginTop="10dp"
+ android:text="@string/kitkat_password_encryption_message"
+ android:textAlignment="center" />
+
+ <!-- OpenKeychain required message. -->
+ <TextView
+ android:id="@+id/openkeychain_required_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginTop="10dp"
+ android:text="@string/openkeychain_required"
+ android:textAlignment="center" />
+ </LinearLayout>
+ </androidx.cardview.widget.CardView>
+
+ <!-- The file location card. -->
+ <androidx.cardview.widget.CardView
+ android:id="@+id/file_location_cardview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_marginTop="5dp"
+ android:layout_marginBottom="5dp"
+ android:layout_marginStart="10dp"
+ android:layout_marginEnd="10dp" >
+
+ <!-- Align the contents of the card vertically. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:layout_marginTop="10dp"
+ android:layout_marginBottom="20dp"
+ android:layout_marginStart="10dp"
+ android:layout_marginEnd="10dp" >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginBottom="6dp"
+ android:text="@string/file_location"
+ android:textSize="25sp"
+ android:textStyle="bold"
+ android:textColor="?colorAccent" />
+
+ <RadioGroup
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:orientation="horizontal" >
+
+ <RadioButton
+ android:id="@+id/import_radiobutton"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:text="@string/import_button"
+ android:layout_marginEnd="10dp"
+ android:onClick="onClickRadioButton" />
+
+ <RadioButton
+ android:id="@+id/export_radiobutton"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:text="@string/export"
+ android:onClick="onClickRadioButton" />
+ </RadioGroup>
+
+ <!-- Align the edit text and the select file button horizontally. -->
+ <LinearLayout
+ android:id="@+id/file_name_linearlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal"
+ android:layout_marginTop="10dp">
+
+ <!-- The text input layout makes the hint float above the edit text. -->
+ <com.google.android.material.textfield.TextInputLayout
+ android:layout_height="wrap_content"
+ android:layout_width="0dp"
+ android:layout_weight="1" >
+
+ <!-- `android:inputType="textUri" disables spell check and places an `/` on the main keyboard. -->
+ <com.google.android.material.textfield.TextInputEditText
+ android:id="@+id/file_name_edittext"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:hint="@string/file_name"
+ android:inputType="textMultiLine|textUri" />
+ </com.google.android.material.textfield.TextInputLayout>
+
+ <Button
+ android:id="@+id/browse_button"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:text="@string/browse"
+ android:onClick="browse" />
+ </LinearLayout>
+
+ <!-- OpenKeychain import instructions -->
+ <TextView
+ android:id="@+id/openkeychain_import_instructions_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_margin="5dp"
+ android:text="@string/openkeychain_import_instructions"
+ android:textAlignment="center" />
+
+ <Button
+ android:id="@+id/import_export_button"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginTop="10dp"
+ android:text="@string/import_button"
+ android:textSize="18sp"
+ android:onClick="importExport"
+ app:backgroundTint="?attr/buttonBackgroundColorSelector"
+ android:textColor="?attr/buttonTextColorSelector" />
+ </LinearLayout>
+ </androidx.cardview.widget.CardView>
+ </LinearLayout>
+ </ScrollView>
+ </LinearLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- Copyright © 2018-2020 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/>. -->
-
-<androidx.coordinatorlayout.widget.CoordinatorLayout
- android:id="@+id/logcat_coordinatorlayout"
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_height="match_parent"
- android:layout_width="match_parent" >
-
- <!-- the LinearLayout with `orientation="vertical"` moves the content below the AppBarLayout. -->
- <LinearLayout
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:orientation="vertical" >
-
- <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. The background is set programmatically based on the proxy status. -->
- <com.google.android.material.appbar.AppBarLayout
- android:id="@+id/logcat_appbarlayout"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:background="?android:attr/colorBackground"
- android:theme="@style/PrivacyBrowserAppBar" >
-
- <androidx.appcompat.widget.Toolbar
- android:id="@+id/logcat_toolbar"
- android:layout_height="wrap_content"
- android:layout_width="match_parent" />
- </com.google.android.material.appbar.AppBarLayout>
-
- <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
- android:id="@+id/logcat_swiperefreshlayout"
- android:layout_height="match_parent"
- android:layout_width="match_parent" >
-
- <ScrollView
- android:id="@+id/logcat_scrollview"
- android:layout_height="wrap_content"
- android:layout_width="match_parent" >
-
- <TextView
- android:id="@+id/logcat_textview"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:layout_margin="10dp"
- android:textIsSelectable="true" />
- </ScrollView>
- </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
- </LinearLayout>
-</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2018-2021 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/>. -->
+
+<androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:id="@+id/logcat_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" >
+
+ <!-- The linear layout with `orientation="vertical"` keeps the content above the app bar layout. `app:layout_dodgeInsetEdges="bottom"` as a child of a coordinator layout moves the view above snackbars. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ app:layout_dodgeInsetEdges="bottom" >
+
+ <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
+ android:id="@+id/logcat_swiperefreshlayout"
+ android:layout_height="0dp"
+ android:layout_width="match_parent"
+ android:layout_weight="1" >
+
+ <ScrollView
+ android:id="@+id/logcat_scrollview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" >
+
+ <TextView
+ android:id="@+id/logcat_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_margin="10dp"
+ android:textIsSelectable="true" />
+ </ScrollView>
+ </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/logcat_appbarlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?android:attr/colorBackground"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/logcat_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+ </com.google.android.material.appbar.AppBarLayout>
+ </LinearLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2018-2021 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/>. -->
+
+<androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:id="@+id/logcat_coordinatorlayout"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent" >
+
+ <!-- The linear layout with `orientation="vertical"` moves the content below the app bar layout. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical" >
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/logcat_appbarlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?android:attr/colorBackground"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/logcat_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+ </com.google.android.material.appbar.AppBarLayout>
+
+ <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
+ android:id="@+id/logcat_swiperefreshlayout"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent" >
+
+ <ScrollView
+ android:id="@+id/logcat_scrollview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" >
+
+ <TextView
+ android:id="@+id/logcat_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_margin="10dp"
+ android:textIsSelectable="true" />
+ </ScrollView>
+ </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
+ </LinearLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- Copyright © 2015-2017,2019-2020 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/>. -->
-
-<FrameLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/root_framelayout"
- android:layout_height="match_parent"
- android:layout_width="match_parent" >
-
- <androidx.drawerlayout.widget.DrawerLayout
- android:id="@+id/drawerlayout"
- android:layout_height="match_parent"
- android:layout_width="match_parent" >
-
- <!-- The relative layout contains the AdView and the coordinator layout, which contains the rest of the views. -->
- <RelativeLayout
- android:id="@+id/main_content_relativelayout"
- android:layout_height="match_parent"
- android:layout_width="match_parent" >
-
- <!-- Include the AdView. For the standard flavor, this just includes a TextView with `visibility="gone"`. -->
- <include layout="@layout/adview" />
-
- <!-- Setting the CoordinatorLayout to be `focusableInTouchMode` prevents the URL text box from stealing focus on launch and opening the keyboard. -->
- <androidx.coordinatorlayout.widget.CoordinatorLayout
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:layout_above="@id/adview"
- android:focusable="true"
- android:focusableInTouchMode="true" >
-
- <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. The background is set programmatically based on the proxy status. -->
- <com.google.android.material.appbar.AppBarLayout
- android:id="@+id/appbar_layout"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:theme="@style/PrivacyBrowserAppBar" >
-
- <!-- The toolbar. It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
- <androidx.appcompat.widget.Toolbar
- android:id="@+id/toolbar"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:visibility="gone"
- app:layout_scrollFlags="scroll|enterAlways|snap" />
-
- <!-- The find on page linear layout. It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
- <LinearLayout
- android:id="@+id/find_on_page_linearlayout"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:orientation="horizontal"
- android:visibility="gone"
- app:layout_scrollFlags="scroll|enterAlways|snap" >
-
- <!-- `android:imeOptions="actionDone"` sets the keyboard to have a `check mark` key instead of a `new line` key. -->
- <EditText
- android:id="@+id/find_on_page_edittext"
- android:layout_height="wrap_content"
- android:layout_width="0dp"
- android:layout_weight="1"
- android:layout_marginStart="8dp"
- android:layout_marginEnd="4dp"
- android:hint="@string/find_on_page"
- android:lines="1"
- android:imeOptions="actionDone"
- android:inputType="text"
- tools:ignore="Autofill" />
-
- <TextView
- android:id="@+id/find_on_page_count_textview"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_marginStart="4dp"
- android:layout_marginEnd="4dp"
- android:text="@string/zero_of_zero" />
-
- <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
- <ImageView
- android:id="@+id/find_previous"
- android:src="@drawable/previous"
- android:layout_width="35dp"
- android:layout_height="35dp"
- android:layout_marginStart="4dp"
- android:layout_marginEnd="4dp"
- android:layout_gravity="center_vertical"
- android:background="?attr/selectableItemBackground"
- android:contentDescription="@string/previous"
- android:onClick="findPreviousOnPage"
- app:tint="?attr/findOnPageIconTintColor" />
-
- <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
- <ImageView
- android:id="@+id/find_next"
- android:src="@drawable/next"
- android:layout_width="35dp"
- android:layout_height="35dp"
- android:layout_marginStart="4dp"
- android:layout_marginEnd="4dp"
- android:layout_gravity="center_vertical"
- android:background="?attr/selectableItemBackground"
- android:contentDescription="@string/next"
- android:onClick="findNextOnPage"
- app:tint="?attr/findOnPageIconTintColor" />
-
- <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
- <ImageView
- android:id="@+id/close_find"
- android:src="@drawable/close_day"
- android:layout_width="35dp"
- android:layout_height="35dp"
- android:layout_marginStart="4dp"
- android:layout_marginEnd="8dp"
- android:layout_gravity="center_vertical"
- android:background="?attr/selectableItemBackground"
- android:contentDescription="@string/close"
- android:onClick="closeFindOnPage"
- app:tint="?attr/findOnPageIconTintColor" />
- </LinearLayout>
-
- <!-- The tab linear layout. It sets the background to the right of the add tab button. It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
- <LinearLayout
- android:id="@+id/tabs_linearlayout"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:orientation="horizontal"
- android:visibility="gone"
- app:layout_scrollFlags="scroll|enterAlways|snap" >
-
- <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
- <ImageView
- android:layout_height="match_parent"
- android:layout_width="wrap_content"
- android:layout_gravity="center_vertical"
- android:paddingStart="10dp"
- android:paddingEnd="10dp"
- android:src="@drawable/close_day"
- android:background="?attr/selectableItemBackground"
- android:onClick="closeTab"
- android:contentDescription="@string/close_tab"
- app:tint="?attr/addTabIconTintColor" />
-
- <com.google.android.material.tabs.TabLayout
- android:id="@+id/tablayout"
- android:layout_height="wrap_content"
- android:layout_width="0dp"
- android:layout_weight="1"
- app:tabIndicatorGravity="top"
- app:tabMode="scrollable" />
-
- <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
- <ImageView
- android:layout_height="match_parent"
- android:layout_width="wrap_content"
- android:layout_gravity="center_vertical"
- android:paddingStart="10dp"
- android:paddingEnd="10dp"
- android:src="@drawable/add"
- android:background="?attr/selectableItemBackground"
- android:onClick="addTab"
- android:contentDescription="@string/add_tab"
- app:tint="?attr/addTabIconTintColor" />
- </LinearLayout>
- </com.google.android.material.appbar.AppBarLayout>
-
- <!-- `app:layout_behavior="@string/appbar_scrolling_view_behavior"` must be set on the sibling of AppBarLayout. -->
- <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
- android:id="@+id/swiperefreshlayout"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- app:layout_behavior="@string/appbar_scrolling_view_behavior" >
-
- <com.stoutner.privacybrowser.views.NoSwipeViewPager
- android:id="@+id/webviewpager"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
- </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
- </androidx.coordinatorlayout.widget.CoordinatorLayout>
- </RelativeLayout>
-
- <!-- The navigation drawer. -->
- <com.google.android.material.navigation.NavigationView
- android:id="@+id/navigationview"
- android:layout_height="match_parent"
- android:layout_width="wrap_content"
- android:layout_gravity="start"
- app:menu="@menu/webview_navigation_menu"
- app:itemIconTint="?attr/navigationIconTintColor" />
-
- <!-- Include the bookmarks drawer, which varies based on screen width. -->
- <include layout="@layout/bookmarks_drawer" />
- </androidx.drawerlayout.widget.DrawerLayout>
-
- <!-- The full screen video frame layout is used to display full screen videos. It is initially `android:visibility="gone"` to hide it from view. -->
- <FrameLayout
- android:id="@+id/full_screen_video_framelayout"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:visibility="gone" />
-
- <!-- The loading blocklists relative layout displays when the app first starts. It is hidden once the blocklists are populated. -->
- <RelativeLayout
- android:id="@+id/loading_blocklists_relativelayout"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <ImageView
- android:id="@+id/privacy_browser_logo"
- android:layout_height="256dp"
- android:layout_width="256dp"
- android:layout_centerInParent="true"
- android:src="@drawable/privacy_browser_foreground"
- tools:ignore="contentDescription" />
-
- <TextView
- android:id="@+id/loading_blocklist_textview"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/privacy_browser_logo"
- android:layout_centerHorizontal="true"
- android:layout_margin="10dp"
- android:textSize="16sp"
- android:textAlignment="center"
- android:textColor="?android:attr/textColorPrimary" />
- </RelativeLayout>
-</FrameLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2015-2017,2019-2021 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/>. -->
+
+<FrameLayout
+ android:id="@+id/root_framelayout"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent" >
+
+ <androidx.drawerlayout.widget.DrawerLayout
+ android:id="@+id/drawerlayout"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent" >
+
+ <!-- The relative layout contains the AdView and the coordinator layout, which contains the rest of the views. -->
+ <RelativeLayout
+ android:id="@+id/main_content_relativelayout"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent" >
+
+ <!-- Include the AdView. For the standard flavor, this just includes a TextView with `visibility="gone"`. -->
+ <include layout="@layout/adview_bottom_appbar" />
+
+ <!-- Setting the CoordinatorLayout to be `focusableInTouchMode` prevents the URL text box from stealing focus on launch and opening the keyboard. -->
+ <androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:layout_below="@id/adview"
+ android:focusable="true"
+ android:focusableInTouchMode="true" >
+
+ <!-- `app:layout_dodgeInsetEdges="bottom"` as a child of a coordinator layout moves the view above snackbars. -->
+ <RelativeLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ app:layout_dodgeInsetEdges="bottom" >
+
+ <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
+ android:id="@+id/swiperefreshlayout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_above="@id/appbar_layout" >
+
+ <com.stoutner.privacybrowser.views.NoSwipeViewPager
+ android:id="@+id/webviewpager"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent" />
+ </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. The background is set programmatically based on the proxy status. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/appbar_layout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:theme="@style/PrivacyBrowserAppBar"
+ android:layout_alignParentBottom="true" >
+
+ <!-- The tab linear layout. It sets the background to the right of the add tab button.
+ It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
+ <LinearLayout
+ android:id="@+id/tabs_linearlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:orientation="horizontal"
+ android:visibility="gone" >
+
+ <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
+ <ImageView
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:paddingStart="10dp"
+ android:paddingEnd="10dp"
+ android:src="@drawable/close_day"
+ android:background="?attr/selectableItemBackground"
+ android:onClick="closeTab"
+ android:contentDescription="@string/close_tab"
+ app:tint="?attr/addTabIconTintColor" />
+
+ <com.google.android.material.tabs.TabLayout
+ android:id="@+id/tablayout"
+ android:layout_height="wrap_content"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ app:tabMode="scrollable" />
+
+ <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
+ <ImageView
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:paddingStart="10dp"
+ android:paddingEnd="10dp"
+ android:src="@drawable/add"
+ android:background="?attr/selectableItemBackground"
+ android:onClick="addTab"
+ android:contentDescription="@string/add_tab"
+ app:tint="?attr/addTabIconTintColor" />
+ </LinearLayout>
+
+ <!-- The find on page linear layout. It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
+ <LinearLayout
+ android:id="@+id/find_on_page_linearlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal"
+ android:visibility="gone" >
+
+ <!-- `android:imeOptions="actionDone"` sets the keyboard to have a `check mark` key instead of a `new line` key. -->
+ <EditText
+ android:id="@+id/find_on_page_edittext"
+ android:layout_height="wrap_content"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_marginStart="8dp"
+ android:layout_marginEnd="4dp"
+ android:hint="@string/find_on_page"
+ android:lines="1"
+ android:imeOptions="actionDone"
+ android:inputType="text"
+ tools:ignore="Autofill" />
+
+ <TextView
+ android:id="@+id/find_on_page_count_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginStart="4dp"
+ android:layout_marginEnd="4dp"
+ android:text="@string/zero_of_zero" />
+
+ <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
+ <ImageView
+ android:id="@+id/find_previous"
+ android:src="@drawable/previous"
+ android:layout_width="35dp"
+ android:layout_height="35dp"
+ android:layout_marginStart="4dp"
+ android:layout_marginEnd="4dp"
+ android:layout_gravity="center_vertical"
+ android:background="?attr/selectableItemBackground"
+ android:contentDescription="@string/previous"
+ android:onClick="findPreviousOnPage"
+ app:tint="?attr/findOnPageIconTintColor" />
+
+ <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
+ <ImageView
+ android:id="@+id/find_next"
+ android:src="@drawable/next"
+ android:layout_width="35dp"
+ android:layout_height="35dp"
+ android:layout_marginStart="4dp"
+ android:layout_marginEnd="4dp"
+ android:layout_gravity="center_vertical"
+ android:background="?attr/selectableItemBackground"
+ android:contentDescription="@string/next"
+ android:onClick="findNextOnPage"
+ app:tint="?attr/findOnPageIconTintColor" />
+
+ <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
+ <ImageView
+ android:id="@+id/close_find"
+ android:src="@drawable/close_day"
+ android:layout_width="35dp"
+ android:layout_height="35dp"
+ android:layout_marginStart="4dp"
+ android:layout_marginEnd="8dp"
+ android:layout_gravity="center_vertical"
+ android:background="?attr/selectableItemBackground"
+ android:contentDescription="@string/close"
+ android:onClick="closeFindOnPage"
+ app:tint="?attr/findOnPageIconTintColor" />
+ </LinearLayout>
+
+ <!-- The toolbar. It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:visibility="gone" />
+ </com.google.android.material.appbar.AppBarLayout>
+ </RelativeLayout>
+ </androidx.coordinatorlayout.widget.CoordinatorLayout>
+ </RelativeLayout>
+
+ <!-- The navigation drawer. -->
+ <com.google.android.material.navigation.NavigationView
+ android:id="@+id/navigationview"
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content"
+ android:layout_gravity="start"
+ app:menu="@menu/webview_navigation_menu"
+ app:itemIconTint="?attr/navigationIconTintColor" />
+
+ <!-- Include the bookmarks drawer, which varies based on screen width. -->
+ <include layout="@layout/bookmarks_drawer_bottom_appbar" />
+ </androidx.drawerlayout.widget.DrawerLayout>
+
+ <!-- The full screen video frame layout is used to display full screen videos. It is initially `android:visibility="gone"` to hide it from view. -->
+ <FrameLayout
+ android:id="@+id/full_screen_video_framelayout"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:visibility="gone" />
+
+ <!-- The loading blocklists relative layout displays when the app first starts. It is hidden once the blocklists are populated. -->
+ <RelativeLayout
+ android:id="@+id/loading_blocklists_relativelayout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ImageView
+ android:id="@+id/privacy_browser_logo"
+ android:layout_height="256dp"
+ android:layout_width="256dp"
+ android:layout_centerInParent="true"
+ android:src="@drawable/privacy_browser_foreground"
+ tools:ignore="contentDescription" />
+
+ <TextView
+ android:id="@+id/loading_blocklist_textview"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/privacy_browser_logo"
+ android:layout_centerHorizontal="true"
+ android:layout_margin="10dp"
+ android:textSize="16sp"
+ android:textAlignment="center"
+ android:textColor="?android:attr/textColorPrimary" />
+ </RelativeLayout>
+</FrameLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2015-2017,2019-2021 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/>. -->
+
+<FrameLayout
+ android:id="@+id/root_framelayout"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent" >
+
+ <androidx.drawerlayout.widget.DrawerLayout
+ android:id="@+id/drawerlayout"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent" >
+
+ <!-- The relative layout contains the AdView and the coordinator layout, which contains the rest of the views. -->
+ <RelativeLayout
+ android:id="@+id/main_content_relativelayout"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent" >
+
+ <!-- Include the AdView. For the standard flavor, this just includes a TextView with `visibility="gone"`. -->
+ <include layout="@layout/adview_top_appbar" />
+
+ <!-- Setting the CoordinatorLayout to be `focusableInTouchMode` prevents the URL text box from stealing focus on launch and opening the keyboard. -->
+ <androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:layout_above="@id/adview"
+ android:focusable="true"
+ android:focusableInTouchMode="true" >
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. The background is set programmatically based on the proxy status. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/appbar_layout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <!-- The toolbar. It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:visibility="gone"
+ app:layout_scrollFlags="scroll|enterAlways|snap" />
+
+ <!-- The find on page linear layout. It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
+ <LinearLayout
+ android:id="@+id/find_on_page_linearlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal"
+ android:visibility="gone"
+ app:layout_scrollFlags="scroll|enterAlways|snap" >
+
+ <!-- `android:imeOptions="actionDone"` sets the keyboard to have a `check mark` key instead of a `new line` key. -->
+ <EditText
+ android:id="@+id/find_on_page_edittext"
+ android:layout_height="wrap_content"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_marginStart="8dp"
+ android:layout_marginEnd="4dp"
+ android:hint="@string/find_on_page"
+ android:lines="1"
+ android:imeOptions="actionDone"
+ android:inputType="text"
+ tools:ignore="Autofill" />
+
+ <TextView
+ android:id="@+id/find_on_page_count_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginStart="4dp"
+ android:layout_marginEnd="4dp"
+ android:text="@string/zero_of_zero" />
+
+ <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
+ <ImageView
+ android:id="@+id/find_previous"
+ android:src="@drawable/previous"
+ android:layout_width="35dp"
+ android:layout_height="35dp"
+ android:layout_marginStart="4dp"
+ android:layout_marginEnd="4dp"
+ android:layout_gravity="center_vertical"
+ android:background="?attr/selectableItemBackground"
+ android:contentDescription="@string/previous"
+ android:onClick="findPreviousOnPage"
+ app:tint="?attr/findOnPageIconTintColor" />
+
+ <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
+ <ImageView
+ android:id="@+id/find_next"
+ android:src="@drawable/next"
+ android:layout_width="35dp"
+ android:layout_height="35dp"
+ android:layout_marginStart="4dp"
+ android:layout_marginEnd="4dp"
+ android:layout_gravity="center_vertical"
+ android:background="?attr/selectableItemBackground"
+ android:contentDescription="@string/next"
+ android:onClick="findNextOnPage"
+ app:tint="?attr/findOnPageIconTintColor" />
+
+ <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
+ <ImageView
+ android:id="@+id/close_find"
+ android:src="@drawable/close_day"
+ android:layout_width="35dp"
+ android:layout_height="35dp"
+ android:layout_marginStart="4dp"
+ android:layout_marginEnd="8dp"
+ android:layout_gravity="center_vertical"
+ android:background="?attr/selectableItemBackground"
+ android:contentDescription="@string/close"
+ android:onClick="closeFindOnPage"
+ app:tint="?attr/findOnPageIconTintColor" />
+ </LinearLayout>
+
+ <!-- The tab linear layout. It sets the background to the right of the add tab button. It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
+ <LinearLayout
+ android:id="@+id/tabs_linearlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:orientation="horizontal"
+ android:visibility="gone"
+ app:layout_scrollFlags="scroll|enterAlways|snap" >
+
+ <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
+ <ImageView
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:paddingStart="10dp"
+ android:paddingEnd="10dp"
+ android:src="@drawable/close_day"
+ android:background="?attr/selectableItemBackground"
+ android:onClick="closeTab"
+ android:contentDescription="@string/close_tab"
+ app:tint="?attr/addTabIconTintColor" />
+
+ <com.google.android.material.tabs.TabLayout
+ android:id="@+id/tablayout"
+ android:layout_height="wrap_content"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ app:tabIndicatorGravity="top"
+ app:tabMode="scrollable" />
+
+ <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
+ <ImageView
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:paddingStart="10dp"
+ android:paddingEnd="10dp"
+ android:src="@drawable/add"
+ android:background="?attr/selectableItemBackground"
+ android:onClick="addTab"
+ android:contentDescription="@string/add_tab"
+ app:tint="?attr/addTabIconTintColor" />
+ </LinearLayout>
+ </com.google.android.material.appbar.AppBarLayout>
+
+ <!-- `app:layout_behavior="@string/appbar_scrolling_view_behavior"` must be set on the sibling of AppBarLayout. -->
+ <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
+ android:id="@+id/swiperefreshlayout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior" >
+
+ <com.stoutner.privacybrowser.views.NoSwipeViewPager
+ android:id="@+id/webviewpager"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent" />
+ </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
+ </androidx.coordinatorlayout.widget.CoordinatorLayout>
+ </RelativeLayout>
+
+ <!-- The navigation drawer. -->
+ <com.google.android.material.navigation.NavigationView
+ android:id="@+id/navigationview"
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content"
+ android:layout_gravity="start"
+ app:menu="@menu/webview_navigation_menu"
+ app:itemIconTint="?attr/navigationIconTintColor" />
+
+ <!-- Include the bookmarks drawer, which varies based on screen width. -->
+ <include layout="@layout/bookmarks_drawer_top_appbar" />
+ </androidx.drawerlayout.widget.DrawerLayout>
+
+ <!-- The full screen video frame layout is used to display full screen videos. It is initially `android:visibility="gone"` to hide it from view. -->
+ <FrameLayout
+ android:id="@+id/full_screen_video_framelayout"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:visibility="gone" />
+
+ <!-- The loading blocklists relative layout displays when the app first starts. It is hidden once the blocklists are populated. -->
+ <RelativeLayout
+ android:id="@+id/loading_blocklists_relativelayout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ImageView
+ android:id="@+id/privacy_browser_logo"
+ android:layout_height="256dp"
+ android:layout_width="256dp"
+ android:layout_centerInParent="true"
+ android:src="@drawable/privacy_browser_foreground"
+ tools:ignore="contentDescription" />
+
+ <TextView
+ android:id="@+id/loading_blocklist_textview"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/privacy_browser_logo"
+ android:layout_centerHorizontal="true"
+ android:layout_margin="10dp"
+ android:textSize="16sp"
+ android:textAlignment="center"
+ android:textColor="?android:attr/textColorPrimary" />
+ </RelativeLayout>
+</FrameLayout>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- Copyright © 2018-2020 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/>. -->
-
-<androidx.coordinatorlayout.widget.CoordinatorLayout
- android:id="@+id/requests_coordinatorlayout"
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_height="match_parent"
- android:layout_width="match_parent" >
-
- <!-- the linear layout with `orientation="vertical"` moves the content below the app bar layout. -->
- <LinearLayout
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:orientation="vertical" >
-
- <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
- <com.google.android.material.appbar.AppBarLayout
- android:id="@+id/requests_appbarlayout"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:background="?android:attr/colorBackground"
- android:theme="@style/PrivacyBrowserAppBar" >
-
- <androidx.appcompat.widget.Toolbar
- android:id="@+id/requests_toolbar"
- android:layout_height="wrap_content"
- android:layout_width="match_parent" />
- </com.google.android.material.appbar.AppBarLayout>
-
- <!-- `android:dividerHeight` must be at least `1dp` or the list view is inconsistent in calculating how many bookmarks are displayed. -->
- <ListView
- android:id="@+id/requests_listview"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:divider="@color/transparent"
- android:dividerHeight="1dp" />
- </LinearLayout>
-</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2018-2021 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/>. -->
+
+<androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:id="@+id/requests_coordinatorlayout"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent" >
+
+ <!-- The linear layout with `orientation="vertical"` keeps the content above the app bar layout. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical" >
+
+ <!-- `android:dividerHeight` must be at least `1dp` or the list view is inconsistent in calculating how many bookmarks are displayed. -->
+ <ListView
+ android:id="@+id/requests_listview"
+ android:layout_height="0dp"
+ android:layout_width="match_parent"
+ android:layout_weight="1"
+ android:divider="@color/transparent"
+ android:dividerHeight="1dp" />
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/requests_appbarlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?android:attr/colorBackground"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/requests_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+ </com.google.android.material.appbar.AppBarLayout>
+ </LinearLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2018-2021 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/>. -->
+
+<androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:id="@+id/requests_coordinatorlayout"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent" >
+
+ <!-- The linear layout with `orientation="vertical"` moves the content below the app bar layout. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical" >
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/requests_appbarlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?android:attr/colorBackground"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/requests_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+ </com.google.android.material.appbar.AppBarLayout>
+
+ <!-- `android:dividerHeight` must be at least `1dp` or the list view is inconsistent in calculating how many bookmarks are displayed. -->
+ <ListView
+ android:id="@+id/requests_listview"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:divider="@color/transparent"
+ android:dividerHeight="1dp" />
+ </LinearLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- Copyright © 2017-2021 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/>. -->
-
-<!-- Setting the layout root to be `focusableInTouchMode` prevents the URL toolbar from stealing focus on launch and opening the keyboard. -->
-<androidx.coordinatorlayout.widget.CoordinatorLayout
- android:id="@+id/view_source_coordinatorlayout"
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:focusable="true"
- android:focusableInTouchMode="true" >
-
- <!-- The linear layout with `orientation="vertical"` moves the content below the app bar layout. -->
- <LinearLayout
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:orientation="vertical" >
-
- <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
- <com.google.android.material.appbar.AppBarLayout
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:background="?android:attr/colorBackground"
- android:theme="@style/PrivacyBrowserAppBar" >
-
- <!-- The frame layout allows the toolbar and the progress bar to occupy the same space. -->
- <FrameLayout
- android:layout_height="wrap_content"
- android:layout_width="match_parent" >
-
- <androidx.appcompat.widget.Toolbar
- android:id="@+id/view_source_toolbar"
- android:layout_height="wrap_content"
- android:layout_width="match_parent" />
-
- <!-- Android automatically uses a different, skinnier drawable with padding for indeterminate horizontal progress bars in API >= 21.
- They make this very difficult to override. https://redmine.stoutner.com/issues/241
- `tools:ignore="UnusedAttribute"` removes the lint warning about `progressTint` and `progressBackgroundTint` not applying to API < 21. -->
- <ProgressBar
- android:id="@+id/progress_bar"
- style="?android:attr/progressBarStyleHorizontal"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:minHeight="3dp"
- android:layout_gravity="bottom"
- android:visibility="gone"
- tools:ignore="UnusedAttribute" />
- </FrameLayout>
- </com.google.android.material.appbar.AppBarLayout>
-
- <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
- android:id="@+id/view_source_swiperefreshlayout"
- android:layout_height="match_parent"
- android:layout_width="match_parent">
-
- <ScrollView
- android:id="@+id/view_source_scrollview"
- android:layout_height="wrap_content"
- android:layout_width="match_parent" >
-
- <LinearLayout
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:orientation="vertical"
- android:layout_margin="10dp" >
-
- <!-- Request headers. -->
- <TextView
- android:id="@+id/request_headers_title_textview"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:text="@string/request_headers"
- android:textAlignment="center"
- android:textSize="18sp"
- android:textColor="?attr/blueTextColor"
- android:textStyle="bold" />
-
- <TextView
- android:id="@+id/request_headers_textview"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:textIsSelectable="true"
- android:layout_marginBottom="8dp" />
-
- <!-- Response message. -->
- <TextView
- android:id="@+id/response_message_title_textview"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:text="@string/response_message"
- android:textAlignment="center"
- android:textSize="18sp"
- android:textColor="?attr/blueTextColor"
- android:textStyle="bold" />
-
- <TextView
- android:id="@+id/response_message_textview"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:textIsSelectable="true"
- android:layout_marginBottom="8dp" />
-
- <!-- Response headers. -->
- <!-- The title text is set programatically. -->
- <TextView
- android:id="@+id/response_headers_title_textivew"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:textAlignment="center"
- android:textSize="18sp"
- android:textColor="?attr/blueTextColor"
- android:textStyle="bold" />
-
- <TextView
- android:id="@+id/response_headers_textview"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:textIsSelectable="true"
- android:layout_marginBottom="8dp" />
-
- <!-- Response body. -->
- <!-- The title text is set programatically. -->
- <TextView
- android:id="@+id/response_body_title_textview"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:textAlignment="center"
- android:textSize="18sp"
- android:textColor="?attr/blueTextColor"
- android:textStyle="bold" />
-
- <TextView
- android:id="@+id/response_body_textview"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:textIsSelectable="true" />
- </LinearLayout>
- </ScrollView>
- </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
- </LinearLayout>
-</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2017-2021 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/>. -->
+
+<!-- Setting the layout root to be `focusableInTouchMode` prevents the URL toolbar from stealing focus on launch and opening the keyboard. -->
+<androidx.coordinatorlayout.widget.CoordinatorLayout android:id="@+id/view_source_coordinatorlayout"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:focusable="true"
+ android:focusableInTouchMode="true"
+ xmlns:app="http://schemas.android.com/apk/res-auto">
+
+ <!-- The linear layout with `orientation="vertical"` keeps the content above the app bar layout. `app:layout_dodgeInsetEdges="bottom"` as a child of a coordinator layout moves the view above snackbars. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ app:layout_dodgeInsetEdges="bottom" >
+
+ <!-- `android:layout_weight="1"` causes the swipe refresh layout to fill all the remaining space. -->
+ <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
+ android:id="@+id/view_source_swiperefreshlayout"
+ android:layout_height="0dp"
+ android:layout_width="match_parent"
+ android:layout_weight="1">
+
+ <ScrollView
+ android:id="@+id/view_source_scrollview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" >
+
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:layout_margin="10dp" >
+
+ <!-- Request headers. -->
+ <TextView
+ android:id="@+id/request_headers_title_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:text="@string/request_headers"
+ android:textAlignment="center"
+ android:textSize="18sp"
+ android:textColor="?attr/blueTextColor"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/request_headers_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textIsSelectable="true"
+ android:layout_marginBottom="8dp" />
+
+ <!-- Response message. -->
+ <TextView
+ android:id="@+id/response_message_title_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:text="@string/response_message"
+ android:textAlignment="center"
+ android:textSize="18sp"
+ android:textColor="?attr/blueTextColor"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/response_message_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textIsSelectable="true"
+ android:layout_marginBottom="8dp" />
+
+ <!-- Response headers. -->
+ <!-- The title text is set programatically. -->
+ <TextView
+ android:id="@+id/response_headers_title_textivew"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textAlignment="center"
+ android:textSize="18sp"
+ android:textColor="?attr/blueTextColor"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/response_headers_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textIsSelectable="true"
+ android:layout_marginBottom="8dp" />
+
+ <!-- Response body. -->
+ <!-- The title text is set programatically. -->
+ <TextView
+ android:id="@+id/response_body_title_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textAlignment="center"
+ android:textSize="18sp"
+ android:textColor="?attr/blueTextColor"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/response_body_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textIsSelectable="true" />
+ </LinearLayout>
+ </ScrollView>
+ </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?android:attr/colorBackground"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <!-- The frame layout allows the toolbar and the progress bar to occupy the same space. -->
+ <FrameLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" >
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/view_source_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+
+ <!-- Android automatically uses a different, skinnier drawable with padding for indeterminate horizontal progress bars in API >= 21.
+ They make this very difficult to override. https://redmine.stoutner.com/issues/241
+ `tools:ignore="UnusedAttribute"` removes the lint warning about `progressTint` and `progressBackgroundTint` not applying to API < 21. -->
+ <ProgressBar
+ android:id="@+id/progress_bar"
+ style="?android:attr/progressBarStyleHorizontal"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:minHeight="3dp"
+ android:layout_gravity="bottom"
+ android:visibility="gone"
+ tools:ignore="UnusedAttribute" />
+ </FrameLayout>
+ </com.google.android.material.appbar.AppBarLayout>
+ </LinearLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2017-2021 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/>. -->
+
+<!-- Setting the layout root to be `focusableInTouchMode` prevents the URL toolbar from stealing focus on launch and opening the keyboard. -->
+<androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:id="@+id/view_source_coordinatorlayout"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:focusable="true"
+ android:focusableInTouchMode="true" >
+
+ <!-- The linear layout with `orientation="vertical"` moves the content below the app bar layout. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical" >
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?android:attr/colorBackground"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <!-- The frame layout allows the toolbar and the progress bar to occupy the same space. -->
+ <FrameLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" >
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/view_source_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+
+ <!-- Android automatically uses a different, skinnier drawable with padding for indeterminate horizontal progress bars in API >= 21.
+ They make this very difficult to override. https://redmine.stoutner.com/issues/241
+ `tools:ignore="UnusedAttribute"` removes the lint warning about `progressTint` and `progressBackgroundTint` not applying to API < 21. -->
+ <ProgressBar
+ android:id="@+id/progress_bar"
+ style="?android:attr/progressBarStyleHorizontal"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:minHeight="3dp"
+ android:layout_gravity="bottom"
+ android:visibility="gone"
+ tools:ignore="UnusedAttribute" />
+ </FrameLayout>
+ </com.google.android.material.appbar.AppBarLayout>
+
+ <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
+ android:id="@+id/view_source_swiperefreshlayout"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent">
+
+ <ScrollView
+ android:id="@+id/view_source_scrollview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" >
+
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:layout_margin="10dp" >
+
+ <!-- Request headers. -->
+ <TextView
+ android:id="@+id/request_headers_title_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:text="@string/request_headers"
+ android:textAlignment="center"
+ android:textSize="18sp"
+ android:textColor="?attr/blueTextColor"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/request_headers_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textIsSelectable="true"
+ android:layout_marginBottom="8dp" />
+
+ <!-- Response message. -->
+ <TextView
+ android:id="@+id/response_message_title_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:text="@string/response_message"
+ android:textAlignment="center"
+ android:textSize="18sp"
+ android:textColor="?attr/blueTextColor"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/response_message_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textIsSelectable="true"
+ android:layout_marginBottom="8dp" />
+
+ <!-- Response headers. -->
+ <!-- The title text is set programatically. -->
+ <TextView
+ android:id="@+id/response_headers_title_textivew"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textAlignment="center"
+ android:textSize="18sp"
+ android:textColor="?attr/blueTextColor"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/response_headers_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textIsSelectable="true"
+ android:layout_marginBottom="8dp" />
+
+ <!-- Response body. -->
+ <!-- The title text is set programatically. -->
+ <TextView
+ android:id="@+id/response_body_title_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textAlignment="center"
+ android:textSize="18sp"
+ android:textColor="?attr/blueTextColor"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/response_body_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textIsSelectable="true" />
+ </LinearLayout>
+ </ScrollView>
+ </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
+ </LinearLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
<string name="response_message">Message de la réponse</string>
<string name="response_headers">En-tête de la réponse</string>
<string name="response_body">Corps de la réponse</string>
+ <string name="content_metadata">Métadonnées du contenu</string>
+ <string name="content_data">Données du contenu</string>
+ <string name="untrusted_ssl_certificate">Le certificat SSL n\'est pas fiable.</string>
+ <string name="load_anyway">Charger quand même</string>
<string name="about_view_source">A propos View Source</string>
<string name="about_view_source_message">Puisqu\'Android Webview ne permet pas de révêler l\'information source,
une requête séparée a été effectuée en utilisant les outils sytèmes afin d\'afficher ce qui est présenté à l\'écran
<!-- Main Items. -->
<item name="android:statusBarColor">?android:attr/colorBackground</item>
<item name="android:windowLightStatusBar">false</item>
- <item name="windowActionModeOverlay">true</item> <!-- `windowActionModeOverlay` makes the contextual app bar cover the support app bar. -->
<!-- Colors. -->
<item name="android:actionModeBackground">?android:attr/colorBackground</item>
<item name="android:statusBarColor">?android:attr/colorBackground</item>
<item name="android:windowLightNavigationBar">false</item>
<item name="android:windowLightStatusBar">false</item>
- <item name="windowActionModeOverlay">true</item> <!-- `windowActionModeOverlay` makes the contextual app bar cover the support app bar. -->
<!-- Colors. -->
<item name="android:actionModeBackground">?android:attr/colorBackground</item>
<resources>
<style name="PrivacyBrowser" parent="Theme.AppCompat.DayNight.NoActionBar" >
- <!-- Main Items. -->
- <item name="windowActionModeOverlay">true</item> <!-- `windowActionModeOverlay` makes the contextual app bar cover the support app bar. -->
-
<!-- Colors. -->
<item name="android:actionModeBackground">?android:attr/colorBackground</item>
<item name="android:textColorHighlight">@color/violet_700</item>
<string name="response_body">Corpo de Resposta</string>
<string name="content_metadata">Metadados de conteúdo</string>
<string name="content_data">Dados de conteúdo</string>
+ <string name="untrusted_ssl_certificate">O certificado SSL é suspeito.</string>
+ <string name="load_anyway">Carregar mesmo assim</string>
<string name="about_view_source">Sobre Ver Fonte</string>
<string name="about_view_source_message">Como o WebView do Android não expõe as informações de origem,
uma solicitação separada foi feita usando ferramentas do sistema para reunir as informações exibidas nesta atividade.
<!-- Main Items. -->
<item name="android:statusBarColor">?android:attr/colorBackground</item>
<item name="android:windowLightStatusBar">true</item>
- <item name="windowActionModeOverlay">true</item> <!-- `windowActionModeOverlay` makes the contextual app bar cover the support app bar. -->
<!-- Colors. -->
<item name="android:actionModeBackground">?android:attr/colorBackground</item>
<item name="android:statusBarColor">?android:attr/colorBackground</item>
<item name="android:windowLightNavigationBar">true</item>
<item name="android:windowLightStatusBar">true</item>
- <item name="windowActionModeOverlay">true</item> <!-- `windowActionModeOverlay` makes the contextual app bar cover the support app bar. -->
<!-- Colors. -->
<item name="android:actionModeBackground">?android:attr/colorBackground</item>
<string name="download_with_external_app_summary">Use an external app to download files.</string>
<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="bottom_app_bar">Bottom app bar</string>
+ <string name="bottom_app_bar_summary">Move the app bar to the bottom of the screen. Changing this setting will restart Privacy Browser.</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 opening the bookmarks drawer and toggling cookies.</string>
<string name="app_theme">App theme</string>
<string name="display_webpage_images_summary">Disable to conserve bandwidth.</string>
<!-- Non-translatable preference keys. -->
- <string name="cookies_key" translatable="false">cookies</string>
<string name="allow_screenshots_key" translatable="false">allow_screenshots</string>
+ <string name="bottom_app_bar_key" translatable="false">bottom_app_bar</string>
+ <string name="cookies_key" translatable="false">cookies</string>
<string name="clear_logcat_key" translatable="false">clear_logcat</string>
<string name="download_with_external_app_key" translatable="false">download_with_external_app</string>
<string name="display_additional_app_bar_icons_key" translatable="false">display_additional_app_bar_icons</string>
<resources>
<style name="PrivacyBrowser" parent="Theme.AppCompat.DayNight.NoActionBar" >
- <!-- Main Items. -->
- <item name="windowActionModeOverlay">true</item> <!-- `windowActionModeOverlay` makes the contextual app bar cover the support app bar. -->
-
<!-- Colors. -->
<item name="android:actionModeBackground">?android:attr/colorBackground</item>
<item name="android:textColorHighlight">@color/blue_200</item>
android:summary="@string/scroll_app_bar_summary"
android:defaultValue="true" />
+ <SwitchPreference
+ android:key="bottom_app_bar"
+ android:title="@string/bottom_app_bar"
+ android:summary="@string/bottom_app_bar_summary"
+ android:defaultValue="false" />
+
<SwitchPreference
android:key="display_additional_app_bar_icons"
android:title="@string/display_additional_app_bar_icons"