switch to com.android.support:preference-v14 for Material themes
This commit is contained in:
		
							parent
							
								
									c04a867b9b
								
							
						
					
					
						commit
						50bce42940
					
				| @ -23,7 +23,7 @@ dependencies { | |||||||
|     implementation 'com.android.support:support-vector-drawable:27.1.1' |     implementation 'com.android.support:support-vector-drawable:27.1.1' | ||||||
|     implementation 'com.android.support.constraint:constraint-layout:1.1.0' |     implementation 'com.android.support.constraint:constraint-layout:1.1.0' | ||||||
|     implementation 'com.android.support:palette-v7:27.1.1' |     implementation 'com.android.support:palette-v7:27.1.1' | ||||||
|     implementation 'com.android.support:preference-v7:27.1.1' |     implementation 'com.android.support:preference-v14:27.1.1' | ||||||
| 
 | 
 | ||||||
|     implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' |     implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' | ||||||
|     implementation 'com.google.zxing:core:3.3.2' |     implementation 'com.google.zxing:core:3.3.2' | ||||||
|  | |||||||
| @ -5,8 +5,8 @@ import android.content.SharedPreferences; | |||||||
| import android.content.pm.FeatureInfo; | import android.content.pm.FeatureInfo; | ||||||
| import android.content.pm.PackageManager; | import android.content.pm.PackageManager; | ||||||
| import android.os.Build; | import android.os.Build; | ||||||
| import android.preference.PreferenceManager; |  | ||||||
| import android.support.annotation.Nullable; | import android.support.annotation.Nullable; | ||||||
|  | import android.support.v7.preference.PreferenceManager; | ||||||
| import org.fdroid.fdroid.compat.SupportedArchitectures; | import org.fdroid.fdroid.compat.SupportedArchitectures; | ||||||
| import org.fdroid.fdroid.data.Apk; | import org.fdroid.fdroid.data.Apk; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -3,7 +3,7 @@ package org.fdroid.fdroid; | |||||||
| import android.content.Context; | import android.content.Context; | ||||||
| import android.content.SharedPreferences; | import android.content.SharedPreferences; | ||||||
| import android.os.Build; | import android.os.Build; | ||||||
| import android.preference.PreferenceManager; | import android.support.v7.preference.PreferenceManager; | ||||||
| import android.util.Log; | import android.util.Log; | ||||||
| import info.guardianproject.netcipher.NetCipher; | import info.guardianproject.netcipher.NetCipher; | ||||||
| import org.fdroid.fdroid.net.ConnectivityMonitorService; | import org.fdroid.fdroid.net.ConnectivityMonitorService; | ||||||
|  | |||||||
| @ -36,9 +36,9 @@ import android.os.Handler; | |||||||
| import android.os.Looper; | import android.os.Looper; | ||||||
| import android.os.Process; | import android.os.Process; | ||||||
| import android.os.SystemClock; | import android.os.SystemClock; | ||||||
| import android.preference.PreferenceManager; |  | ||||||
| import android.support.v4.app.NotificationCompat; | import android.support.v4.app.NotificationCompat; | ||||||
| import android.support.v4.content.LocalBroadcastManager; | import android.support.v4.content.LocalBroadcastManager; | ||||||
|  | import android.support.v7.preference.PreferenceManager; | ||||||
| import android.text.TextUtils; | import android.text.TextUtils; | ||||||
| import android.util.Log; | import android.util.Log; | ||||||
| import android.widget.Toast; | import android.widget.Toast; | ||||||
|  | |||||||
| @ -23,7 +23,7 @@ | |||||||
|         <item name="appListItem">#ffffff</item> |         <item name="appListItem">#ffffff</item> | ||||||
|         <item name="lightGrayTextColor">#a6a6a6</item> |         <item name="lightGrayTextColor">#a6a6a6</item> | ||||||
|         <item name="antiFeaturesWarning">@drawable/ic_warning_white_24dp</item> |         <item name="antiFeaturesWarning">@drawable/ic_warning_white_24dp</item> | ||||||
|         <item name="preferenceTheme">@style/PreferenceThemeOverlay</item> |         <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item> | ||||||
|     </style> |     </style> | ||||||
| 
 | 
 | ||||||
|     <style name="AppBaseThemeLight" parent="Theme.AppCompat.Light.NoActionBar"> |     <style name="AppBaseThemeLight" parent="Theme.AppCompat.Light.NoActionBar"> | ||||||
| @ -48,7 +48,7 @@ | |||||||
|         <item name="appListItem">#424242</item> |         <item name="appListItem">#424242</item> | ||||||
|         <item name="lightGrayTextColor">#4a4a4a</item> |         <item name="lightGrayTextColor">#4a4a4a</item> | ||||||
|         <item name="antiFeaturesWarning">@drawable/ic_warning_black_24dp</item> |         <item name="antiFeaturesWarning">@drawable/ic_warning_black_24dp</item> | ||||||
|         <item name="preferenceTheme">@style/PreferenceThemeOverlay</item> |         <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item> | ||||||
|     </style> |     </style> | ||||||
| 
 | 
 | ||||||
|     <style name="AppBaseThemeNight" parent="AppThemeDark"> |     <style name="AppBaseThemeNight" parent="AppThemeDark"> | ||||||
|  | |||||||
| @ -1,55 +1,66 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
| <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> | <android.support.v7.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> | ||||||
|     <PreferenceScreen android:title="@string/about_title"> | 
 | ||||||
|  |     <android.support.v7.preference.PreferenceScreen android:title="@string/about_title"> | ||||||
|         <intent |         <intent | ||||||
|                 android:action="android.intent.action.MAIN" |                 android:action="android.intent.action.MAIN" | ||||||
|                 android:targetPackage="@string/applicationId" |                 android:targetPackage="@string/applicationId" | ||||||
|                 android:targetClass="org.fdroid.fdroid.AboutActivity"/> |                 android:targetClass="org.fdroid.fdroid.AboutActivity"/> | ||||||
|     </PreferenceScreen> |     </android.support.v7.preference.PreferenceScreen> | ||||||
|     <PreferenceCategory android:title="@string/preference_category__my_apps"> | 
 | ||||||
|         <PreferenceScreen android:title="@string/preference_manage_installed_apps"> |     <android.support.v7.preference.PreferenceCategory android:title="@string/preference_category__my_apps"> | ||||||
|  |         <android.support.v7.preference.PreferenceScreen android:title="@string/preference_manage_installed_apps"> | ||||||
|             <intent |             <intent | ||||||
|                     android:action="android.intent.action.MAIN" |                     android:action="android.intent.action.MAIN" | ||||||
|                     android:targetPackage="@string/applicationId" |                     android:targetPackage="@string/applicationId" | ||||||
|                     android:targetClass="org.fdroid.fdroid.views.installed.InstalledAppsActivity"/> |                     android:targetClass="org.fdroid.fdroid.views.installed.InstalledAppsActivity"/> | ||||||
|         </PreferenceScreen> |         </android.support.v7.preference.PreferenceScreen> | ||||||
|         <PreferenceScreen |         <android.support.v7.preference.PreferenceScreen | ||||||
|                 android:title="@string/menu_manage" |                 android:title="@string/menu_manage" | ||||||
|                 android:summary="@string/repositories_summary"> |                 android:summary="@string/repositories_summary"> | ||||||
|             <intent |             <intent | ||||||
|                     android:action="android.intent.action.MAIN" |                     android:action="android.intent.action.MAIN" | ||||||
|                     android:targetPackage="@string/applicationId" |                     android:targetPackage="@string/applicationId" | ||||||
|                     android:targetClass="org.fdroid.fdroid.views.ManageReposActivity"/> |                     android:targetClass="org.fdroid.fdroid.views.ManageReposActivity"/> | ||||||
|         </PreferenceScreen> |         </android.support.v7.preference.PreferenceScreen> | ||||||
|     </PreferenceCategory> |     </android.support.v7.preference.PreferenceCategory> | ||||||
|     <PreferenceCategory android:title="@string/updates"> | 
 | ||||||
|         <ListPreference android:title="@string/update_interval" |     <android.support.v7.preference.PreferenceCategory android:title="@string/updates"> | ||||||
|                         android:key="updateInterval" |         <android.support.v7.preference.ListPreference | ||||||
|                         android:defaultValue="24" |                 android:title="@string/update_interval" | ||||||
|                         android:entries="@array/updateIntervalNames" |                 android:key="updateInterval" | ||||||
|                         android:entryValues="@array/updateIntervalValues"/> |                 android:defaultValue="24" | ||||||
|         <CheckBoxPreference android:title="@string/automatic_scan_wifi" |                 android:entries="@array/updateIntervalNames" | ||||||
|                             android:defaultValue="false" |                 android:entryValues="@array/updateIntervalValues"/> | ||||||
|                             android:key="updateOnWifiOnly"/> |         <android.support.v7.preference.CheckBoxPreference | ||||||
|         <CheckBoxPreference android:title="@string/update_auto_download" |                 android:title="@string/only_on_wifi" | ||||||
|                             android:summary="@string/update_auto_download_summary" |                 android:defaultValue="false" | ||||||
|                             android:defaultValue="false" |                 android:key="updateOnWifiOnly"/> | ||||||
|                             android:key="updateAutoDownload"/> |         <android.support.v7.preference.CheckBoxPreference | ||||||
|         <CheckBoxPreference android:title="@string/notify" |                 android:title="@string/update_auto_download" | ||||||
|                             android:defaultValue="true" |                 android:summary="@string/update_auto_download_summary" | ||||||
|                             android:key="updateNotify"/> |                 android:defaultValue="false" | ||||||
|     </PreferenceCategory> |                 android:key="updateAutoDownload"/> | ||||||
|     <PreferenceCategory android:title="@string/display" |         <android.support.v7.preference.CheckBoxPreference | ||||||
|                         android:key="pref_category_display"> |                 android:title="@string/notify" | ||||||
|         <ListPreference android:title="@string/pref_language" |                 android:defaultValue="true" | ||||||
|                         android:key="language"/> |                 android:key="updateNotify"/> | ||||||
|         <ListPreference android:title="@string/theme" |     </android.support.v7.preference.PreferenceCategory> | ||||||
|                         android:key="theme" | 
 | ||||||
|                         android:defaultValue="light" |     <android.support.v7.preference.PreferenceCategory android:title="@string/display" | ||||||
|                         android:entries="@array/themeNames" |                                                       android:key="pref_category_display"> | ||||||
|                         android:entryValues="@array/themeValues"/> |         <ListPreference | ||||||
|     </PreferenceCategory> |                 android:title="@string/pref_language" | ||||||
|     <PreferenceCategory android:title="@string/appcompatibility"> |                 android:key="language"/> | ||||||
|  |         <ListPreference | ||||||
|  |                 android:title="@string/theme" | ||||||
|  |                 android:key="theme" | ||||||
|  |                 android:defaultValue="light" | ||||||
|  |                 android:entries="@array/themeNames" | ||||||
|  |                 android:entryValues="@array/themeValues"/> | ||||||
|  |     </android.support.v7.preference.PreferenceCategory> | ||||||
|  | 
 | ||||||
|  |     <android.support.v7.preference.PreferenceCategory android:title="@string/appcompatibility"> | ||||||
|         <CheckBoxPreference android:title="@string/show_incompat_versions" |         <CheckBoxPreference android:title="@string/show_incompat_versions" | ||||||
|                             android:defaultValue="false" |                             android:defaultValue="false" | ||||||
|                             android:key="incompatibleVersions"/> |                             android:key="incompatibleVersions"/> | ||||||
| @ -62,18 +73,20 @@ | |||||||
|         <CheckBoxPreference android:title="@string/force_touch_apps" |         <CheckBoxPreference android:title="@string/force_touch_apps" | ||||||
|                             android:defaultValue="false" |                             android:defaultValue="false" | ||||||
|                             android:key="ignoreTouchscreen"/> |                             android:key="ignoreTouchscreen"/> | ||||||
|     </PreferenceCategory> |     </android.support.v7.preference.PreferenceCategory> | ||||||
|     <PreferenceCategory android:title="@string/local_repo"> | 
 | ||||||
|  |     <android.support.v7.preference.PreferenceCategory android:title="@string/local_repo"> | ||||||
|         <EditTextPreference |         <EditTextPreference | ||||||
|                 android:key="localRepoName" |                 android:key="localRepoName" | ||||||
|                 android:title="@string/local_repo_name"/> |                 android:title="@string/local_repo_name"/> | ||||||
|     </PreferenceCategory> |     </android.support.v7.preference.PreferenceCategory> | ||||||
|     <PreferenceCategory android:title="@string/proxy"> | 
 | ||||||
|         <CheckBoxPreference |     <android.support.v7.preference.PreferenceCategory android:title="@string/proxy"> | ||||||
|  |         <android.support.v7.preference.CheckBoxPreference | ||||||
|                 android:key="useTor" |                 android:key="useTor" | ||||||
|                 android:summary="@string/useTorSummary" |                 android:summary="@string/useTorSummary" | ||||||
|                 android:title="@string/useTor"/> |                 android:title="@string/useTor"/> | ||||||
|         <CheckBoxPreference |         <android.support.v7.preference.CheckBoxPreference | ||||||
|                 android:defaultValue="false" |                 android:defaultValue="false" | ||||||
|                 android:key="enableProxy" |                 android:key="enableProxy" | ||||||
|                 android:title="@string/enable_proxy_title" |                 android:title="@string/enable_proxy_title" | ||||||
| @ -88,45 +101,48 @@ | |||||||
|                 android:title="@string/proxy_port" |                 android:title="@string/proxy_port" | ||||||
|                 android:summary="@string/proxy_port_summary" |                 android:summary="@string/proxy_port_summary" | ||||||
|                 android:dependency="enableProxy"/> |                 android:dependency="enableProxy"/> | ||||||
|     </PreferenceCategory> |     </android.support.v7.preference.PreferenceCategory> | ||||||
| 
 | 
 | ||||||
|     <PreferenceCategory |     <android.support.v7.preference.PreferenceCategory | ||||||
|             android:key="pref_category_privacy" |             android:key="pref_category_privacy" | ||||||
|             android:title="@string/privacy"> |             android:title="@string/privacy"> | ||||||
| 
 | 
 | ||||||
|         <CheckBoxPreference |         <android.support.v7.preference.CheckBoxPreference | ||||||
|                 android:defaultValue="false" |                 android:defaultValue="false" | ||||||
|                 android:key="preventScreenshots" |                 android:key="preventScreenshots" | ||||||
|                 android:summary="@string/preventScreenshots_summary" |                 android:summary="@string/preventScreenshots_summary" | ||||||
|                 android:title="@string/preventScreenshots_title"/> |                 android:title="@string/preventScreenshots_title"/> | ||||||
| 
 | 
 | ||||||
|         <CheckBoxPreference |         <android.support.v7.preference.CheckBoxPreference | ||||||
|                 android:defaultValue="false" |                 android:defaultValue="false" | ||||||
|                 android:key="hideOnLongPressSearch" |                 android:key="hideOnLongPressSearch" | ||||||
|                 android:summary="@string/hide_on_long_search_press_summary" |                 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"/> | ||||||
| 
 | 
 | ||||||
|         <PreferenceScreen |         <android.support.v7.preference.PreferenceScreen | ||||||
|                 android:summary="@string/panic_settings_summary" |                 android:summary="@string/panic_settings_summary" | ||||||
|                 android:title="@string/panic_settings"> |                 android:title="@string/panic_settings"> | ||||||
|             <intent |             <intent | ||||||
|                     android:action="android.intent.action.MAIN" |                     android:action="android.intent.action.MAIN" | ||||||
|                     android:targetClass="org.fdroid.fdroid.views.panic.PanicPreferencesActivity" |                     android:targetClass="org.fdroid.fdroid.views.panic.PanicPreferencesActivity" | ||||||
|                     android:targetPackage="@string/applicationId"/> |                     android:targetPackage="@string/applicationId"/> | ||||||
|         </PreferenceScreen> |         </android.support.v7.preference.PreferenceScreen> | ||||||
| 
 | 
 | ||||||
|     </PreferenceCategory> |     </android.support.v7.preference.PreferenceCategory> | ||||||
| 
 | 
 | ||||||
|     <PreferenceCategory android:title="@string/other" |     <android.support.v7.preference.PreferenceCategory | ||||||
|                         android:key="pref_category_other"> |             android:title="@string/other" | ||||||
|         <ListPreference android:title="@string/cache_downloaded" |             android:key="pref_category_other"> | ||||||
|                         android:key="keepCacheFor" |         <ListPreference | ||||||
|                         android:defaultValue="86400000" |                 android:title="@string/cache_downloaded" | ||||||
|                         android:entries="@array/keepCacheNames" |                 android:key="keepCacheFor" | ||||||
|                         android:entryValues="@array/keepCacheValues"/> |                 android:defaultValue="86400000" | ||||||
|         <CheckBoxPreference android:title="@string/expert" |                 android:entries="@array/keepCacheNames" | ||||||
|                             android:defaultValue="false" |                 android:entryValues="@array/keepCacheValues"/> | ||||||
|                             android:key="expert"/> |         <android.support.v7.preference.CheckBoxPreference | ||||||
|  |                 android:title="@string/expert" | ||||||
|  |                 android:defaultValue="false" | ||||||
|  |                 android:key="expert"/> | ||||||
|         <CheckBoxPreference |         <CheckBoxPreference | ||||||
|                 android:key="unstableUpdates" |                 android:key="unstableUpdates" | ||||||
|                 android:title="@string/unstable_updates" |                 android:title="@string/unstable_updates" | ||||||
| @ -145,14 +161,17 @@ | |||||||
|                 android:summary="@string/force_old_index_summary" |                 android:summary="@string/force_old_index_summary" | ||||||
|                 android:defaultValue="false" |                 android:defaultValue="false" | ||||||
|                 android:dependency="expert"/> |                 android:dependency="expert"/> | ||||||
|         <CheckBoxPreference android:title="@string/system_installer" |         <CheckBoxPreference | ||||||
|                             android:defaultValue="false" |                 android:title="@string/system_installer" | ||||||
|                             android:key="privilegedInstaller" |                 android:defaultValue="false" | ||||||
|                             android:persistent="false" |                 android:key="privilegedInstaller" | ||||||
|                             android:dependency="expert"/> |                 android:persistent="false" | ||||||
|         <Preference android:title="@string/uninstall_system" |                 android:dependency="expert"/> | ||||||
|                     android:summary="@string/uninstall_system_summary" |         <Preference | ||||||
|                     android:key="uninstallPrivilegedApp" |                 android:title="@string/uninstall_system" | ||||||
|                     android:dependency="expert"/> |                 android:summary="@string/uninstall_system_summary" | ||||||
|     </PreferenceCategory> |                 android:key="uninstallPrivilegedApp" | ||||||
| </PreferenceScreen> |                 android:dependency="expert"/> | ||||||
|  |     </android.support.v7.preference.PreferenceCategory> | ||||||
|  | 
 | ||||||
|  | </android.support.v7.preference.PreferenceScreen> | ||||||
|  | |||||||
| @ -1,31 +1,31 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
| <PreferenceScreen | <android.support.v7.preference.PreferenceScreen | ||||||
|     xmlns:android="http://schemas.android.com/apk/res/android" |         xmlns:android="http://schemas.android.com/apk/res/android" | ||||||
|     xmlns:tools="http://schemas.android.com/tools"> |         xmlns:tools="http://schemas.android.com/tools"> | ||||||
| 
 | 
 | ||||||
|     <CheckBoxPreference |     <android.support.v7.preference.CheckBoxPreference | ||||||
|         android:defaultValue="true" |             android:defaultValue="true" | ||||||
|         android:key="pref_panic_exit" |             android:key="pref_panic_exit" | ||||||
|         android:summary="@string/panic_exit_summary" |             android:summary="@string/panic_exit_summary" | ||||||
|         android:title="@string/panic_exit_title"/> |             android:title="@string/panic_exit_title"/> | ||||||
| 
 | 
 | ||||||
|     <PreferenceCategory |     <android.support.v7.preference.PreferenceCategory | ||||||
|         android:key="pref_panic_destructive_actions" |             android:key="pref_panic_destructive_actions" | ||||||
|         android:title="@string/panic_destructive_actions"> |             android:title="@string/panic_destructive_actions"> | ||||||
| 
 | 
 | ||||||
|         <ListPreference |         <android.support.v7.preference.ListPreference | ||||||
|             android:key="pref_panic_app" |                 android:key="pref_panic_app" | ||||||
|             android:summary="@string/panic_app_setting_summary" |                 android:summary="@string/panic_app_setting_summary" | ||||||
|             android:title="@string/panic_app_setting_title" |                 android:title="@string/panic_app_setting_title" | ||||||
|             tools:icon="@drawable/ic_cancel"/> |                 tools:icon="@drawable/ic_cancel"/> | ||||||
| 
 | 
 | ||||||
|         <CheckBoxPreference |         <android.support.v7.preference.CheckBoxPreference | ||||||
|             android:defaultValue="false" |                 android:defaultValue="false" | ||||||
|             android:enabled="false" |                 android:enabled="false" | ||||||
|             android:key="pref_panic_hide" |                 android:key="pref_panic_hide" | ||||||
|             android:summary="@string/panic_hide_summary" |                 android:summary="@string/panic_hide_summary" | ||||||
|             android:title="@string/panic_hide_title"/> |                 android:title="@string/panic_hide_title"/> | ||||||
| 
 | 
 | ||||||
|     </PreferenceCategory> |     </android.support.v7.preference.PreferenceCategory> | ||||||
| 
 | 
 | ||||||
| </PreferenceScreen> | </android.support.v7.preference.PreferenceScreen> | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Hans-Christoph Steiner
						Hans-Christoph Steiner