Implement detailed settings screen redesign

This commit is contained in:
Niels Andriesse 2020-01-09 14:15:43 +11:00
parent 8a5307000b
commit a55d5b9263
16 changed files with 268 additions and 180 deletions

View File

@ -154,6 +154,12 @@
android:windowSoftInputMode="adjustResize" /> android:windowSoftInputMode="adjustResize" />
<activity <activity
android:name="org.thoughtcrime.securesms.loki.redesign.activities.SeedActivity" /> android:name="org.thoughtcrime.securesms.loki.redesign.activities.SeedActivity" />
<activity
android:name="org.thoughtcrime.securesms.loki.redesign.activities.PrivacySettingsActivity" />
<activity
android:name="org.thoughtcrime.securesms.loki.redesign.activities.NotificationSettingsActivity" />
<activity
android:name="org.thoughtcrime.securesms.loki.redesign.activities.ChatSettingsActivity" />
<!-- Session --> <!-- Session -->
<activity android:name="org.thoughtcrime.securesms.loki.LinkedDevicesActivity" /> <activity android:name="org.thoughtcrime.securesms.loki.LinkedDevicesActivity" />
<activity <activity

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragmentContainer"
android:layout_width="match_parent"
android:layout_height="match_parent" />

View File

@ -1,14 +1,12 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
android:layout_width="match_parent" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:orientation="vertical" android:layout_height="wrap_content"
android:layout_margin="0dp" android:orientation="vertical">
android:background="@color/amber_50"
android:padding="0dp">
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="10dp" android:layout_height="@dimen/medium_spacing"
android:background="?pref_divider"/> android:background="@color/cell_background" />
</LinearLayout> </LinearLayout>

View File

@ -1,15 +1,16 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout
android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<TextView android:id="@+id/right_summary" <TextView
android:layout_width="wrap_content" android:id="@+id/right_summary"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:layout_gravity="right|center_vertical" android:layout_height="wrap_content"
android:gravity="right|center_vertical" android:layout_gravity="right|center_vertical"
android:textSize="16sp" android:gravity="right|center_vertical"
android:textColor="@color/signal_primary_dark"/> android:textSize="@dimen/medium_font_size"
android:textColor="@color/accent" />
</FrameLayout> </FrameLayout>

View File

@ -140,6 +140,12 @@
<item name="android:textColor">@color/text</item> <item name="android:textColor">@color/text</item>
<item name="android:elevation">20dp</item> <item name="android:elevation">20dp</item>
</style> </style>
<style name="Session.SettingsTheme" parent="PreferenceThemeOverlay.v14.Material" >
<item name="android:textColor">@color/text</item>
<item name="android:textColorSecondary">#99FFFFFF</item>
<item name="android:textSize">@dimen/medium_font_size</item>
</style>
<!-- Session --> <!-- Session -->
<style name="NoAnimation.Theme.BlackScreen" parent="Theme.AppCompat.NoActionBar"> <style name="NoAnimation.Theme.BlackScreen" parent="Theme.AppCompat.NoActionBar">
@ -376,7 +382,6 @@
<item name="android:focusable">false</item> <item name="android:focusable">false</item>
</style> </style>
<style name="PreferenceThemeOverlay.Fix" parent="PreferenceThemeOverlay.v14.Material"> <style name="PreferenceThemeOverlay.Fix" parent="PreferenceThemeOverlay.v14.Material">
</style> </style>

View File

@ -10,6 +10,8 @@
<item name="android:navigationBarColor">@color/navigation_bar_background</item> <item name="android:navigationBarColor">@color/navigation_bar_background</item>
<item name="alertDialogTheme">@style/Session.AlertDialog</item> <item name="alertDialogTheme">@style/Session.AlertDialog</item>
<item name="android:windowBackground">@drawable/default_session_background</item> <item name="android:windowBackground">@drawable/default_session_background</item>
<item name="preferenceTheme">@style/Session.SettingsTheme</item>
<item name="colorAccent">@color/accent</item>
</style> </style>
<style name="Session.DarkTheme.NoActionBar" parent="@style/Theme.AppCompat.NoActionBar"> <style name="Session.DarkTheme.NoActionBar" parent="@style/Theme.AppCompat.NoActionBar">
@ -19,6 +21,8 @@
<item name="android:navigationBarColor">@color/navigation_bar_background</item> <item name="android:navigationBarColor">@color/navigation_bar_background</item>
<item name="alertDialogTheme">@style/Session.AlertDialog</item> <item name="alertDialogTheme">@style/Session.AlertDialog</item>
<item name="android:windowBackground">@drawable/default_session_background</item> <item name="android:windowBackground">@drawable/default_session_background</item>
<item name="preferenceTheme">@style/Session.SettingsTheme</item>
<item name="colorAccent">@color/accent</item>
</style> </style>
<!-- Session --> <!-- Session -->

View File

@ -1,68 +1,73 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="@string/preferences_app_protection__app_access"> <PreferenceCategory android:title="@string/preferences_app_protection__app_access">
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat <org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:key="pref_android_screen_lock" android:key="pref_android_screen_lock"
android:defaultValue="false" android:defaultValue="false"
android:title="@string/preferences_app_protection__screen_lock" android:title="@string/preferences_app_protection__screen_lock"
android:summary="@string/preferences_app_protection__lock_signal_access_with_android_screen_lock_or_fingerprint"/> android:summary="@string/preferences_app_protection__lock_signal_access_with_android_screen_lock_or_fingerprint" />
<Preference android:title="@string/preferences_app_protection__screen_lock_inactivity_timeout" <Preference
android:key="pref_android_screen_lock_timeout" android:title="@string/preferences_app_protection__screen_lock_inactivity_timeout"
android:dependency="pref_android_screen_lock"/> android:key="pref_android_screen_lock_timeout"
android:dependency="pref_android_screen_lock" />
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat <org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:key="pref_enable_passphrase_temporary" android:key="pref_enable_passphrase_temporary"
android:defaultValue="true" android:defaultValue="true"
android:title="@string/preferences__enable_passphrase" android:title="@string/preferences__enable_passphrase"
android:summary="@string/preferences__lock_signal_and_message_notifications_with_a_passphrase"/> android:summary="@string/preferences__lock_signal_and_message_notifications_with_a_passphrase" />
<Preference android:key="pref_change_passphrase" <Preference
android:title="@string/preferences__change_passphrase" android:key="pref_change_passphrase"
android:summary="@string/preferences__change_your_passphrase" android:title="@string/preferences__change_passphrase"
android:dependency="pref_enable_passphrase_temporary"/> android:summary="@string/preferences__change_your_passphrase"
android:dependency="pref_enable_passphrase_temporary" />
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat <org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="false" android:defaultValue="false"
android:key="pref_timeout_passphrase" android:key="pref_timeout_passphrase"
android:title="@string/preferences__inactivity_timeout_passphrase" android:title="@string/preferences__inactivity_timeout_passphrase"
android:summary="@string/preferences__auto_lock_signal_after_a_specified_time_interval_of_inactivity" android:summary="@string/preferences__auto_lock_signal_after_a_specified_time_interval_of_inactivity"
android:dependency="pref_enable_passphrase_temporary"/> android:dependency="pref_enable_passphrase_temporary" />
<Preference android:title="@string/preferences__inactivity_timeout_interval" <Preference
android:key="pref_timeout_interval" android:title="@string/preferences__inactivity_timeout_interval"
android:dependency="pref_timeout_passphrase"/> android:key="pref_timeout_interval"
android:dependency="pref_timeout_passphrase" />
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat <org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="false" android:defaultValue="false"
android:key="pref_screen_security" android:key="pref_screen_security"
android:title="@string/preferences__screen_security" android:title="@string/preferences__screen_security"
android:summary="@string/preferences__disable_screen_security_to_allow_screen_shots" /> android:summary="@string/preferences__disable_screen_security_to_allow_screen_shots" />
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat <org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="true" android:defaultValue="true"
android:key="pref_incognito_keyboard" android:key="pref_incognito_keyboard"
android:title="@string/preferences__incognito_keyboard" android:title="@string/preferences__incognito_keyboard"
android:summary="@string/preferences__request_keyboard_to_disable_personalized_learning"/> android:summary="@string/preferences__request_keyboard_to_disable_personalized_learning"/>
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:layout="@layout/preference_divider"/> <PreferenceCategory android:layout="@layout/preference_divider" />
<PreferenceCategory android:title="@string/preferences_app_protection__communication"> <PreferenceCategory android:title="@string/preferences_app_protection__communication">
<!-- <org.thoughtcrime.securesms.components.SwitchPreferenceCompat <!-- <org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="false" android:defaultValue="false"
android:key="pref_turn_only" android:key="pref_turn_only"
android:title="@string/preferences_advanced__always_relay_calls" android:title="@string/preferences_advanced__always_relay_calls"
android:summary="@string/preferences_advanced__relay_all_calls_through_the_signal_server_to_avoid_revealing_your_ip_address"/> --> android:summary="@string/preferences_advanced__relay_all_calls_through_the_signal_server_to_avoid_revealing_your_ip_address"/> -->
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat <org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="false" android:defaultValue="false"
android:key="pref_read_receipts" android:key="pref_read_receipts"
android:title="@string/preferences__read_receipts" android:title="@string/preferences__read_receipts"
android:summary="@string/preferences__if_read_receipts_are_disabled_you_wont_be_able_to_see_read_receipts"/> android:summary="@string/preferences__if_read_receipts_are_disabled_you_wont_be_able_to_see_read_receipts"/>
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat <org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="true" android:defaultValue="true"
@ -108,10 +113,10 @@
<PreferenceCategory android:title="@string/preferences_app_protection__registration_lock"> <PreferenceCategory android:title="@string/preferences_app_protection__registration_lock">
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat <org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="false" android:defaultValue="false"
android:key="pref_registration_lock" android:key="pref_registration_lock"
android:title="@string/preferences_app_protection__registration_lock_pin" android:title="@string/preferences_app_protection__registration_lock_pin"
android:summary="@string/preferences_app_protection__enable_a_registration_lock_pin_that_will_be_required"/> android:summary="@string/preferences_app_protection__enable_a_registration_lock_pin_that_will_be_required"/>
</PreferenceCategory> --> </PreferenceCategory> -->

View File

@ -1,100 +1,109 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <PreferenceScreen
xmlns:tools="http://schemas.android.com/tools"> xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<!-- <PreferenceCategory android:key="media_download" android:title="@string/preferences_chats__media_auto_download"> <!-- <PreferenceCategory android:key="media_download" android:title="@string/preferences_chats__media_auto_download">
<MultiSelectListPreference
android:title="@string/preferences_chats__when_using_mobile_data"
android:key="pref_media_download_mobile"
android:defaultValue="@array/pref_media_download_mobile_data_default"
android:persistent="true"
android:entries="@array/pref_media_download_values"
android:entryValues="@array/pref_media_download_entries" />
<MultiSelectListPreference <MultiSelectListPreference
android:title="@string/preferences_chats__when_using_wifi" android:title="@string/preferences_chats__when_using_mobile_data"
android:key="pref_media_download_wifi" android:key="pref_media_download_mobile"
android:defaultValue="@array/pref_media_download_wifi_default" android:defaultValue="@array/pref_media_download_mobile_data_default"
android:persistent="true" android:persistent="true"
android:entries="@array/pref_media_download_values" android:entries="@array/pref_media_download_values"
android:entryValues="@array/pref_media_download_entries" /> android:entryValues="@array/pref_media_download_entries" />
<MultiSelectListPreference <MultiSelectListPreference
android:title="@string/preferences_chats__when_roaming" android:title="@string/preferences_chats__when_using_wifi"
android:key="pref_media_download_roaming" android:key="pref_media_download_wifi"
android:defaultValue="@array/pref_media_download_roaming_default" android:defaultValue="@array/pref_media_download_wifi_default"
android:persistent="true" android:persistent="true"
android:entries="@array/pref_media_download_values" android:entries="@array/pref_media_download_values"
android:entryValues="@array/pref_media_download_entries" /> android:entryValues="@array/pref_media_download_entries" />
<MultiSelectListPreference
android:title="@string/preferences_chats__when_roaming"
android:key="pref_media_download_roaming"
android:defaultValue="@array/pref_media_download_roaming_default"
android:persistent="true"
android:entries="@array/pref_media_download_values"
android:entryValues="@array/pref_media_download_entries" />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:layout="@layout/preference_divider"/> --> <PreferenceCategory android:layout="@layout/preference_divider"/> -->
<PreferenceCategory android:title="@string/preferences_chats__chats"> <PreferenceCategory android:title="@string/preferences_chats__chats">
<org.thoughtcrime.securesms.preferences.widgets.SignalListPreference
android:key="pref_message_body_text_size" <!-- <org.thoughtcrime.securesms.preferences.widgets.SignalListPreference
android:title="@string/preferences_chats__message_text_size" android:key="pref_message_body_text_size"
android:entries="@array/pref_message_font_size_entries" android:title="@string/preferences_chats__message_text_size"
android:entryValues="@array/pref_message_font_size_values" android:entries="@array/pref_message_font_size_entries"
android:defaultValue="16"> android:entryValues="@array/pref_message_font_size_values"
</org.thoughtcrime.securesms.preferences.widgets.SignalListPreference> android:defaultValue="16" /> -->
<!-- <org.thoughtcrime.securesms.components.SwitchPreferenceCompat <!-- <org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="true" android:defaultValue="true"
android:key="pref_show_invite_reminder" android:key="pref_show_invite_reminder"
android:title="@string/preferences_chats__show_invitation_prompts" android:title="@string/preferences_chats__show_invitation_prompts"
android:summary="@string/preferences_chats__display_invitation_prompts_for_contacts_without_signal" /> --> android:summary="@string/preferences_chats__display_invitation_prompts_for_contacts_without_signal" /> -->
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat <org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="false" android:defaultValue="false"
android:key="pref_system_emoji" android:key="pref_system_emoji"
android:title="@string/preferences_advanced__use_system_emoji" android:title="@string/preferences_advanced__use_system_emoji"
android:summary="@string/preferences_advanced__disable_signal_built_in_emoji_support" /> android:summary="@string/preferences_advanced__disable_signal_built_in_emoji_support" />
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat <org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="false" android:defaultValue="false"
android:key="pref_enter_sends" android:key="pref_enter_sends"
android:summary="@string/preferences__pressing_the_enter_key_will_send_text_messages" android:summary="@string/preferences__pressing_the_enter_key_will_send_text_messages"
android:title="@string/preferences__pref_enter_sends_title"/> android:title="@string/preferences__pref_enter_sends_title" />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:layout="@layout/preference_divider"/> <PreferenceCategory android:layout="@layout/preference_divider"/>
<PreferenceCategory android:key="message_trimming" android:title="@string/preferences_chats__message_trimming"> <PreferenceCategory android:key="message_trimming" android:title="@string/preferences_chats__message_trimming">
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat <org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="false" android:defaultValue="false"
android:key="pref_trim_threads" android:key="pref_trim_threads"
android:summary="@string/preferences__automatically_delete_older_messages_once_a_conversation_exceeds_a_specified_length" android:summary="@string/preferences__automatically_delete_older_messages_once_a_conversation_exceeds_a_specified_length"
android:title="@string/preferences__delete_old_messages" /> android:title="@string/preferences__delete_old_messages" />
<EditTextPreference android:defaultValue="500" <EditTextPreference
android:key="pref_trim_length" android:defaultValue="500"
android:title="@string/preferences__conversation_length_limit" android:key="pref_trim_length"
android:inputType="number" android:title="@string/preferences__conversation_length_limit"
android:dependency="pref_trim_threads" /> android:inputType="number"
android:dependency="pref_trim_threads" />
<Preference
android:key="pref_trim_now"
android:title="@string/preferences__trim_all_conversations_now"
android:summary="@string/preferences__scan_through_all_conversations_and_enforce_conversation_length_limits"
android:dependency="pref_trim_threads" />
<Preference android:key="pref_trim_now"
android:title="@string/preferences__trim_all_conversations_now"
android:summary="@string/preferences__scan_through_all_conversations_and_enforce_conversation_length_limits"
android:dependency="pref_trim_threads" />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:layout="@layout/preference_divider"/> <PreferenceCategory android:layout="@layout/preference_divider" />
<PreferenceCategory android:key="backup_category" android:title="@string/preferences_chats__backups"> <PreferenceCategory android:key="backup_category" android:title="@string/preferences_chats__backups">
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat <org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="false" android:defaultValue="false"
android:key="pref_backup_enabled" android:key="pref_backup_enabled"
android:title="@string/preferences_chats__chat_backups" android:title="@string/preferences_chats__chat_backups"
android:summary="@string/preferences_chats__backup_chats_to_external_storage" /> android:summary="@string/preferences_chats__backup_chats_to_external_storage" />
<org.thoughtcrime.securesms.preferences.widgets.ProgressPreference <org.thoughtcrime.securesms.preferences.widgets.ProgressPreference
android:key="pref_backup_create" android:key="pref_backup_create"
android:title="@string/preferences_chats__create_backup" android:title="@string/preferences_chats__create_backup"
android:persistent="false" android:persistent="false"
android:dependency="pref_backup_enabled" android:dependency="pref_backup_enabled"
tools:summary="Last backup: 3 days ago"/> tools:summary="Last backup: 3 days ago" />
</PreferenceCategory> </PreferenceCategory>

View File

@ -2,37 +2,39 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<!-- <PreferenceCategory android:title="@string/preferences_notifications__messages"> --> <PreferenceCategory android:title="@string/preferences_notifications__messages">
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat <org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:key="pref_key_enable_notifications" android:key="pref_key_enable_notifications"
android:title="@string/preferences__notifications" android:title="@string/preferences__notifications"
android:defaultValue="true" /> android:defaultValue="true" />
<org.thoughtcrime.securesms.preferences.widgets.SignalListPreference <org.thoughtcrime.securesms.preferences.widgets.SignalListPreference
android:key="pref_notification_priority" android:key="pref_notification_priority"
android:title="@string/preferences_notifications__priority" android:title="@string/preferences_notifications__priority"
android:dependency="pref_key_enable_notifications" android:dependency="pref_key_enable_notifications"
android:defaultValue="1" android:defaultValue="1"
android:entries="@array/pref_notification_priority_entries" android:entries="@array/pref_notification_priority_entries"
android:entryValues="@array/pref_notification_priority_values"/> android:entryValues="@array/pref_notification_priority_values" />
<PreferenceCategory android:layout="@layout/preference_divider"/> </PreferenceCategory>
<PreferenceCategory android:layout="@layout/preference_divider" />
<PreferenceCategory android:title="@string/activity_notification_settings_style_section_title"> <PreferenceCategory android:title="@string/activity_notification_settings_style_section_title">
<org.thoughtcrime.securesms.preferences.widgets.SignalPreference <org.thoughtcrime.securesms.preferences.widgets.SignalPreference
android:dependency="pref_key_enable_notifications" android:dependency="pref_key_enable_notifications"
android:key="pref_key_ringtone" android:key="pref_key_ringtone"
android:title="@string/preferences__sound" android:title="@string/preferences__sound"
android:persistent="false" android:persistent="false"
android:defaultValue="content://settings/system/notification_sound" /> android:defaultValue="content://settings/system/notification_sound" />
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat <org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:dependency="pref_key_enable_notifications" android:dependency="pref_key_enable_notifications"
android:key="pref_key_vibrate" android:key="pref_key_vibrate"
android:defaultValue="true" android:defaultValue="true"
android:title="@string/preferences__vibrate"/> android:title="@string/preferences__vibrate" />
<org.thoughtcrime.securesms.preferences.widgets.LEDColorListPreference <org.thoughtcrime.securesms.preferences.widgets.LEDColorListPreference
android:key="pref_led_color" android:key="pref_led_color"
@ -51,32 +53,32 @@
android:entryValues="@array/pref_led_blink_pattern_values" /> android:entryValues="@array/pref_led_blink_pattern_values" />
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat <org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:key="pref_key_inthread_notifications" android:key="pref_key_inthread_notifications"
android:title="@string/preferences_notifications__in_chat_sounds" android:title="@string/preferences_notifications__in_chat_sounds"
android:dependency="pref_key_enable_notifications" android:dependency="pref_key_enable_notifications"
android:defaultValue="true" /> android:defaultValue="true" />
<org.thoughtcrime.securesms.preferences.widgets.SignalListPreference <org.thoughtcrime.securesms.preferences.widgets.SignalListPreference
android:key="pref_repeat_alerts" android:key="pref_repeat_alerts"
android:defaultValue="0" android:defaultValue="0"
android:title="@string/preferences__repeat_alerts" android:title="@string/preferences__repeat_alerts"
android:dependency="pref_key_enable_notifications" android:dependency="pref_key_enable_notifications"
android:entries="@array/pref_repeat_alerts_entries" android:entries="@array/pref_repeat_alerts_entries"
android:entryValues="@array/pref_repeat_alerts_values" /> android:entryValues="@array/pref_repeat_alerts_values" />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:layout="@layout/preference_divider"/> <PreferenceCategory android:layout="@layout/preference_divider" />
<PreferenceCategory android:title="@string/activity_notification_settings_content_section_title"> <PreferenceCategory android:title="@string/activity_notification_settings_content_section_title">
<org.thoughtcrime.securesms.preferences.widgets.SignalListPreference <org.thoughtcrime.securesms.preferences.widgets.SignalListPreference
android:key="pref_notification_privacy" android:key="pref_notification_privacy"
android:title="@string/preferences_notifications__show" android:title="@string/preferences_notifications__show"
android:dependency="pref_key_enable_notifications" android:dependency="pref_key_enable_notifications"
android:defaultValue="all" android:defaultValue="all"
android:entries="@array/pref_notification_privacy_entries" android:entries="@array/pref_notification_privacy_entries"
android:entryValues="@array/pref_notification_privacy_values"/> android:entryValues="@array/pref_notification_privacy_values" />
</PreferenceCategory> </PreferenceCategory>

View File

@ -0,0 +1,19 @@
package org.thoughtcrime.securesms.loki.redesign.activities
import android.os.Bundle
import network.loki.messenger.R
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
import org.thoughtcrime.securesms.preferences.ChatsPreferenceFragment
class ChatSettingsActivity : PassphraseRequiredActionBarActivity() {
override fun onCreate(savedInstanceState: Bundle?, isReady: Boolean) {
super.onCreate(savedInstanceState, isReady)
setContentView(R.layout.activity_fragment_wrapper)
supportActionBar!!.title = "Chats"
val fragment = ChatsPreferenceFragment()
val transaction = supportFragmentManager.beginTransaction()
transaction.replace(R.id.fragmentContainer, fragment)
transaction.commit()
}
}

View File

@ -0,0 +1,19 @@
package org.thoughtcrime.securesms.loki.redesign.activities
import android.os.Bundle
import network.loki.messenger.R
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
import org.thoughtcrime.securesms.preferences.NotificationsPreferenceFragment
class NotificationSettingsActivity : PassphraseRequiredActionBarActivity() {
override fun onCreate(savedInstanceState: Bundle?, isReady: Boolean) {
super.onCreate(savedInstanceState, isReady)
setContentView(R.layout.activity_fragment_wrapper)
supportActionBar!!.title = "Notifications"
val fragment = NotificationsPreferenceFragment()
val transaction = supportFragmentManager.beginTransaction()
transaction.replace(R.id.fragmentContainer, fragment)
transaction.commit()
}
}

View File

@ -0,0 +1,19 @@
package org.thoughtcrime.securesms.loki.redesign.activities
import android.os.Bundle
import network.loki.messenger.R
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
import org.thoughtcrime.securesms.preferences.AppProtectionPreferenceFragment
class PrivacySettingsActivity : PassphraseRequiredActionBarActivity() {
override fun onCreate(savedInstanceState: Bundle?, isReady: Boolean) {
super.onCreate(savedInstanceState, isReady)
setContentView(R.layout.activity_fragment_wrapper)
supportActionBar!!.title = "Privacy"
val fragment = AppProtectionPreferenceFragment()
val transaction = supportFragmentManager.beginTransaction()
transaction.replace(R.id.fragmentContainer, fragment)
transaction.commit()
}
}

View File

@ -23,7 +23,6 @@ import nl.komponents.kovenant.all
import nl.komponents.kovenant.deferred import nl.komponents.kovenant.deferred
import nl.komponents.kovenant.ui.alwaysUi import nl.komponents.kovenant.ui.alwaysUi
import org.thoughtcrime.securesms.ApplicationContext import org.thoughtcrime.securesms.ApplicationContext
import org.thoughtcrime.securesms.ApplicationPreferencesActivity
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
import org.thoughtcrime.securesms.avatar.AvatarSelection import org.thoughtcrime.securesms.avatar.AvatarSelection
import org.thoughtcrime.securesms.crypto.ProfileKeyUtil import org.thoughtcrime.securesms.crypto.ProfileKeyUtil
@ -89,6 +88,8 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
seedButton.visibility = View.GONE seedButton.visibility = View.GONE
} }
privacyButton.setOnClickListener { showPrivacySettings() } privacyButton.setOnClickListener { showPrivacySettings() }
notificationsButton.setOnClickListener { showNotificationSettings() }
chatsButton.setOnClickListener { showChatSettings() }
seedButton.setOnClickListener { showSeed() } seedButton.setOnClickListener { showSeed() }
clearAllDataButton.setOnClickListener { clearAllData() } clearAllDataButton.setOnClickListener { clearAllData() }
} }
@ -250,7 +251,17 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
} }
private fun showPrivacySettings() { private fun showPrivacySettings() {
val intent = Intent(this, ApplicationPreferencesActivity::class.java) val intent = Intent(this, PrivacySettingsActivity::class.java)
push(intent)
}
private fun showNotificationSettings() {
val intent = Intent(this, NotificationSettingsActivity::class.java)
push(intent)
}
private fun showChatSettings() {
val intent = Intent(this, ChatSettingsActivity::class.java)
push(intent) push(intent)
} }

View File

@ -12,7 +12,6 @@ import android.support.v7.preference.Preference;
import android.widget.Toast; import android.widget.Toast;
import org.thoughtcrime.securesms.ApplicationContext; import org.thoughtcrime.securesms.ApplicationContext;
import org.thoughtcrime.securesms.ApplicationPreferencesActivity;
import org.thoughtcrime.securesms.BlockedContactsActivity; import org.thoughtcrime.securesms.BlockedContactsActivity;
import org.thoughtcrime.securesms.PassphraseChangeActivity; import org.thoughtcrime.securesms.PassphraseChangeActivity;
import org.thoughtcrime.securesms.components.SwitchPreferenceCompat; import org.thoughtcrime.securesms.components.SwitchPreferenceCompat;
@ -72,8 +71,6 @@ public class AppProtectionPreferenceFragment extends CorrectedPreferenceFragment
disablePassphrase.setOnPreferenceChangeListener(new DisablePassphraseClickListener()); disablePassphrase.setOnPreferenceChangeListener(new DisablePassphraseClickListener());
initializeVisibility(); initializeVisibility();
Analytics.Companion.getShared().track("Privacy Settings Opened");
} }
@Override @Override
@ -84,8 +81,6 @@ public class AppProtectionPreferenceFragment extends CorrectedPreferenceFragment
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
((ApplicationPreferencesActivity) getActivity()).getSupportActionBar().setTitle(R.string.preferences__privacy);
if (!TextSecurePreferences.isPasswordDisabled(getContext())) initializePassphraseTimeoutSummary(); if (!TextSecurePreferences.isPasswordDisabled(getContext())) initializePassphraseTimeoutSummary();
else initializeScreenLockTimeoutSummary(); else initializeScreenLockTimeoutSummary();

View File

@ -17,8 +17,6 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode; import org.greenrobot.eventbus.ThreadMode;
import org.thoughtcrime.securesms.ApplicationContext; import org.thoughtcrime.securesms.ApplicationContext;
import org.thoughtcrime.securesms.ApplicationPreferencesActivity;
import network.loki.messenger.R;
import org.thoughtcrime.securesms.backup.BackupDialog; import org.thoughtcrime.securesms.backup.BackupDialog;
import org.thoughtcrime.securesms.backup.FullBackupBase.BackupEvent; import org.thoughtcrime.securesms.backup.FullBackupBase.BackupEvent;
import org.thoughtcrime.securesms.components.SwitchPreferenceCompat; import org.thoughtcrime.securesms.components.SwitchPreferenceCompat;
@ -35,6 +33,8 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Set; import java.util.Set;
import network.loki.messenger.R;
public class ChatsPreferenceFragment extends ListSummaryPreferenceFragment { public class ChatsPreferenceFragment extends ListSummaryPreferenceFragment {
private static final String TAG = ChatsPreferenceFragment.class.getSimpleName(); private static final String TAG = ChatsPreferenceFragment.class.getSimpleName();
@ -76,7 +76,6 @@ public class ChatsPreferenceFragment extends ListSummaryPreferenceFragment {
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
((ApplicationPreferencesActivity)getActivity()).getSupportActionBar().setTitle(R.string.preferences__chats);
setMediaDownloadSummaries(); setMediaDownloadSummaries();
setBackupSummary(); setBackupSummary();
} }

View File

@ -14,12 +14,10 @@ import android.support.v7.preference.ListPreference;
import android.support.v7.preference.Preference; import android.support.v7.preference.Preference;
import android.text.TextUtils; import android.text.TextUtils;
import org.thoughtcrime.securesms.ApplicationPreferencesActivity;
import org.thoughtcrime.securesms.components.SwitchPreferenceCompat; import org.thoughtcrime.securesms.components.SwitchPreferenceCompat;
import org.thoughtcrime.securesms.notifications.MessageNotifier; import org.thoughtcrime.securesms.notifications.MessageNotifier;
import org.thoughtcrime.securesms.notifications.NotificationChannels; import org.thoughtcrime.securesms.notifications.NotificationChannels;
import org.thoughtcrime.securesms.util.TextSecurePreferences; import org.thoughtcrime.securesms.util.TextSecurePreferences;
import org.whispersystems.signalservice.loki.utilities.Analytics;
import network.loki.messenger.R; import network.loki.messenger.R;
@ -121,8 +119,6 @@ public class NotificationsPreferenceFragment extends ListSummaryPreferenceFragme
// initializeCallRingtoneSummary(findPreference(TextSecurePreferences.CALL_RINGTONE_PREF)); // initializeCallRingtoneSummary(findPreference(TextSecurePreferences.CALL_RINGTONE_PREF));
initializeMessageVibrateSummary((SwitchPreferenceCompat)findPreference(TextSecurePreferences.VIBRATE_PREF)); initializeMessageVibrateSummary((SwitchPreferenceCompat)findPreference(TextSecurePreferences.VIBRATE_PREF));
// initializeCallVibrateSummary((SwitchPreferenceCompat)findPreference(TextSecurePreferences.CALL_VIBRATE_PREF)); // initializeCallVibrateSummary((SwitchPreferenceCompat)findPreference(TextSecurePreferences.CALL_VIBRATE_PREF));
Analytics.Companion.getShared().track("Notification Settings Opened");
} }
@Override @Override
@ -130,12 +126,6 @@ public class NotificationsPreferenceFragment extends ListSummaryPreferenceFragme
addPreferencesFromResource(R.xml.preferences_notifications); addPreferencesFromResource(R.xml.preferences_notifications);
} }
@Override
public void onResume() {
super.onResume();
((ApplicationPreferencesActivity) getActivity()).getSupportActionBar().setTitle(R.string.preferences__notifications);
}
@Override @Override
public void onActivityResult(int requestCode, int resultCode, Intent data) { public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == 1 && resultCode == RESULT_OK && data != null) { if (requestCode == 1 && resultCode == RESULT_OK && data != null) {