mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-01-23 14:27:46 -05:00
[app] unify preferences.xml from build flavors
previously basic and main source set had a different preferences.xml which we needed to keep in sync manually. When we forgot to do this, this caused crash bugs. Hence, this commit unifies both files into one and uses a boolean resource to hide full preferences in basic flavor.
This commit is contained in:
committed by
Hans-Christoph Steiner
parent
ca795fc433
commit
c8482ca2dd
4
app/src/basic/res/values/attrs.xml
Normal file
4
app/src/basic/res/values/attrs.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<bool name="pref_visible_only_in_full">false</bool>
|
||||
</resources>
|
||||
@@ -1,214 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<PreferenceScreen
|
||||
android:title="@string/about_title"
|
||||
android:key="pref_about" />
|
||||
|
||||
<PreferenceCategory android:title="@string/preference_category__my_apps">
|
||||
<PreferenceScreen android:title="@string/preference_manage_installed_apps">
|
||||
<intent
|
||||
android:action="android.intent.action.MAIN"
|
||||
android:targetPackage="@string/applicationId"
|
||||
android:targetClass="org.fdroid.fdroid.views.installed.InstalledAppsActivity" />
|
||||
</PreferenceScreen>
|
||||
<PreferenceScreen
|
||||
android:title="@string/menu_manage"
|
||||
android:summary="@string/repositories_summary">
|
||||
<intent
|
||||
android:action="android.intent.action.MAIN"
|
||||
android:targetPackage="@string/applicationId"
|
||||
android:targetClass="org.fdroid.fdroid.views.repos.ManageReposActivity" />
|
||||
</PreferenceScreen>
|
||||
<PreferenceScreen
|
||||
android:key="installHistory"
|
||||
android:visible="false"
|
||||
android:title="@string/install_history"
|
||||
android:summary="@string/install_history_summary">
|
||||
<intent
|
||||
android:action="android.intent.action.MAIN"
|
||||
android:targetPackage="@string/applicationId"
|
||||
android:targetClass="org.fdroid.fdroid.views.InstallHistoryActivity" />
|
||||
</PreferenceScreen>
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory android:title="@string/updates">
|
||||
<org.fdroid.fdroid.views.LiveSeekBarPreference
|
||||
android:key="overWifi"
|
||||
android:title="@string/over_wifi"
|
||||
android:defaultValue="@integer/defaultOverWifi"
|
||||
android:layout="@layout/preference_seekbar" />
|
||||
<org.fdroid.fdroid.views.LiveSeekBarPreference
|
||||
android:key="overData"
|
||||
android:title="@string/over_data"
|
||||
android:defaultValue="@integer/defaultOverData"
|
||||
android:layout="@layout/preference_seekbar" />
|
||||
<SwitchPreferenceCompat
|
||||
android:title="@string/update_auto_download"
|
||||
android:summary="@string/update_auto_download_summary"
|
||||
android:key="updateAutoDownload" />
|
||||
<org.fdroid.fdroid.views.LiveSeekBarPreference
|
||||
android:key="updateIntervalSeekBarPosition"
|
||||
android:title="@string/update_interval"
|
||||
android:defaultValue="@integer/defaultUpdateInterval"
|
||||
android:layout="@layout/preference_seekbar" />
|
||||
<SwitchPreferenceCompat
|
||||
android:title="@string/notify"
|
||||
android:defaultValue="true"
|
||||
android:key="updateNotify" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/display"
|
||||
android:key="pref_category_display">
|
||||
<ListPreference
|
||||
android:title="@string/pref_language"
|
||||
android:key="language" />
|
||||
<ListPreference
|
||||
android:title="@string/theme"
|
||||
android:key="theme"
|
||||
android:defaultValue="@string/defaultTheme"
|
||||
android:entries="@array/themeNames"
|
||||
android:entryValues="@array/themeValues" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="usePureBlackDarkTheme"
|
||||
android:summary="@string/use_pure_black_dark_theme_summary"
|
||||
android:title="@string/use_pure_black_dark_theme" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/appcompatibility"
|
||||
android:key="pref_category_appcompatibility">
|
||||
<SwitchPreferenceCompat
|
||||
android:title="@string/show_incompat_versions"
|
||||
android:defaultValue="false"
|
||||
android:key="incompatibleVersions" />
|
||||
<MultiSelectListPreference
|
||||
android:title="@string/show_anti_feature_apps"
|
||||
android:defaultValue="@array/antifeaturesValuesDefault"
|
||||
android:key="showAntiFeatures"
|
||||
android:entries="@array/antifeaturesNames"
|
||||
android:entryValues="@array/antifeaturesValues" />
|
||||
<SwitchPreference
|
||||
android:title="@string/force_touch_apps"
|
||||
android:defaultValue="false"
|
||||
android:key="ignoreTouchscreen" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory android:title="@string/proxy">
|
||||
<SwitchPreferenceCompat
|
||||
android:key="useTor"
|
||||
android:summary="@string/useTorSummary"
|
||||
android:title="@string/useTor" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="enableProxy"
|
||||
android:title="@string/enable_proxy_title"
|
||||
android:summary="@string/enable_proxy_summary" />
|
||||
<EditTextPreference
|
||||
android:key="proxyHost"
|
||||
android:title="@string/proxy_host"
|
||||
android:summary="@string/proxy_host_summary"
|
||||
android:dependency="enableProxy" />
|
||||
<EditTextPreference
|
||||
android:key="proxyPort"
|
||||
android:title="@string/proxy_port"
|
||||
android:summary="@string/proxy_port_summary"
|
||||
android:dependency="enableProxy" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="pref_category_privacy"
|
||||
android:title="@string/privacy">
|
||||
<SwitchPreferenceCompat
|
||||
android:key="promptToSendCrashReports"
|
||||
android:title="@string/prompt_to_send_crash_reports"
|
||||
android:summary="@string/prompt_to_send_crash_reports_summary"
|
||||
android:defaultValue="true" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="preventScreenshots"
|
||||
android:summary="@string/preventScreenshots_summary"
|
||||
android:title="@string/preventScreenshots_title" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/other"
|
||||
android:key="pref_category_other">
|
||||
<ListPreference
|
||||
android:title="@string/cache_downloaded"
|
||||
android:key="keepCacheFor"
|
||||
android:defaultValue="86400000"
|
||||
android:entries="@array/keepCacheNames"
|
||||
android:entryValues="@array/keepCacheValues" />
|
||||
<SwitchPreferenceCompat
|
||||
android:title="@string/expert"
|
||||
android:defaultValue="false"
|
||||
android:key="expert" />
|
||||
<PreferenceCategory
|
||||
android:key="pref_category_expert"
|
||||
android:dependency="expert"
|
||||
android:title="@string/expert">
|
||||
<SwitchPreferenceCompat
|
||||
android:key="unstableUpdates"
|
||||
android:title="@string/unstable_updates"
|
||||
android:summary="@string/unstable_updates_summary"
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert" />
|
||||
<SwitchPreferenceCompat
|
||||
android:key="keepInstallHistory"
|
||||
android:title="@string/keep_install_history"
|
||||
android:summary="@string/keep_install_history_summary"
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert" />
|
||||
<SwitchPreferenceCompat
|
||||
android:key="sendToFdroidMetrics"
|
||||
android:title="@string/send_to_fdroid_metrics"
|
||||
android:summary="@string/send_to_fdroid_metrics_summary"
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert" />
|
||||
<PreferenceScreen
|
||||
android:key="ipfsGateways"
|
||||
android:summary="@string/ipfsgw_summary_disabled"
|
||||
android:title="@string/ipfsgw_title"
|
||||
android:dependency="expert" >
|
||||
<intent
|
||||
android:action="android.intent.action.MAIN"
|
||||
android:targetClass="org.fdroid.fdroid.views.IpfsGatewaySettingsActivity"
|
||||
android:targetPackage="@string/applicationId" />
|
||||
</PreferenceScreen>
|
||||
<SwitchPreferenceCompat
|
||||
android:key="hideAllNotifications"
|
||||
android:title="@string/hide_all_notifications"
|
||||
android:summary="@string/hide_all_notifications_summary"
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert" />
|
||||
<SwitchPreferenceCompat
|
||||
android:key="sendVersionAndUUIDToServers"
|
||||
android:title="@string/send_version_and_uuid"
|
||||
android:summary="@string/send_version_and_uuid_summary"
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert" />
|
||||
<SwitchPreferenceCompat
|
||||
android:key="forceOldIndex"
|
||||
android:title="@string/force_old_index"
|
||||
android:summary="@string/force_old_index_summary"
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert"
|
||||
android:key="forceOldInstaller"
|
||||
android:summary="@string/force_old_installer_summary"
|
||||
android:title="@string/force_old_installer_title" />
|
||||
<SwitchPreferenceCompat
|
||||
android:title="@string/system_installer"
|
||||
android:defaultValue="false"
|
||||
android:key="privilegedInstaller"
|
||||
android:persistent="false"
|
||||
android:dependency="expert" />
|
||||
</PreferenceCategory>
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<bool name="pref_visible_only_in_full">true</bool>
|
||||
|
||||
<integer name="unhidePin">1337</integer>
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--
|
||||
IMPORTANT: If you change anything here, also check if the same change needs to be made in
|
||||
for the basic flavor: basic/res/xml/preferences.xml
|
||||
-->
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<PreferenceScreen
|
||||
android:key="pref_about"
|
||||
@@ -89,18 +86,21 @@
|
||||
android:key="incompatibleVersions"
|
||||
android:title="@string/show_incompat_versions" />
|
||||
<MultiSelectListPreference
|
||||
android:title="@string/show_anti_feature_apps"
|
||||
android:defaultValue="@array/antifeaturesValuesDefault"
|
||||
android:key="showAntiFeatures"
|
||||
android:entries="@array/antifeaturesNames"
|
||||
android:entryValues="@array/antifeaturesValues" />
|
||||
android:entryValues="@array/antifeaturesValues"
|
||||
android:key="showAntiFeatures"
|
||||
android:title="@string/show_anti_feature_apps" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="ignoreTouchscreen"
|
||||
android:title="@string/force_touch_apps" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory android:title="@string/local_repo">
|
||||
<!-- only visible in full flavor -->
|
||||
<PreferenceCategory
|
||||
android:title="@string/local_repo"
|
||||
app:isPreferenceVisible="@bool/pref_visible_only_in_full">
|
||||
<EditTextPreference
|
||||
android:key="localRepoName"
|
||||
android:title="@string/local_repo_name" />
|
||||
@@ -147,15 +147,19 @@
|
||||
android:summary="@string/preventScreenshots_summary"
|
||||
android:title="@string/preventScreenshots_title" />
|
||||
|
||||
<!-- only visible in full flavor -->
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="hideOnLongPressSearch"
|
||||
android:summary="@string/hide_on_long_search_press_summary"
|
||||
android:title="@string/hide_on_long_search_press_title" />
|
||||
android:title="@string/hide_on_long_search_press_title"
|
||||
app:isPreferenceVisible="@bool/pref_visible_only_in_full" />
|
||||
|
||||
<!-- only visible in full flavor -->
|
||||
<PreferenceScreen
|
||||
android:summary="@string/panic_settings_summary"
|
||||
android:title="@string/panic_settings">
|
||||
android:title="@string/panic_settings"
|
||||
app:isPreferenceVisible="@bool/pref_visible_only_in_full">
|
||||
<intent
|
||||
android:action="android.intent.action.MAIN"
|
||||
android:targetClass="org.fdroid.fdroid.panic.PanicPreferencesActivity"
|
||||
@@ -176,68 +180,68 @@
|
||||
android:defaultValue="false"
|
||||
android:key="expert"
|
||||
android:title="@string/expert" />
|
||||
<PreferenceCategory
|
||||
android:key="pref_category_expert"
|
||||
android:dependency="expert"
|
||||
android:title="@string/expert">
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
<PreferenceCategory
|
||||
android:dependency="expert"
|
||||
android:key="unstableUpdates"
|
||||
android:summary="@string/unstable_updates_summary"
|
||||
android:title="@string/unstable_updates" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert"
|
||||
android:key="keepInstallHistory"
|
||||
android:summary="@string/keep_install_history_summary"
|
||||
android:title="@string/keep_install_history" />
|
||||
<SwitchPreferenceCompat
|
||||
android:key="sendToFdroidMetrics"
|
||||
android:title="@string/send_to_fdroid_metrics"
|
||||
android:summary="@string/send_to_fdroid_metrics_summary"
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert" />
|
||||
<PreferenceScreen
|
||||
android:key="ipfsGateways"
|
||||
android:summary="@string/ipfsgw_summary_disabled"
|
||||
android:title="@string/ipfsgw_title"
|
||||
android:dependency="expert" >
|
||||
<intent
|
||||
android:action="android.intent.action.MAIN"
|
||||
android:targetClass="org.fdroid.fdroid.views.IpfsGatewaySettingsActivity"
|
||||
android:targetPackage="@string/applicationId" />
|
||||
</PreferenceScreen>
|
||||
<SwitchPreferenceCompat
|
||||
android:key="hideAllNotifications"
|
||||
android:title="@string/hide_all_notifications"
|
||||
android:summary="@string/hide_all_notifications_summary"
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert"
|
||||
android:key="sendVersionAndUUIDToServers"
|
||||
android:summary="@string/send_version_and_uuid_summary"
|
||||
android:title="@string/send_version_and_uuid" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert"
|
||||
android:key="forceOldIndex"
|
||||
android:summary="@string/force_old_index_summary"
|
||||
android:title="@string/force_old_index" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert"
|
||||
android:key="forceOldInstaller"
|
||||
android:summary="@string/force_old_installer_summary"
|
||||
android:title="@string/force_old_installer_title" />
|
||||
<SwitchPreferenceCompat
|
||||
android:dependency="expert"
|
||||
android:key="privilegedInstaller"
|
||||
android:persistent="false"
|
||||
android:title="@string/system_installer" />
|
||||
</PreferenceCategory>
|
||||
android:key="pref_category_expert"
|
||||
android:title="@string/expert">
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert"
|
||||
android:key="unstableUpdates"
|
||||
android:summary="@string/unstable_updates_summary"
|
||||
android:title="@string/unstable_updates" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert"
|
||||
android:key="keepInstallHistory"
|
||||
android:summary="@string/keep_install_history_summary"
|
||||
android:title="@string/keep_install_history" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert"
|
||||
android:key="sendToFdroidMetrics"
|
||||
android:summary="@string/send_to_fdroid_metrics_summary"
|
||||
android:title="@string/send_to_fdroid_metrics" />
|
||||
<PreferenceScreen
|
||||
android:dependency="expert"
|
||||
android:key="ipfsGateways"
|
||||
android:summary="@string/ipfsgw_summary_disabled"
|
||||
android:title="@string/ipfsgw_title">
|
||||
<intent
|
||||
android:action="android.intent.action.MAIN"
|
||||
android:targetClass="org.fdroid.fdroid.views.IpfsGatewaySettingsActivity"
|
||||
android:targetPackage="@string/applicationId" />
|
||||
</PreferenceScreen>
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert"
|
||||
android:key="hideAllNotifications"
|
||||
android:summary="@string/hide_all_notifications_summary"
|
||||
android:title="@string/hide_all_notifications" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert"
|
||||
android:key="sendVersionAndUUIDToServers"
|
||||
android:summary="@string/send_version_and_uuid_summary"
|
||||
android:title="@string/send_version_and_uuid" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert"
|
||||
android:key="forceOldIndex"
|
||||
android:summary="@string/force_old_index_summary"
|
||||
android:title="@string/force_old_index" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:dependency="expert"
|
||||
android:key="forceOldInstaller"
|
||||
android:summary="@string/force_old_installer_summary"
|
||||
android:title="@string/force_old_installer_title" />
|
||||
<SwitchPreferenceCompat
|
||||
android:dependency="expert"
|
||||
android:key="privilegedInstaller"
|
||||
android:persistent="false"
|
||||
android:title="@string/system_installer" />
|
||||
</PreferenceCategory>
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
||||
|
||||
Reference in New Issue
Block a user