Add controls for form data. Fixes https://redmine.stoutner.com/issues/29
[PrivacyBrowser.git] / app / src / main / res / xml / preferences.xml
index 747778e776380769b8a0e87b450283e20ccdebff..702db50eb3b5ad2b88cb8235f8c796603f4b4046 100644 (file)
@@ -20,8 +20,8 @@
 
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
     <PreferenceCategory
-        android:key="privacy_settings"
-        android:title="@string/privacy_settings" >
+        android:key="privacy"
+        android:title="@string/privacy" >
 
         <SwitchPreference
             android:key="javascript_enabled"
             android:title="@string/dom_storage_preference"
             android:summary="@string/dom_storage_preference_summary"
             android:defaultValue="false" />
+
+        <SwitchPreference
+            android:key="save_form_data_enabled"
+            android:title="@string/save_form_data_preference"
+            android:summary="@string/save_form_data_preference_summary"
+            android:defaultValue="false" />
+
+        <ListPreference
+            android:key="user_agent"
+            android:title="@string/user_agent"
+            android:entries="@array/user_agent_entries"
+            android:entryValues="@array/user_agent_entry_values"
+            android:defaultValue="Default user agent" />
+
+        <!-- android:inputType="textVisiblePassword" sets the keyboard to have a dedicated number row.
+          android:imeOptions="flagNoExtractUi" is not set because with the dedicated number row there often isn't room to see the EditText in landscape orientation. -->
+        <EditTextPreference
+            android:key="custom_user_agent"
+            android:title="@string/custom_user_agent"
+            android:defaultValue="PrivacyBrowser/1.0"
+            android:inputType="textVisiblePassword|textMultiLine" />
+
+    </PreferenceCategory>
+
+    <PreferenceCategory
+        android:key="search"
+        android:title="@string/search">
+
+        <ListPreference
+            android:key="javascript_disabled_search"
+            android:title="@string/javascript_disabled_search"
+            android:entries="@array/javascript_disabled_search_entries"
+            android:entryValues="@array/javascript_disabled_search_entry_values"
+            android:defaultValue="https://duckduckgo.com/html/?q=" />
+
+        <!-- android:imeOptions="flagNoExtractUi" is not set because with the the length of the title of the dialog box
+          there often isn't enough space to see the EditText in landscape orientation.
+          android:singleLine="true" is not specified because it is the EditTextPreference default. -->
+        <EditTextPreference
+            android:key="javascript_disabled_search_custom_url"
+            android:title="@string/javascript_disabled_search_custom_url"
+            android:defaultValue=""
+            android:inputType="textUri" />
+
+        <ListPreference
+            android:key="javascript_enabled_search"
+            android:title="@string/javascript_enabled_search"
+            android:entries="@array/javascript_enabled_search_entries"
+            android:entryValues="@array/javascript_enabled_search_entry_values"
+            android:defaultValue="https://duckduckgo.com/?q=" />
+
+        <!-- android:imeOptions="flagNoExtractUi" is not set because with the the length of the title of the dialog box
+          there often isn't enough space to see the EditText in landscape orientation.
+          android:singleLine="true" is not specified because it is the EditTextPreference default. -->
+        <EditTextPreference
+            android:key="javascript_enabled_search_custom_url"
+            android:title="@string/javascript_enabled_search_custom_url"
+            android:defaultValue=""
+            android:inputType="textUri" />
     </PreferenceCategory>
 
     <PreferenceCategory
-        android:key="general_settings"
-        android:title="@string/general_settings" >
+        android:key="general"
+        android:title="@string/general" >
 
+        <!-- android:imeOptions="flagNoExtractUi" is not set because in special character mode there often isn't enough space to see the EditText in landscape orientation.
+          android:singleLine="true" is not specified because it is the EditTextPreference default. -->
         <EditTextPreference
             android:key="homepage"
             android:title="@string/homepage_preference"
             android:defaultValue="https://www.duckduckgo.com"
-            android:inputType="textUri"
-            android:singleLine="true" />
+            android:inputType="textUri" />
 
         <SwitchPreference
             android:key="swipe_to_refresh_enabled"