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" />
<activity
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 -->
<activity android:name="org.thoughtcrime.securesms.loki.LinkedDevicesActivity" />
<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"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_margin="0dp"
android:background="@color/amber_50"
android:padding="0dp">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="10dp"
android:background="?pref_divider"/>
android:layout_width="match_parent"
android:layout_height="@dimen/medium_spacing"
android:background="@color/cell_background" />
</LinearLayout>

View File

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

View File

@ -140,6 +140,12 @@
<item name="android:textColor">@color/text</item>
<item name="android:elevation">20dp</item>
</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 -->
<style name="NoAnimation.Theme.BlackScreen" parent="Theme.AppCompat.NoActionBar">
@ -376,7 +382,6 @@
<item name="android:focusable">false</item>
</style>
<style name="PreferenceThemeOverlay.Fix" parent="PreferenceThemeOverlay.v14.Material">
</style>

View File

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

View File

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

View File

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

View File

@ -2,37 +2,39 @@
<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
android:key="pref_key_enable_notifications"
android:title="@string/preferences__notifications"
android:defaultValue="true" />
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:key="pref_key_enable_notifications"
android:title="@string/preferences__notifications"
android:defaultValue="true" />
<org.thoughtcrime.securesms.preferences.widgets.SignalListPreference
android:key="pref_notification_priority"
android:title="@string/preferences_notifications__priority"
android:dependency="pref_key_enable_notifications"
android:defaultValue="1"
android:entries="@array/pref_notification_priority_entries"
android:entryValues="@array/pref_notification_priority_values"/>
<org.thoughtcrime.securesms.preferences.widgets.SignalListPreference
android:key="pref_notification_priority"
android:title="@string/preferences_notifications__priority"
android:dependency="pref_key_enable_notifications"
android:defaultValue="1"
android:entries="@array/pref_notification_priority_entries"
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">
<org.thoughtcrime.securesms.preferences.widgets.SignalPreference
android:dependency="pref_key_enable_notifications"
android:key="pref_key_ringtone"
android:title="@string/preferences__sound"
android:persistent="false"
android:defaultValue="content://settings/system/notification_sound" />
android:dependency="pref_key_enable_notifications"
android:key="pref_key_ringtone"
android:title="@string/preferences__sound"
android:persistent="false"
android:defaultValue="content://settings/system/notification_sound" />
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:dependency="pref_key_enable_notifications"
android:key="pref_key_vibrate"
android:defaultValue="true"
android:title="@string/preferences__vibrate"/>
android:dependency="pref_key_enable_notifications"
android:key="pref_key_vibrate"
android:defaultValue="true"
android:title="@string/preferences__vibrate" />
<org.thoughtcrime.securesms.preferences.widgets.LEDColorListPreference
android:key="pref_led_color"
@ -51,32 +53,32 @@
android:entryValues="@array/pref_led_blink_pattern_values" />
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:key="pref_key_inthread_notifications"
android:title="@string/preferences_notifications__in_chat_sounds"
android:dependency="pref_key_enable_notifications"
android:defaultValue="true" />
android:key="pref_key_inthread_notifications"
android:title="@string/preferences_notifications__in_chat_sounds"
android:dependency="pref_key_enable_notifications"
android:defaultValue="true" />
<org.thoughtcrime.securesms.preferences.widgets.SignalListPreference
android:key="pref_repeat_alerts"
android:defaultValue="0"
android:title="@string/preferences__repeat_alerts"
android:dependency="pref_key_enable_notifications"
android:entries="@array/pref_repeat_alerts_entries"
android:entryValues="@array/pref_repeat_alerts_values" />
android:key="pref_repeat_alerts"
android:defaultValue="0"
android:title="@string/preferences__repeat_alerts"
android:dependency="pref_key_enable_notifications"
android:entries="@array/pref_repeat_alerts_entries"
android:entryValues="@array/pref_repeat_alerts_values" />
</PreferenceCategory>
<PreferenceCategory android:layout="@layout/preference_divider"/>
<PreferenceCategory android:layout="@layout/preference_divider" />
<PreferenceCategory android:title="@string/activity_notification_settings_content_section_title">
<org.thoughtcrime.securesms.preferences.widgets.SignalListPreference
android:key="pref_notification_privacy"
android:title="@string/preferences_notifications__show"
android:dependency="pref_key_enable_notifications"
android:defaultValue="all"
android:entries="@array/pref_notification_privacy_entries"
android:entryValues="@array/pref_notification_privacy_values"/>
android:key="pref_notification_privacy"
android:title="@string/preferences_notifications__show"
android:dependency="pref_key_enable_notifications"
android:defaultValue="all"
android:entries="@array/pref_notification_privacy_entries"
android:entryValues="@array/pref_notification_privacy_values" />
</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.ui.alwaysUi
import org.thoughtcrime.securesms.ApplicationContext
import org.thoughtcrime.securesms.ApplicationPreferencesActivity
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
import org.thoughtcrime.securesms.avatar.AvatarSelection
import org.thoughtcrime.securesms.crypto.ProfileKeyUtil
@ -89,6 +88,8 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
seedButton.visibility = View.GONE
}
privacyButton.setOnClickListener { showPrivacySettings() }
notificationsButton.setOnClickListener { showNotificationSettings() }
chatsButton.setOnClickListener { showChatSettings() }
seedButton.setOnClickListener { showSeed() }
clearAllDataButton.setOnClickListener { clearAllData() }
}
@ -250,7 +251,17 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
}
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)
}

View File

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

View File

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

View File

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