Home | History | Annotate | Download | only in xml
      1 <?xml version="1.0" encoding="utf-8"?>
      2 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
      3                   xmlns:app="http://schemas.android.com/apk/res-auto"
      4                   android:summary="This is a dummy activity only to show case how to build a settings in an application. Changing configurations in this example doesn't affect anything."
      5                   android:title="Settings Example">
      6     <PreferenceScreen
      7             android:icon="@drawable/ic_settings_wifi_4_bar"
      8             android:key="prefs_wifi_screen_key"
      9             android:title="Wi-Fi">
     10         <PreferenceCategory
     11                 android:key="prefs_wifi_networks_key"
     12                 android:title="Available Wi-Fi networks">
     13             <ListPreference
     14                     android:defaultValue="-1"
     15                     android:entries="@array/pref_wifi_networks"
     16                     android:entryValues="@array/pref_wifi_networks"
     17                     android:title="Available Wi-Fi networks"
     18                     android:key="prefs_wifi_key">
     19             </ListPreference>
     20         </PreferenceCategory>
     21         <PreferenceCategory
     22                 android:key="prefs_wifi_others_key"
     23                 android:title="Other options">
     24             <Preference
     25                     android:title="Connect via WPS"
     26                     android:key="prefs_wifi_connect_wps"><!-- You can use Intents here -->
     27             </Preference>
     28         </PreferenceCategory>
     29     </PreferenceScreen>
     30     <PreferenceScreen
     31             android:icon="@drawable/ic_settings_time"
     32             android:key="prefs_date_time_screen_key"
     33             android:title="Date &amp; time">
     34         <CheckBoxPreference
     35                 android:defaultValue="true"
     36                 android:disableDependentsState="true"
     37                 android:key="prefs_date_time_automatic"
     38                 android:summaryOff="On"
     39                 android:summaryOn="Off"
     40                 android:title="Automatic date  &amp; time"></CheckBoxPreference>
     41         <Preference
     42                 android:dependency="prefs_date_time_automatic"
     43                 android:key="prefs_date"
     44                 android:summary="01/01/1970"
     45                 android:title="Date"></Preference>
     46         <Preference
     47                 android:dependency="prefs_date_time_automatic"
     48                 android:key="prefs_time"
     49                 android:summary="00:43 PM"
     50                 android:title="Time"></Preference>
     51         <CheckBoxPreference
     52                 android:defaultValue="true"
     53                 android:disableDependentsState="true"
     54                 android:key="prefs_date_time_use_timezone"
     55                 android:summary="Use network provided time zone"
     56                 android:title="Automatic time zone"></CheckBoxPreference>
     57         <Preference
     58                 android:dependency="prefs_date_time_use_timezone"
     59                 android:summary="GMT 07:00 Pacific Daylight Time"
     60                 android:title="Time zone"></Preference>
     61     </PreferenceScreen>
     62     <ListPreference
     63             android:defaultValue="everyone"
     64             android:icon="@drawable/ic_settings_parental_control"
     65             android:entries="@array/pref_parent_control_entries"
     66             android:entryValues="@array/pref_parent_control_entries_values"
     67             android:key="prefs_parental_control_level_key"
     68             android:dialogMessage="Allow contents rated for"
     69             android:title="Parental Control">
     70     </ListPreference>
     71     <PreferenceScreen
     72             android:icon="@drawable/ic_settings_apps"
     73             android:key="prefs_apps_screen_key"
     74             android:title="Apps">
     75         <PreferenceCategory
     76                 android:key="prefs_app_settings_category"
     77                 android:title="Apps settings">
     78             <PreferenceScreen
     79                     android:key="prefs_app_settings_screen_key"
     80                     android:summary="Lorem ipsum dolor sit amet consectur adipiscing."
     81                     android:title="App permissions">
     82                 <Preference
     83                         android:icon="@mipmap/app_banner_sample_app"
     84                         android:summary="45.5 MB"
     85                         android:selectable="false"
     86                         android:title="Application A"></Preference>
     87                 <Preference
     88                         android:selectable="false"
     89                         android:summary="Hier steht ein voelligst sinnfreier Text den ja sowieso niemandhier lesen kann. Deshalb macht es auch keinen Unterschied ob hier sinnvolles und nicht so sinnvolles Zeug steht. Hm... Sasha, du kannst das vielleicht lesen und denkst dir jetzt auch, dass ich voll haengen geblieben bin, oder?... ^_^"></Preference>
     90                 <Preference
     91                         android:title="Force Stop"
     92                         android:key="pref_force_stop"><!-- Start an Intent --></Preference>
     93                 <Preference
     94                         android:title="Uninstall"
     95                         android:key="pref_uninstall"><!-- Start an Intent --></Preference>
     96                 <Preference
     97                         android:title="More Information"
     98                         android:key="pref_more_info"></Preference>
     99                 <SeekBarPreference
    100                         android:key="pref_sample_seekbar"
    101                         android:title="Seekbar Title"
    102                         android:summary="Seekbar Summary"
    103                         android:defaultValue="-10"
    104                         app:min="-50"
    105                         android:max="140"
    106                         app:adjustable="true"
    107                         app:showSeekBarValue="true"
    108                 />
    109                 <SwitchPreference
    110                         android:key="wifi_always_scan"
    111                         android:persistent="false"
    112                         android:title="SwitchPref Title"
    113                         android:summary="SwitchPref Summary" />
    114             </PreferenceScreen>
    115         </PreferenceCategory>
    116         <PreferenceCategory
    117                 android:key="prefs_app_downloaded_apps_category"
    118                 android:title="Downloaded Apps">
    119             <ListPreference
    120                     android:defaultValue="everyone"
    121                     android:entries="@array/pref_parent_control_entries"
    122                     android:entryValues="@array/pref_parent_control_entries_values"
    123                     android:key="prefs_parental_control_level_key"
    124                     android:title="Downloaded Apps">
    125             </ListPreference>
    126         </PreferenceCategory>
    127     </PreferenceScreen>
    128 </PreferenceScreen>
    129