add more sample settings

This commit is contained in:
Daniel Gultsch 2023-02-20 21:44:48 +01:00
parent 7567dcff5e
commit 09b28358ab
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2
9 changed files with 80 additions and 20 deletions

View file

@ -70,7 +70,7 @@ public class Conversations extends Application {
private static int getDesiredNightMode(
final Context context, final SharedPreferences sharedPreferences) {
final String theme =
sharedPreferences.getString("theme", context.getString(R.string.theme));
sharedPreferences.getString("theme", context.getString(R.string.default_theme));
return getDesiredNightMode(theme);
}

View file

@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:autoMirrored="true"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M19,7v4H5.83l3.58,-3.59L8,6l-6,6 6,6 1.41,-1.41L5.83,13H21V7z" />
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M17,1.01L7,1C5.9,1 5,1.9 5,3v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V3C19,1.9 18.1,1.01 17,1.01zM17,18H7V6h10V18zM9.5,8.5H12V7H8v4h1.5V8.5zM12,17h4v-4h-1.5v2.5H12V17z" />
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M16,13h-3V3h-2v10H8l4,4 4,-4zM4,19v2h16v-2H4z" />
</vector>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="theme">automatic</string>
<string name="default_theme">automatic</string>
<string-array name="themes" tools:ignore="InconsistentArrays">
<item>@string/pref_theme_automatic</item>
<item>@string/pref_theme_light</item>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="scroll_to_bottom">true</bool>
<bool name="enter_is_send">false</bool>
<bool name="allow_screenshots">true</bool>
</resources>

View file

@ -130,8 +130,7 @@
<string name="pref_never_send_crash_summary">By sending in stack traces you are helping the development</string>
<string name="pref_confirm_messages">Confirm Messages</string>
<string name="pref_confirm_messages_summary">Let your contacts know when you have received and read their messages</string>
<string name="pref_prevent_screenshots">Prevent Screenshots</string>
<string name="pref_prevent_screenshots_summary">Hide app contents in the app switcher and block screenshots</string>
<string name="pref_allow_screenshots_summary">Show app content in app switcher and allow screenshots to be taken</string>
<string name="pref_ui_options">UI</string>
<string name="openpgp_error">OpenKeychain produced an error.</string>
<string name="bad_key_for_encryption">Bad key for encryption.</string>
@ -410,7 +409,7 @@
<string name="mark_as_read">Mark as read</string>
<string name="pref_input_options">Input</string>
<string name="pref_enter_is_send">Enter is send</string>
<string name="pref_enter_is_send_summary">Use Enter key to send message. You can always use Ctrl+Enter to send message, even if this option is disabled.</string>
<string name="pref_enter_is_send_summary">Use Enter (instead of Ctrl+Enter) to send message</string>
<string name="pref_display_enter_key">Show enter key</string>
<string name="pref_display_enter_key_summary">Change the emoticons key to an enter key</string>
<string name="audio">audio</string>
@ -1018,7 +1017,7 @@
<string name="spaces">Spaces</string>
<string name="chats">Chats</string>
<string name="pref_title_interface">Interface</string>
<string name="pref_summary_appearance"><![CDATA[Theme & Colors]]></string>
<string name="pref_summary_appearance">Theme, Colors, Screenshots, Input</string>
<string name="pref_title_security">Security</string>
<string name="pref_summary_security">Encryption, Blind Trust Before Verification, MIM Detection</string>
<string name="unified_push_summary">Notification relay for UnifiedPush compatible third party apps</string>
@ -1026,5 +1025,6 @@
<string name="pref_dynamic_colors_summary">System colors (Material You)</string>
<string name="pref_light_dark_mode">Light/dark mode</string>
<string name="appearance">Appearance</string>
<string name="pref_allow_screenshots">Allow screenshots</string>
</resources>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="theme">light</string>
<string name="default_theme" translatable="false">light</string>
<string-array name="themes">
<item>@string/pref_theme_light</item>
<item>@string/pref_theme_dark</item>

View file

@ -2,18 +2,41 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory android:title="@string/appearance">
<SwitchPreferenceCompat
android:icon="@drawable/ic_palette_24dp"
android:key="dynamic_colors"
android:title="@string/pref_dynamic_colors"
android:summary="@string/pref_dynamic_colors_summary"/>
<ListPreference
android:defaultValue="@string/theme"
android:entries="@array/themes"
android:entryValues="@array/themes_values"
android:icon="@drawable/ic_dark_mode_24dp"
android:key="theme"
android:title="@string/pref_light_dark_mode"
app:useSimpleSummaryProvider="true" />
<SwitchPreferenceCompat
android:icon="@drawable/ic_palette_24dp"
android:key="dynamic_colors"
android:summary="@string/pref_dynamic_colors_summary"
android:title="@string/pref_dynamic_colors" />
<ListPreference
android:defaultValue="@string/default_theme"
android:entries="@array/themes"
android:entryValues="@array/themes_values"
android:icon="@drawable/ic_dark_mode_24dp"
android:key="theme"
android:title="@string/pref_light_dark_mode"
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_privacy">
<SwitchPreferenceCompat
android:icon="@drawable/ic_screenshot_24dp"
android:defaultValue="@bool/allow_screenshots"
android:key="allow_screenshots"
android:summary="@string/pref_allow_screenshots_summary"
android:title="@string/pref_allow_screenshots" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_input_options">
<SwitchPreferenceCompat
android:icon="@drawable/ic_keyboard_return_24dp"
android:defaultValue="@bool/enter_is_send"
android:key="enter_is_send"
android:summary="@string/pref_enter_is_send_summary"
android:title="@string/pref_enter_is_send" />
<SwitchPreferenceCompat
android:icon="@drawable/ic_vertical_align_bottom_24dp"
android:defaultValue="@bool/scroll_to_bottom"
android:key="scroll_to_bottom"
android:summary="@string/pref_scroll_to_bottom_summary"
android:title="@string/pref_scroll_to_bottom" />
</PreferenceCategory>
</PreferenceScreen>