mirror of
https://github.com/Matte23/circolapp.git
synced 2025-12-06 15:39:11 +00:00
Add settings
This commit is contained in:
9
app/src/main/res/layout/settings_activity.xml
Normal file
9
app/src/main/res/layout/settings_activity.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/settings"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
@@ -8,6 +8,9 @@
|
||||
android:title="@string/menu_search"
|
||||
app:actionViewClass="androidx.appcompat.widget.SearchView"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/menu_main_settings"
|
||||
android:title="@string/title_settings" />
|
||||
<item
|
||||
android:id="@+id/menu_main_about"
|
||||
android:title="@string/menu_about" />
|
||||
|
||||
13
app/src/main/res/values/arrays.xml
Normal file
13
app/src/main/res/values/arrays.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<resources>
|
||||
<string-array name="dark_theme_entries">
|
||||
<item>Automatic</item>
|
||||
<item>Enabled</item>
|
||||
<item>Disabled</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="dark_theme_values">
|
||||
<item>auto</item>
|
||||
<item>enabled</item>
|
||||
<item>disabled</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
@@ -4,10 +4,19 @@
|
||||
<string name="title_favourites">Favourites</string>
|
||||
<string name="title_reminders">Reminders</string>
|
||||
<string name="title_licenses">Third party licenses</string>
|
||||
<string name="title_settings">Settings</string>
|
||||
|
||||
<string name="menu_about">About</string>
|
||||
<string name="menu_search">Search</string>
|
||||
|
||||
<string name="preferences_general_header">General</string>
|
||||
<string name="preference_notifications_header">Notifications</string>
|
||||
<string name="preferences_dark_theme">Dark theme</string>
|
||||
<string name="preferences_notify_new_circulars">Show notifications</string>
|
||||
<string name="preferences_poll_interval">Synchronization interval</string>
|
||||
<string name="preferences_notify_new_circulars_summary">Show a notification when a new circular is published</string>
|
||||
<string name="preferences_poll_interval_summary">How long to wait before checking if new circulars are published</string>
|
||||
|
||||
<string name="notification_title">Circular letter number %1$d</string>
|
||||
<string name="notification_summary_title">New circulars published</string>
|
||||
<string name="notification_summary">New circulars</string>
|
||||
|
||||
35
app/src/main/res/xml/root_preferences.xml
Normal file
35
app/src/main/res/xml/root_preferences.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<PreferenceCategory app:title="@string/preferences_general_header">
|
||||
|
||||
<ListPreference
|
||||
app:defaultValue="auto"
|
||||
app:entries="@array/dark_theme_entries"
|
||||
app:entryValues="@array/dark_theme_values"
|
||||
app:key="dark_theme"
|
||||
app:title="@string/preferences_dark_theme"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory app:title="@string/preference_notifications_header">
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:summary="@string/preferences_notify_new_circulars_summary"
|
||||
app:key="notify_new_circulars"
|
||||
app:title="@string/preferences_notify_new_circulars" />
|
||||
|
||||
<EditTextPreference
|
||||
android:defaultValue="15"
|
||||
android:dependency="notify_new_circulars"
|
||||
android:key="poll_interval"
|
||||
android:selectAllOnFocus="true"
|
||||
android:singleLine="true"
|
||||
android:summary="@string/preferences_poll_interval_summary"
|
||||
android:title="@string/preferences_poll_interval" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
||||
Reference in New Issue
Block a user