<w>cname</w>
<w>commitdiff</w>
<w>coordinatorlayout</w>
+ <w>customuseragent</w>
<w>didn</w>
<w>displayorder</w>
<w>dname</w>
<w>dwallach</w>
<w>eadd</w>
<w>edittext</w>
+ <w>enabledomstorage</w>
+ <w>enablefirstpartycookies</w>
+ <w>enableformdata</w>
+ <w>enablejavascript</w>
+ <w>enablethirdpartycookies</w>
<w>exynos</w>
<w>favoriteicon</w>
<w>fbee</w>
<w>fdfilter</w>
<w>fdid</w>
<w>firebase</w>
+ <w>fontsize</w>
<w>framelayout</w>
<w>gerlach</w>
<w>intl</w>
<w>torproject</w>
<w>uids</w>
<w>uname</w>
+ <w>useragent</w>
+ <w>useragentname</w>
+ <w>useragentstring</w>
<w>webkay</w>
<w>webkitversion</w>
<w>whatismyip</w>
<!-- `android:configChanges="orientation|screenSize"` makes the activity not reload when the orientation changes.
`android:persistableMode="persistNever"` removes Privacy Browser from the recents screen on a device reboot.
- `tools:ignore="unusedAttribute"` removes the lint warning that `persistableMode` does not apply to API < 21. -->
+ `tools:ignore="unusedAttribute"` removes the lint warning that `persistableMode` does not apply to API < 21.
+ `android:windowSoftInputMode="stateAlwaysHidden"` removes the keyboard from the screen, which is displayed because `ScrollViews` always focus the first `EditText` despite being told not to. -->
<activity
android:name=".activities.DomainSettingsActivity"
android:label="@string/domain_settings"
android:parentActivityName=".activities.DomainsActivity"
android:configChanges="orientation|screenSize"
android:screenOrientation="fullUser"
+ android:windowSoftInputMode="stateAlwaysHidden"
android:persistableMode="persistNever"
tools:ignore="UnusedAttribute" />
<p><img class="icon" src="../en/images/ic_chrome_reader_mode.png"> ic_chrome_reader_mode.</p>
<p><img class="icon" src="../en/images/ic_close.png"> ic_close.</p>
<p><img class="icon" src="../en/images/ic_create_new_folder.png"> ic_create_new_folder.</p>
+ <p><img class="icon" src="../en/images/ic_devices_other.png"> ic_devices_other.</p>
<p><img class="icon" src="../en/images/ic_delete.png"> ic_download.</p>
<p><img class="icon" src="../en/images/ic_dns.png"> ic_dns.</p>
<p><img class="icon" src="../en/images/ic_edit.png"> ic_edit.</p>
<p><img class="icon" src="../en/images/ic_select_all.png"> ic_select_all.</p>
<p><img class="icon" src="../en/images/ic_settings.png"> ic_settings.</p>
<p><img class="icon" src="../en/images/ic_subtitles.png"> ic_subtitles.</p>
+ <p><img class="icon" src="../en/images/ic_text_fields.png"> ic_text_fields.</p>
<p><img class="icon" src="../en/images/ic_vertical_align_bottom.png"> ic_vertical_align_bottom.</p>
<p><img class="icon" src="../en/images/ic_vertical_align_top.png"> ic_vertical_align_top.</p>
<p><img class="icon" src="../en/images/ic_web.png"> ic_web.</p>
<p><img class="icon" src="images/ic_chrome_reader_mode.png"> ic_chrome_reader_mode.</p>
<p><img class="icon" src="images/ic_close.png"> ic_close.</p>
<p><img class="icon" src="images/ic_create_new_folder.png"> ic_create_new_folder.</p>
+ <p><img class="icon" src="images/ic_devices_other.png"> ic_devices_other.</p>
<p><img class="icon" src="images/ic_delete.png"> ic_download.</p>
<p><img class="icon" src="images/ic_dns.png"> ic_dns.</p>
<p><img class="icon" src="images/ic_edit.png"> ic_edit.</p>
<p><img class="icon" src="images/ic_select_all.png"> ic_select_all.</p>
<p><img class="icon" src="images/ic_settings.png"> ic_settings.</p>
<p><img class="icon" src="images/ic_subtitles.png"> ic_subtitles.</p>
+ <p><img class="icon" src="images/ic_text_fields.png"> ic_text_fields.</p>
<p><img class="icon" src="images/ic_vertical_align_bottom.png"> ic_vertical_align_bottom.</p>
<p><img class="icon" src="images/ic_vertical_align_top.png"> ic_vertical_align_top.</p>
<p><img class="icon" src="images/ic_web.png"> ic_web.</p>
<p><img class="icon" src="../en/images/ic_chrome_reader_mode.png"> ic_chrome_reader_mode.</p>
<p><img class="icon" src="../en/images/ic_close.png"> ic_close.</p>
<p><img class="icon" src="../en/images/ic_create_new_folder.png"> ic_create_new_folder.</p>
+ <p><img class="icon" src="../en/images/ic_devices_other.png"> ic_devices_other.</p>
<p><img class="icon" src="../en/images/ic_delete.png"> ic_download.</p>
<p><img class="icon" src="../en/images/ic_dns.png"> ic_dns.</p>
<p><img class="icon" src="../en/images/ic_edit.png"> ic_edit.</p>
<p><img class="icon" src="../en/images/ic_select_all.png"> ic_select_all.</p>
<p><img class="icon" src="../en/images/ic_settings.png"> ic_settings.</p>
<p><img class="icon" src="../en/images/ic_subtitles.png"> ic_subtitles.</p>
+ <p><img class="icon" src="../en/images/ic_text_fields.png"> ic_text_fields.</p>
<p><img class="icon" src="../en/images/ic_vertical_align_bottom.png"> ic_vertical_align_bottom.</p>
<p><img class="icon" src="../en/images/ic_vertical_align_top.png"> ic_vertical_align_top.</p>
<p><img class="icon" src="../en/images/ic_web.png"> ic_web.</p>
<p><img class="icon" src="../en/images/ic_chrome_reader_mode.png"> ic_chrome_reader_mode.</p>
<p><img class="icon" src="../en/images/ic_close.png"> ic_close.</p>
<p><img class="icon" src="../en/images/ic_create_new_folder.png"> ic_create_new_folder.</p>
+ <p><img class="icon" src="../en/images/ic_devices_other.png"> ic_devices_other.</p>
<p><img class="icon" src="../en/images/ic_delete.png"> ic_download.</p>
<p><img class="icon" src="../en/images/ic_dns.png"> ic_dns.</p>
<p><img class="icon" src="../en/images/ic_edit.png"> ic_edit.</p>
<p><img class="icon" src="../en/images/ic_select_all.png"> ic_select_all.</p>
<p><img class="icon" src="../en/images/ic_settings.png"> ic_settings.</p>
<p><img class="icon" src="../en/images/ic_subtitles.png"> ic_subtitles.</p>
+ <p><img class="icon" src="../en/images/ic_text_fields.png"> ic_text_fields.</p>
<p><img class="icon" src="../en/images/ic_vertical_align_bottom.png"> ic_vertical_align_bottom.</p>
<p><img class="icon" src="../en/images/ic_vertical_align_top.png"> ic_vertical_align_top.</p>
<p><img class="icon" src="../en/images/ic_web.png"> ic_web.</p>
// Get the intent that started the activity.
final Intent launchingIntent = getIntent();
- // Extract the `databaseID`. The default value is `0`.
- int databaseId = launchingIntent.getIntExtra(DomainSettingsFragment.DATABASE_ID, 0);
+ // Extract the `databaseID`. The default value is `1`.
+ int databaseId = launchingIntent.getIntExtra(DomainSettingsFragment.DATABASE_ID, 1);
// Store `databaseId` in `argumentsBundle`.
Bundle argumentsBundle = new Bundle();
domainsDatabaseHelper = new DomainsDatabaseHelper(this, null, null, 0);
// Determine if we are in two pane mode. `domains_settings_linearlayout` is only populated if two panes are present.
- final boolean twoPaneMode = ((findViewById(R.id.domain_settings_linearlayout)) != null);
+ final boolean twoPaneMode = ((findViewById(R.id.domain_settings_scrollview)) != null);
// Initialize `domainsListView`.
domainsListView = (ListView) findViewById(R.id.domains_listview);
// Display the Domain Settings.
if (twoPaneMode) { // Display a fragment in two paned mode.
- // Highlight the selected domain.
- domainsListView.setItemChecked(position, true);
-
// Store `databaseId` in `argumentsBundle`.
Bundle argumentsBundle = new Bundle();
argumentsBundle.putInt(DomainSettingsFragment.DATABASE_ID, databaseId);
domainSettingsFragment.setArguments(argumentsBundle);
// Display `domainSettingsFragment`.
- getSupportFragmentManager().beginTransaction().replace(R.id.domain_settings_linearlayout, domainSettingsFragment).commit();
+ getSupportFragmentManager().beginTransaction().replace(R.id.domain_settings_scrollview, domainSettingsFragment).commit();
} else { // Load the second activity on smaller screens.
// Get a handle for the context.
Context context = view.getContext();
public class AboutTabFragment extends Fragment {
private int tabNumber;
- // AboutTabFragment.createTab stores the tab number in the bundle arguments so it can be referenced from onCreate().
+ // `AboutTabFragment.createTab` stores the tab number in the bundle arguments so it can be referenced from `onCreate()`.
public static AboutTabFragment createTab(int tab) {
Bundle thisTabArguments = new Bundle();
thisTabArguments.putInt("Tab", tab);
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- // Store the tab number in tabNumber.
+ // Store the tab number in `tabNumber`.
tabNumber = getArguments().getInt("Tab");
}
package com.stoutner.privacybrowser.fragments;
+import android.content.Context;
import android.database.Cursor;
import android.os.Bundle;
// We have to use `android.support.v4.app.Fragment` until minimum API >= 23. Otherwise we cannot call `getContext()`.
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
import android.widget.EditText;
+import android.widget.Spinner;
import com.stoutner.privacybrowser.R;
import com.stoutner.privacybrowser.helpers.DomainsDatabaseHelper;
// Inflate `domain_settings`. `false` does not attach it to the root `container`.
View domainSettingsView = inflater.inflate(R.layout.domain_settings, container, false);
+ // Get a handle for the `Context`.
+ Context context = getContext();
+
+ // Get handles for the views in the fragment.
+ EditText domainNameEditText = (EditText) domainSettingsView.findViewById(R.id.domain_settings_name_edittext);
+ Spinner userAgentSpinner = (Spinner) domainSettingsView.findViewById(R.id.domain_settings_user_agent_spinner);
+ Spinner fontSizeSpinner = (Spinner) domainSettingsView.findViewById(R.id.domain_settings_font_size_spinner);
+
// Initialize the database handler. `this` specifies the context. The two `nulls` do not specify the database name or a `CursorFactory`.
// The `0` specifies the database version, but that is ignored and set instead using a constant in `DomainsDatabaseHelper`.
DomainsDatabaseHelper domainsDatabaseHelper = new DomainsDatabaseHelper(getContext(), null, null, 0);
Cursor domainCursor = domainsDatabaseHelper.getCursorForId(databaseId);
domainCursor.moveToFirst();
- // Get handles for the `EditTexts`.
- EditText domainNameEditText = (EditText) domainSettingsView.findViewById(R.id.domain_settings_name_edittext);
+ // Save the `Cursor` entries as variables.
+ String domainNameString = domainCursor.getString(domainCursor.getColumnIndex(DomainsDatabaseHelper.DOMAIN));
+ int fontSizeInt = domainCursor.getInt(domainCursor.getColumnIndex(DomainsDatabaseHelper.FONT_SIZE));
+
+ // Create `ArrayAdapters` for the `Spinners`and their `entry values`.
+ ArrayAdapter<CharSequence> userAgentArrayAdapter = ArrayAdapter.createFromResource(context, R.array.user_agent_entries, android.R.layout.simple_spinner_item);
+ ArrayAdapter<CharSequence> userAgentEntryValuesArrayAdapter = ArrayAdapter.createFromResource(context, R.array.user_agent_entry_values, android.R.layout.simple_spinner_item);
+ ArrayAdapter<CharSequence> fontSizeArrayAdapter = ArrayAdapter.createFromResource(context, R.array.default_font_size_entries, android.R.layout.simple_spinner_item);
+ ArrayAdapter<CharSequence> fontSizeEntryValuesArrayAdapter = ArrayAdapter.createFromResource(context, R.array.default_font_size_entry_values, android.R.layout.simple_spinner_item);
+
+ // Set the drop down style for the `ArrayAdapters`.
+ userAgentArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ fontSizeArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+
+ // Set the `ArrayAdapters` for the `Spinners`.
+ userAgentSpinner.setAdapter(userAgentArrayAdapter);
+ fontSizeSpinner.setAdapter(fontSizeArrayAdapter);
+
+ //
+ // int userAgentArrayPosition =
+
+ // Set the selected font size.
+ int fontSizeArrayPosition = fontSizeEntryValuesArrayAdapter.getPosition(String.valueOf(fontSizeInt));
+ fontSizeSpinner.setSelection(fontSizeArrayPosition);
+
// Set the text from the database cursor.
- domainNameEditText.setText(domainCursor.getString(domainCursor.getColumnIndex(DomainsDatabaseHelper.DOMAIN)));
+ domainNameEditText.setText(domainNameString);
return domainSettingsView;
}
private static final String _ID = "_id";
public static final String DOMAIN = "domain";
+ public static final String FONT_SIZE = "fontsize";
+ private static final String ENABLE_JAVASCRIPT = "enablejavascript";
+ private static final String ENABLE_FIRST_PARTY_COOKIES = "enablefirstpartycookies";
+ private static final String ENABLE_THIRD_PARTY_COOKIES = "enablethirdpartycookies";
+ private static final String ENABLE_DOM_STORAGE = "enabledomstorage";
+ private static final String ENABLE_FORM_DATA = "enableformdata";
+ private static final String USER_AGENT_NAME = "useragentname";
+ private static final String USER_AGENT_STRING = "useragentstring";
+ private static final String CUSTOM_USER_AGENT_STRING = "customuseragent";
// Initialize the database. The lint warnings for the unused parameters are suppressed.
public DomainsDatabaseHelper(Context context, @SuppressWarnings("UnusedParameters") String name, SQLiteDatabase.CursorFactory cursorFactory, @SuppressWarnings("UnusedParameters") int version) {
// Setup the SQL string to create the `domains` table.
final String CREATE_DOMAINS_TABLE = "CREATE TABLE " + DOMAINS_TABLE + " (" +
_ID + " integer primary key, " +
- DOMAIN + " text);";
+ DOMAIN + " text, " +
+ ENABLE_JAVASCRIPT + " boolean, " +
+ ENABLE_FIRST_PARTY_COOKIES + " boolean, " +
+ ENABLE_THIRD_PARTY_COOKIES + " boolean, " +
+ ENABLE_DOM_STORAGE + " boolean, " +
+ ENABLE_FORM_DATA + " boolean, " +
+ USER_AGENT_NAME + " text, " +
+ USER_AGENT_STRING + " text, " +
+ CUSTOM_USER_AGENT_STRING + " text, " +
+ FONT_SIZE + " integer);";
// Create the `domains` table if it doesn't exist.
domainsDatabase.execSQL(CREATE_DOMAINS_TABLE);
// We need to store the domain data in a `ContentValues`.
ContentValues domainContentValues = new ContentValues();
- // ID is created automatically.
+ // Create entries for each field in the database. The ID is created automatically.
domainContentValues.put(DOMAIN, domainName);
+ domainContentValues.put(ENABLE_JAVASCRIPT, false);
+ domainContentValues.put(ENABLE_FIRST_PARTY_COOKIES, false);
+ domainContentValues.put(ENABLE_THIRD_PARTY_COOKIES, false);
+ domainContentValues.put(ENABLE_DOM_STORAGE, false);
+ domainContentValues.put(ENABLE_FORM_DATA, false);
+ domainContentValues.put(USER_AGENT_NAME, "Privacy Browser 1.0");
+ domainContentValues.put(USER_AGENT_STRING, "PrivacyBrowser/1.0");
+ domainContentValues.put(CUSTOM_USER_AGENT_STRING, "PrivacyBrowser/1.0");
+ domainContentValues.put(FONT_SIZE, "100");
// Get a writable database handle.
SQLiteDatabase domainsDatabase = this.getWritableDatabase();
-<!-- about.xml comes from the Android Material icon set, where it is called ic_info_outline. It is released under the Apache License 2.0. -->
+<!-- `about.xml` comes from the Android Material icon set, where it is called `ic_info_outline`. It is released under the Apache License 2.0. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
-<!-- add.xml comes from the Android Material icon set, where it is called ic_add.
- It is released under the Apache License 2.0. -->
+<!-- `add.xml` comes from the Android Material icon set, where it is called `ic_add`. It is released under the Apache License 2.0. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
-<!-- back.xml comes from the Android Material icon set, where it is called ic_arrow_back.
- It is released under the Apache License 2.0. -->
+<!-- `back.xml` comes from the Android Material icon set, where it is called `ic_arrow_back`. It is released under the Apache License 2.0. -->
<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true" not applying to API < 21. -->
<vector
-<!-- bookmarks.xml comes from the Android Material icon set, where it is called ic_bookmark_border.
- It is released under the Apache License 2.0. -->
+<!-- `bookmarks.xml` comes from the Android Material icon set, where it is called `ic_bookmark_border`. It is released under the Apache License 2.0. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
-<!-- close.xml comes from the Android Material icon set, where it is called ic_close.
- It is released under the Apache License 2.0. -->
+<!-- `close.xml` comes from the Android Material icon set, where it is called `ic_close`. It is released under the Apache License 2.0. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
-<!-- cookies_disabled.xml was created by Google and downloaded from https://materialdesignicons.com/icon/cookie.
- It is released under the Apache License 2.0. -->
+<!-- `cookies_disabled.xml` was created by Google and downloaded from <https://materialdesignicons.com/icon/cookie>. It is released under the Apache License 2.0. -->
<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true" not applying to API < 21. -->
<vector
-<!-- cookies_enabled.xml was created by Google and downloaded from https://materialdesignicons.com/icon/cookie.
- It is released under the Apache License 2.0. -->
+<!-- `cookies_enabled.xml` was created by Google and downloaded from <https://materialdesignicons.com/icon/cookie>. It is released under the Apache License 2.0. -->
<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true" not applying to API < 21. -->
<vector
-<!-- create_folder.xml comes from the Android Material icon set, where it is called ic_create_new_folder.
- It is released under the Apache License 2.0. -->
+<!-- `create_folder.xml` comes from the Android Material icon set, where it is called `ic_create_new_folder`. It is released under the Apache License 2.0. -->
<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true" not applying to API < 21. -->
<vector
-<!-- delete.xml comes from the Android Material icon set, where it is called ic_delete.
- It is released under the Apache License 2.0. -->
+<!-- `delete.xml` comes from the Android Material icon set, where it is called `ic_delete`. It is released under the Apache License 2.0. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
-<!-- dom_storage_disabled.xml comes from the Android Material icon set, where it is called ic_web.
- It is released under the Apache License 2.0. -->
+<!-- `dom_storage_disabled.xml` comes from the Android Material icon set, where it is called `ic_web`. It is released under the Apache License 2.0. -->
<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true" not applying to API < 21. -->
<vector
-<!-- dom_storage_enabled.xml comes from the Android Material icon set, where it is called ic_web.
- It is released under the Apache License 2.0. -->
+<!-- `dom_storage_enabled.xml` comes from the Android Material icon set, where it is called `ic_web`. It is released under the Apache License 2.0. -->
<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true" not applying to API < 21. -->
<vector
-<!-- dom_storage_ghosted.xml comes from the Android Material icon set, where it is called ic_web.
- It is released under the Apache License 2.0. -->
+<!-- `dom_storage_ghosted.xml` comes from the Android Material icon set, where it is called `ic_web`. It is released under the Apache License 2.0. -->
<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true" not applying to API < 21. -->
<vector
-<!-- domains.xml comes from the Android Material icon set, where it is called ic_import_contacts. It is released under the Apache License 2.0. -->
+<!-- `domains.xml` comes from the Android Material icon set, where it is called `ic_import_contacts`. It is released under the Apache License 2.0. -->
<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true" not applying to API < 21. -->
<vector
-<!-- downloads.xml comes from the Android Material icon set, where it is called ic_file_download.
- It is released under the Apache License 2.0. -->
+<!-- `downloads.xml` comes from the Android Material icon set, where it is called `ic_file_download`. It is released under the Apache License 2.0. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
-<!-- edit.xml comes from the Android Material icon set, where it is called ic_edit.
- It is released under the Apache License 2.0. -->
+<!-- `edit.xml` comes from the Android Material icon set, where it is called `ic_edit`. It is released under the Apache License 2.0. -->
<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true" not applying to API < 21. -->
<vector
-<!-- exit.xml comes from the Android Material icon set, where it is called ic_exit_to_app.
- It is released under the Apache License 2.0. -->
+<!-- `exit.xml` comes from the Android Material icon set, where it is called `ic_exit_to_app`. It is released under the Apache License 2.0. -->
<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true" not applying to API < 21. -->
<vector
-<!-- folder_dark_blue.xml.xml comes from the Android Material icon set, where it is called ic_folder.
- It is released under the Apache License 2.0. -->
+<!-- `folder_dark_blue.xml` comes from the Android Material icon set, where it is called `ic_folder`. It is released under the Apache License 2.0. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
-<!-- folder_gray.xml comes from the Android Material icon set, where it is called ic_folder.
- It is released under the Apache License 2.0. -->
+<!-- `folder_gray.xml` comes from the Android Material icon set, where it is called `ic_folder`. It is released under the Apache License 2.0. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
--- /dev/null
+<!-- `font_size.xml` comes from the Android Material icon set, where it is called `ic_text_fields`. It is released under the Apache License 2.0. -->
+
+<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true" not applying to API < 21. -->
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0"
+ android:autoMirrored="true"
+ tools:ignore="VectorRaster" >
+
+ <!-- We have to use a hard coded color code until API >= 21. Then we can use `@color`. -->
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M2.5,4v3h5v12h3L10.5,7h5L15.5,4h-13zM21.5,9h-9v3h3v7h3v-7h3L21.5,9z" />
+</vector>
\ No newline at end of file
-<!-- form_data_disabled.xml comes from the Android Material icon set, where it is called ic_subtitles.
- It is released under the Apache License 2.0. -->
+<!-- `form_data_disabled.xml` comes from the Android Material icon set, where it is called `ic_subtitles`. It is released under the Apache License 2.0. -->
<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true" not applying to API < 21. -->
<vector
-<!-- form_data_enabled.xml comes from the Android Material icon set, where it is called ic_subtitles.
- It is released under the Apache License 2.0. -->
+<!-- `form_data_enabled.xml` comes from the Android Material icon set, where it is called `ic_subtitles`. It is released under the Apache License 2.0. -->
<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true" not applying to API < 21. -->
<vector
-<!-- forward.xml comes from the Android Material icon set, where it is called ic_arrow_forward.
- It is released under the Apache License 2.0. -->
+<!-- `forward.xml` comes from the Android Material icon set, where it is called `ic_arrow_forward`. It is released under the Apache License 2.0. -->
<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true" not applying to API < 21. -->
<vector
-<!-- guide.xml comes from the Android Material icon set, where it is called ic_import_contacts. It is released under the Apache License 2.0. -->
+<!-- `guide.xml` comes from the Android Material icon set, where it is called `ic_import_contacts`. It is released under the Apache License 2.0. -->
<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true" not applying to API < 21. -->
<vector
-<!-- history.xml comes from the Android Material icon set, where it is called ic_list.
- It is released under the Apache License 2.0. -->
+<!-- `history.xml` comes from the Android Material icon set, where it is called `ic_list`. It is released under the Apache License 2.0. -->
<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true" not applying to API < 21. -->
<vector
-<!-- home.xml comes from the Android Material icon set, where it is called ic_home.
- It is released under the Apache License 2.0. -->
+<!-- `home.xml` comes from the Android Material icon set, where it is called `ic_home`. It is released under the Apache License 2.0. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
-<!-- javascript_enabled.xml is derived from ic_security and ic_language, which are part of the Android Material icon set.
- They are released under the Apache License 2.0. Modifications were made by Soren Stoutner <soren@stoutner.com> in 2016
- and are released under the GPLv3+ license. -->
+<!-- `javascript_enabled.xml` is derived from `ic_security` and `ic_language`, which are part of the Android Material icon set. They are released under the Apache License 2.0.
+ Modifications were made by Soren Stoutner <soren@stoutner.com> in 2016 and are released under the GPLv3+ license. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
-<!-- move_bookmark_down_disabled.xml comes from the Android Material icon set, where it is called ic_vertical_align_bottom.
- It is released under the Apache License 2.0. -->
+<!-- `move_bookmark_down_disabled.xml` comes from the Android Material icon set, where it is called `ic_vertical_align_bottom`. It is released under the Apache License 2.0. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
-<!-- move_bookmark_down_enabled.xml comes from the Android Material icon set, where it is called ic_vertical_align_bottom.
- It is released under the Apache License 2.0. -->
+<!-- `move_bookmark_down_enabled.xml` comes from the Android Material icon set, where it is called `ic_vertical_align_bottom`. It is released under the Apache License 2.0. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
-<!-- move_bookmark_up_disabled.xml comes from the Android Material icon set, where it is called ic_vertical_align_top.
- It is released under the Apache License 2.0. -->
+<!-- `move_bookmark_up_disabled.xml` comes from the Android Material icon set, where it is called `ic_vertical_align_top`. It is released under the Apache License 2.0. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
-<!-- move_bookmark_up_enabled.xml comes from the Android Material icon set, where it is called ic_vertical_align_top.
- It is released under the Apache License 2.0. -->
+<!-- `move_bookmark_up_enabled.xml` comes from the Android Material icon set, where it is called `ic_vertical_align_top`. It is released under the Apache License 2.0. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
-<!-- move_to_folder.xml comes from the Android Material icon set, where it is called ic_folder_special.
- It is released under the Apache License 2.0. -->
+<!-- `move_to_folder.xml` comes from the Android Material icon set, where it is called `ic_folder_special`. It is released under the Apache License 2.0. -->
<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true" not applying to API < 21. -->
<vector
-<!-- next.xml comes from the Android Material icon set, where it is called ic_expand_more.
- It is released under the Apache License 2.0. -->
+<!-- `next.xml` comes from the Android Material icon set, where it is called `ic_expand_more`. It is released under the Apache License 2.0. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
-<!-- previous.xml comes from the Android Material icon set, where it is called ic_expand_less.
- It is released under the Apache License 2.0. -->
+<!-- `previous.xml` comes from the Android Material icon set, where it is called `ic_expand_less`. It is released under the Apache License 2.0. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
-<!-- privacy_mode.xml is derived from ic_security and ic_language, which are part of the Android Material icon set.
- They are released under the Apache License 2.0. Modifications were made by Soren Stoutner <soren@stoutner.com> in 2016.
- and are released under the GPLv3+ license. -->
+<!-- `privacy_mode.xml` is derived from `ic_security` and `ic_language`, which are part of the Android Material icon set. They are released under the Apache License 2.0.
+ Modifications were made by Soren Stoutner <soren@stoutner.com> in 2016 and are released under the GPLv3+ license. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
-<!-- select_all.xml comes from the Android Material icon set, where it is called ic_select_all.
- It is released under the Apache License 2.0. -->
+<!-- `select_all.xml` comes from the Android Material icon set, where it is called `ic_select_all`. It is released under the Apache License 2.0. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
-<!-- settings.xml comes from the Android Material icon set, where it is called ic_settings.
- It is released under the Apache License 2.0. -->
+<!-- `settings.xml` comes from the Android Material icon set, where it is called `ic_settings`. It is released under the Apache License 2.0. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
--- /dev/null
+<!-- `move_to_folder.xml` comes from the Android Material icon set, where it is called `ic_folder_special`. It is released under the Apache License 2.0. -->
+
+<!-- `tools:ignore="VectorRaster"` removes the lint warning about `android:autoMirrored="true" not applying to API < 21. -->
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0"
+ android:autoMirrored="true"
+ tools:ignore="VectorRaster" >
+
+ <!-- We have to use a hard coded color code until API >= 21. Then we can use `@color`. -->
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M3,6h18L21,4L3,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h4v-2L3,18L3,6zM13,12L9,12v1.78c-0.61,0.55 -1,1.33 -1,2.22s0.39,1.67 1,2.22L9,20h4v-1.78c0.61,-0.55 1,-1.34 1,-2.22s-0.39,-1.67 -1,-2.22L13,12zM11,17.5c-0.83,0 -1.5,-0.67 -1.5,-1.5s0.67,-1.5 1.5,-1.5 1.5,0.67 1.5,1.5 -0.67,1.5 -1.5,1.5zM22,8h-6c-0.5,0 -1,0.5 -1,1v10c0,0.5 0.5,1 1,1h6c0.5,0 1,-0.5 1,-1L23,9c0,-0.5 -0.5,-1 -1,-1zM21,18h-4v-8h4v8z"/>
+</vector>
-<!-- warning.xml is derived from ic_security and ic_language, which are part of the Android Material icon set.
- They are released under the Apache License 2.0. Modifications were made by Soren Stoutner <soren@stoutner.com> in 2016.
- and are released under the GPLv3+ license. -->
+<!-- `warning.xml` is derived from `ic_security` and `ic_language`, which are part of the Android Material icon set. They are released under the Apache License 2.0.
+ Modifications were made by Soren Stoutner <soren@stoutner.com> in 2016 and are released under the GPLv3+ license. -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/domains_listview"
android:layout_height="match_parent"
android:layout_width="0dp"
- android:layout_weight="1"
+ android:layout_weight="2"
android:choiceMode="singleChoice"
android:divider="@color/white"
android:dividerHeight="0dp" />
- <LinearLayout
- android:id="@+id/domain_settings_linearlayout"
+ <ScrollView
+ android:id="@+id/domain_settings_scrollview"
android:layout_height="match_parent"
android:layout_width="0dp"
- android:layout_weight="3"
- android:orientation="horizontal" />
+ android:layout_weight="3" />
</LinearLayout>
\ No newline at end of file
You should have received a copy of the GNU General Public License
along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
-<LinearLayout
+<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_height="match_parent"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:orientation="horizontal" >
+ android:focusable="true"
+ android:focusableInTouchMode="true"
+ android:descendantFocusability="beforeDescendants" >
- <!-- Labels `LinearLayout`. -->
<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:orientation="vertical" >
+ android:layout_width="match_parent"
+ android:layout_margin="12dp"
+ android:orientation="vertical"
+ android:divider="?android:attr/dividerVertical"
+ android:showDividers="middle" >
- <TextView
+ <!-- Domain name. -->
+ <LinearLayout
android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:text="@string/domain_name"
- android:labelFor="@+id/domain_settings_name_edittext"/>
- </LinearLayout>
+ android:layout_width="match_parent"
+ android:orientation="horizontal" >
- <!-- Data `LinearLayout`. -->
- <LinearLayout
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:orientation="vertical" >
+ <ImageView
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginBottom="26dp"
+ android:layout_gravity="bottom"
+ android:src="@drawable/domains"
+ android:tint="@color/blue_800"
+ tools:ignore="contentDescription" />
+
+ <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
+ <android.support.design.widget.TextInputLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_marginStart="6dp"
+ android:layout_marginBottom="14dp" >
- <!-- `android:inputType="textUri"` disables spell check in the `EditText`. -->
- <EditText
- android:id="@id/domain_settings_name_edittext"
- android:layout_width="wrap_content"
+ <!-- `android:inputType="textUri"` disables spell check in the `EditText`. -->
+ <android.support.design.widget.TextInputEditText
+ android:id="@+id/domain_settings_name_edittext"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:hint="@string/domain_name"
+ android:inputType="textUri" />
+ </android.support.design.widget.TextInputLayout>
+ </LinearLayout>
+
+ <!-- JavaScript. -->
+ <LinearLayout
android:layout_height="wrap_content"
- android:inputType="textUri" />
- </LinearLayout>
+ android:layout_width="match_parent"
+ android:orientation="horizontal" >
+
+ <ImageView
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:src="@drawable/privacy_mode"
+ tools:ignore="contentDescription" />
+
+ <Switch
+ android:id="@+id/domain_settings_javascript_switch"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_marginStart="8dp"
+ android:layout_marginTop="14dp"
+ android:layout_marginBottom="14dp"
+ android:text="@string/javascript_enabled"
+ android:textSize="18sp" />
+ </LinearLayout>
+
+ <!-- First-Party Cookies. -->
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal" >
+
+ <ImageView
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginTop="1dp"
+ android:layout_gravity="center_vertical"
+ android:src="@drawable/cookies_enabled"
+ android:tint="@color/blue_800"
+ tools:ignore="contentDescription" />
+
+ <Switch
+ android:id="@+id/domain_settings_first_party_cookies_switch"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_marginStart="8dp"
+ android:layout_marginTop="14dp"
+ android:layout_marginBottom="14dp"
+ android:text="@string/first_party_cookies_enabled"
+ android:textSize="18sp" />
+ </LinearLayout>
+
+ <!-- Third-Party Cookies. -->
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal" >
+
+ <ImageView
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginTop="1dp"
+ android:layout_gravity="center_vertical"
+ android:src="@drawable/cookies_enabled"
+ android:tint="@color/blue_800"
+ tools:ignore="contentDescription" />
+
+ <Switch
+ android:id="@+id/domain_settings_third_party_cookies_switch"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_marginStart="8dp"
+ android:layout_marginTop="14dp"
+ android:layout_marginBottom="14dp"
+ android:text="@string/third_party_cookies_enabled"
+ android:textSize="18sp" />
+ </LinearLayout>
-</LinearLayout>
\ No newline at end of file
+ <!-- DOM Storage. -->
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal" >
+
+ <ImageView
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginTop="1dp"
+ android:layout_gravity="center_vertical"
+ android:src="@drawable/dom_storage_enabled"
+ android:tint="@color/blue_800"
+ tools:ignore="contentDescription" />
+
+ <Switch
+ android:id="@+id/domain_settings_dom_storage_switch"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_marginStart="8dp"
+ android:layout_marginTop="14dp"
+ android:layout_marginBottom="14dp"
+ android:text="@string/dom_storage_enabled"
+ android:textSize="18sp" />
+ </LinearLayout>
+
+ <!-- Form Data. -->
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginTop="1dp"
+ android:layout_gravity="center_vertical"
+ android:src="@drawable/form_data_enabled"
+ android:tint="@color/blue_800"
+ tools:ignore="contentDescription" />
+
+ <Switch
+ android:id="@+id/domain_settings_form_data_switch"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_marginStart="8dp"
+ android:layout_marginTop="14dp"
+ android:layout_marginBottom="14dp"
+ android:text="@string/form_data_enabled"
+ android:textSize="18sp" />
+ </LinearLayout>
+
+ <!-- User Agent. -->
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginTop="1dp"
+ android:layout_gravity="center_vertical"
+ android:src="@drawable/user_agent"
+ android:tint="@color/blue_800"
+ android:contentDescription="@string/user_agent" />
+
+ <Spinner
+ android:id="@+id/domain_settings_user_agent_spinner"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_marginTop="14dp"
+ android:layout_marginBottom="14dp" />
+ </LinearLayout>
+
+ <!-- Font Size. -->
+ <!-- We need to add an extra `android:layout_marginBottom="14dp"` to the last `LinearLayout` or the bottom of the `ScrollView` gets cutoff if API 25. -->
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal"
+ android:layout_marginBottom="14dp" >
+
+ <ImageView
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginTop="1dp"
+ android:layout_gravity="center_vertical"
+ android:src="@drawable/font_size"
+ android:tint="@color/blue_800"
+ android:contentDescription="@string/font_size" />
+
+ <Spinner
+ android:id="@+id/domain_settings_font_size_spinner"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_marginTop="14dp"
+ android:layout_marginBottom="14dp"/>
+ </LinearLayout>
+ </LinearLayout>
+</ScrollView>
\ No newline at end of file
xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
- android:layout_width="match_parent" >
+ android:layout_width="match_parent"
+ tools:context=".activities.MainWebViewActivity" >
<!-- `RelativeLayout` is used instead of a `LinearLayout` because `supportAppBar` does not let `android:layout_weight="1"` cause `urlTextBox` to fill all the available space. -->
<RelativeLayout
<string name="domain_settings">Domain Settings</string>
<string name="add_domain">Add Domain</string>
<string name="add">Add</string>
- <string name="domain_name">Domain Name</string>
+ <string name="domain_name">Domain name</string>
<!-- Guide. -->
<string name="privacy_browser_guide">Privacy Browser Guide</string>
<style name="PrivacyBrowser" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowTranslucentStatus">true</item>
<item name="colorAccent">@color/blue_700</item>
+ <item name="android:textColorHighlight">@color/blue_200</item>
</style>
<!-- `colorPrimaryDark` goes behind the status bar, which is then darkened by the overlay.
`windowActionModeOverlay` makes the contextual app bar cover the support app bar. -->
<style name="PrivacyBrowser.SecondaryActivity">
<item name="colorPrimaryDark">@color/blue_700</item>
+ <item name="android:textColorHighlight">@color/blue_200</item>
<item name="windowActionModeOverlay">true</item>
<item name="android:actionModeBackground">@color/blue_700</item>
<item name="actionBarPopupTheme">@style/LightPopupOverlay</item>
+ <item name="android:spinnerItemStyle">@style/spinnerItemStyle</item>
+ <item name="android:spinnerDropDownItemStyle">@style/spinnerDropDownItemStyle</item>
</style>
<!-- `colorPrimaryDark` is the color of the status bar. -->
<style name="LightAlertDialog" parent="Theme.AppCompat.Light.Dialog.Alert" >
<item name="colorAccent">@color/blue_700</item>
</style>
+
+ <style name="spinnerItemStyle" >
+ <item name="android:paddingStart">8dp</item>
+ <item name="android:textColor">@color/black</item>
+ <item name="android:textSize">18sp</item>
+ </style>
+
+ <style name="spinnerDropDownItemStyle" >
+ <item name="android:paddingStart">16dp</item>
+ <item name="android:paddingEnd">16dp</item>
+ <item name="android:paddingTop">8dp</item>
+ <item name="android:paddingBottom">8dp</item>
+ <item name="android:textColor">@color/black</item>
+ <item name="android:textSize">18sp</item>
+ </style>
</resources>
\ No newline at end of file