Skip to content

Commit

Permalink
Merge pull request #277 from tchapgouv/fre/preferences_settings
Browse files Browse the repository at this point in the history
[Settings] Adjust Preferences
  • Loading branch information
Florian14 authored Dec 3, 2021
2 parents 22f8b60 + 9a52966 commit c77654f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 23 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
28 changes: 9 additions & 19 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 @@ -123,20 +124,6 @@
android:summary="@string/settings_chat_effects_description"
android:title="@string/settings_chat_effects_title" />

<im.vector.app.core.preference.VectorSwitchPreference
android:defaultValue="true"
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: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"
app:isPreferenceVisible="@bool/false_not_implemented" />

<im.vector.app.core.preference.VectorSwitchPreference
android:key="SETTINGS_VIBRATE_ON_MENTION_KEY"
android:title="@string/settings_vibrate_on_mention"
Expand Down Expand Up @@ -202,9 +189,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 c77654f

Please sign in to comment.