Skip to content

Commit

Permalink
Update Tchap preferences settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Renaud committed Dec 1, 2021
1 parent b8cdd3f commit 3039bb8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ class VectorPreferences @Inject constructor(private val context: Context) {
* @return true if the join and leave membership events should be shown in the messages list
*/
fun showJoinLeaveMessages(): Boolean {
return defaultPrefs.getBoolean(SETTINGS_SHOW_JOIN_LEAVE_MESSAGES_KEY, true)
return defaultPrefs.getBoolean(SETTINGS_SHOW_JOIN_LEAVE_MESSAGES_KEY, false)
}

/**
Expand All @@ -418,7 +418,7 @@ class VectorPreferences @Inject constructor(private val context: Context) {
* @return true true if the avatar and display name events should be shown in the messages list.
*/
fun showAvatarDisplayNameChangeMessages(): Boolean {
return defaultPrefs.getBoolean(SETTINGS_SHOW_AVATAR_DISPLAY_NAME_CHANGES_MESSAGES_KEY, true)
return defaultPrefs.getBoolean(SETTINGS_SHOW_AVATAR_DISPLAY_NAME_CHANGES_MESSAGES_KEY, false)
}

/**
Expand All @@ -443,7 +443,7 @@ class VectorPreferences @Inject constructor(private val context: Context) {
* Show all rooms in room directory
*/
fun showAllPublicRooms(): Boolean {
return defaultPrefs.getBoolean(SETTINGS_ROOM_DIRECTORY_SHOW_ALL_PUBLIC_ROOMS, false)
return defaultPrefs.getBoolean(SETTINGS_ROOM_DIRECTORY_SHOW_ALL_PUBLIC_ROOMS, true)
}

/**
Expand Down Expand Up @@ -839,7 +839,7 @@ class VectorPreferences @Inject constructor(private val context: Context) {
* @return true if the user wants to see URL previews in the timeline
*/
fun showUrlPreviews(): Boolean {
return defaultPrefs.getBoolean(SETTINGS_SHOW_URL_PREVIEW_KEY, true)
return defaultPrefs.getBoolean(SETTINGS_SHOW_URL_PREVIEW_KEY, false)
}

/**
Expand Down
18 changes: 11 additions & 7 deletions vector/src/main/res/xml/vector_settings_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,11 @@
<im.vector.app.core.preference.VectorPreferenceCategory android:title="@string/settings_category_timeline">

<im.vector.app.core.preference.VectorSwitchPreference
android:defaultValue="true"
android:defaultValue="false"
android:key="SETTINGS_SHOW_URL_PREVIEW_KEY"
android:summary="@string/settings_inline_url_preview_summary"
android:title="@string/settings_inline_url_preview" />
android:title="@string/settings_inline_url_preview"
app:isPreferenceVisible="false" />

<im.vector.app.core.preference.VectorSwitchPreference
android:key="SETTINGS_ALWAYS_SHOW_TIMESTAMPS_KEY"
Expand All @@ -106,13 +107,13 @@
android:title="@string/settings_show_redacted" />

<im.vector.app.core.preference.VectorSwitchPreference
android:defaultValue="true"
android:defaultValue="false"
android:key="SETTINGS_SHOW_JOIN_LEAVE_MESSAGES_KEY"
android:summary="@string/settings_show_join_leave_messages_summary"
android:title="@string/settings_show_join_leave_messages" />

<im.vector.app.core.preference.VectorSwitchPreference
android:defaultValue="true"
android:defaultValue="false"
android:key="SETTINGS_SHOW_AVATAR_DISPLAY_NAME_CHANGES_MESSAGES_KEY"
android:summary="@string/settings_show_avatar_display_name_changes_messages_summary"
android:title="@string/settings_show_avatar_display_name_changes_messages" />
Expand All @@ -124,14 +125,14 @@
android:title="@string/settings_chat_effects_title" />

<im.vector.app.core.preference.VectorSwitchPreference
android:defaultValue="true"
android:defaultValue="false"
android:key="SETTINGS_SHOW_JOIN_LEAVE_MESSAGES_KEY"
android:summary="@string/settings_show_join_leave_messages_summary"
android:title="@string/settings_show_join_leave_messages"
app:isPreferenceVisible="@bool/false_not_implemented" />

<im.vector.app.core.preference.VectorSwitchPreference
android:defaultValue="true"
android:defaultValue="false"
android:key="SETTINGS_SHOW_AVATAR_DISPLAY_NAME_CHANGES_MESSAGES_KEY"
android:summary="@string/settings_show_avatar_display_name_changes_messages_summary"
android:title="@string/settings_show_avatar_display_name_changes_messages"
Expand Down Expand Up @@ -202,9 +203,12 @@

</im.vector.app.core.preference.VectorPreferenceCategory>

<im.vector.app.core.preference.VectorPreferenceCategory android:title="@string/settings_category_room_directory">
<im.vector.app.core.preference.VectorPreferenceCategory
android:title="@string/settings_category_room_directory"
app:isPreferenceVisible="false">

<im.vector.app.core.preference.VectorSwitchPreference
android:defaultValue="true"
android:key="SETTINGS_ROOM_DIRECTORY_SHOW_ALL_PUBLIC_ROOMS"
android:summary="@string/settings_room_directory_show_all_rooms_summary"
android:title="@string/settings_room_directory_show_all_rooms" />
Expand Down

0 comments on commit 3039bb8

Please sign in to comment.