aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Zelent <zelent.marcin@gmail.com>2018-03-29 15:58:03 +0200
committerMarcin Zelent <zelent.marcin@gmail.com>2018-03-29 15:58:03 +0200
commit14e6b8b0171601c7392d13c4c79e38c2e55df928 (patch)
tree837d4fbe59f9723ffcd9deccaaec60d3bbdd4725 /app/src/main/res/xml
parentffd565bf02a180a249f361b29395f716c0ac2b40 (diff)
Added fragments
Diffstat (limited to 'app/src/main/res/xml')
-rw-r--r--app/src/main/res/xml/pref_data_sync.xml21
-rw-r--r--app/src/main/res/xml/pref_general.xml33
-rw-r--r--app/src/main/res/xml/pref_headers.xml20
-rw-r--r--app/src/main/res/xml/pref_notification.xml27
4 files changed, 101 insertions, 0 deletions
diff --git a/app/src/main/res/xml/pref_data_sync.xml b/app/src/main/res/xml/pref_data_sync.xml
new file mode 100644
index 0000000..6bd9192
--- /dev/null
+++ b/app/src/main/res/xml/pref_data_sync.xml
@@ -0,0 +1,21 @@
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to
+ dismiss it. -->
+ <!-- NOTE: ListPreference's summary should be set to its value by the activity code. -->
+ <ListPreference
+ android:defaultValue="180"
+ android:entries="@array/pref_sync_frequency_titles"
+ android:entryValues="@array/pref_sync_frequency_values"
+ android:key="sync_frequency"
+ android:negativeButtonText="@null"
+ android:positiveButtonText="@null"
+ android:title="@string/pref_title_sync_frequency" />
+
+ <!-- This preference simply launches an intent when selected. Use this UI sparingly, per
+ design guidelines. -->
+ <Preference android:title="@string/pref_title_system_sync_settings">
+ <intent android:action="android.settings.SYNC_SETTINGS" />
+ </Preference>
+
+</PreferenceScreen>
diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml
new file mode 100644
index 0000000..36569d6
--- /dev/null
+++ b/app/src/main/res/xml/pref_general.xml
@@ -0,0 +1,33 @@
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <SwitchPreference
+ android:defaultValue="true"
+ android:key="example_switch"
+ android:summary="@string/pref_description_social_recommendations"
+ android:title="@string/pref_title_social_recommendations" />
+
+ <!-- NOTE: EditTextPreference accepts EditText attributes. -->
+ <!-- NOTE: EditTextPreference's summary should be set to its value by the activity code. -->
+ <EditTextPreference
+ android:capitalize="words"
+ android:defaultValue="@string/pref_default_display_name"
+ android:inputType="textCapWords"
+ android:key="example_text"
+ android:maxLines="1"
+ android:selectAllOnFocus="true"
+ android:singleLine="true"
+ android:title="@string/pref_title_display_name" />
+
+ <!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to
+ dismiss it. -->
+ <!-- NOTE: ListPreference's summary should be set to its value by the activity code. -->
+ <ListPreference
+ android:defaultValue="-1"
+ android:entries="@array/pref_example_list_titles"
+ android:entryValues="@array/pref_example_list_values"
+ android:key="example_list"
+ android:negativeButtonText="@null"
+ android:positiveButtonText="@null"
+ android:title="@string/pref_title_add_friends_to_messages" />
+
+</PreferenceScreen>
diff --git a/app/src/main/res/xml/pref_headers.xml b/app/src/main/res/xml/pref_headers.xml
new file mode 100644
index 0000000..0112e90
--- /dev/null
+++ b/app/src/main/res/xml/pref_headers.xml
@@ -0,0 +1,20 @@
+<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <!-- These settings headers are only used on tablets. -->
+
+ <header
+ android:fragment="org.marcinzelent.liberavem.SettingsActivity$GeneralPreferenceFragment"
+ android:icon="@drawable/ic_info_black_24dp"
+ android:title="@string/pref_header_general" />
+
+ <header
+ android:fragment="org.marcinzelent.liberavem.SettingsActivity$NotificationPreferenceFragment"
+ android:icon="@drawable/ic_notifications_black_24dp"
+ android:title="@string/pref_header_notifications" />
+
+ <header
+ android:fragment="org.marcinzelent.liberavem.SettingsActivity$DataSyncPreferenceFragment"
+ android:icon="@drawable/ic_sync_black_24dp"
+ android:title="@string/pref_header_data_sync" />
+
+</preference-headers>
diff --git a/app/src/main/res/xml/pref_notification.xml b/app/src/main/res/xml/pref_notification.xml
new file mode 100644
index 0000000..e5a319e
--- /dev/null
+++ b/app/src/main/res/xml/pref_notification.xml
@@ -0,0 +1,27 @@
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <!-- A 'parent' preference, which enables/disables child preferences (below)
+ when checked/unchecked. -->
+ <SwitchPreference
+ android:defaultValue="true"
+ android:key="notifications_new_message"
+ android:title="@string/pref_title_new_message_notifications" />
+
+ <!-- Allows the user to choose a ringtone in the 'notification' category. -->
+ <!-- NOTE: This preference will be enabled only when the checkbox above is checked. -->
+ <!-- NOTE: RingtonePreference's summary should be set to its value by the activity code. -->
+ <RingtonePreference
+ android:defaultValue="content://settings/system/notification_sound"
+ android:dependency="notifications_new_message"
+ android:key="notifications_new_message_ringtone"
+ android:ringtoneType="notification"
+ android:title="@string/pref_title_ringtone" />
+
+ <!-- NOTE: This preference will be enabled only when the checkbox above is checked. -->
+ <SwitchPreference
+ android:defaultValue="true"
+ android:dependency="notifications_new_message"
+ android:key="notifications_new_message_vibrate"
+ android:title="@string/pref_title_vibrate" />
+
+</PreferenceScreen>