Add setting to disable member click to mention
Change-Id: I2d6660baaa31f74fd0217262bf887da16a61c9b3
This commit is contained in:
parent
8e97b7c79d
commit
1d62cd09d2
|
@ -207,4 +207,7 @@
|
||||||
<string name="in_reply_to_loading">Loading replied-to message…</string>
|
<string name="in_reply_to_loading">Loading replied-to message…</string>
|
||||||
<string name="in_reply_to_error">Failed to load replied-to message</string>
|
<string name="in_reply_to_error">Failed to load replied-to message</string>
|
||||||
|
|
||||||
|
<string name="settings_enable_member_name_click">Clickable names</string>
|
||||||
|
<string name="settings_enable_member_name_click_summary">Click on a username to mention them</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -1881,7 +1881,9 @@ class TimelineFragment :
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onMemberNameClicked(informationData: MessageInformationData) {
|
override fun onMemberNameClicked(informationData: MessageInformationData) {
|
||||||
messageComposerViewModel.handle(MessageComposerAction.InsertUserDisplayName(informationData.senderId))
|
if (vectorPreferences.enableMemberNameClick()) {
|
||||||
|
messageComposerViewModel.handle(MessageComposerAction.InsertUserDisplayName(informationData.senderId))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onClickOnReactionPill(informationData: MessageInformationData, reaction: String, on: Boolean) {
|
override fun onClickOnReactionPill(informationData: MessageInformationData, reaction: String, on: Boolean) {
|
||||||
|
|
|
@ -259,6 +259,7 @@ class VectorPreferences @Inject constructor(
|
||||||
const val SETTINGS_FORCE_ALLOW_BACKGROUND_SYNC = "SETTINGS_FORCE_ALLOW_BACKGROUND_SYNC"
|
const val SETTINGS_FORCE_ALLOW_BACKGROUND_SYNC = "SETTINGS_FORCE_ALLOW_BACKGROUND_SYNC"
|
||||||
const val SETTINGS_ROOM_SORT_ORDER_NULL = "SETTINGS_ROOM_SORT_ORDER_NULL"
|
const val SETTINGS_ROOM_SORT_ORDER_NULL = "SETTINGS_ROOM_SORT_ORDER_NULL"
|
||||||
const val SETTINGS_ROOM_SORT_ORDER_NON_NULL = "SETTINGS_ROOM_SORT_ORDER_NON_NULL"
|
const val SETTINGS_ROOM_SORT_ORDER_NON_NULL = "SETTINGS_ROOM_SORT_ORDER_NON_NULL"
|
||||||
|
private const val SETTINGS_ENABLE_MEMBER_NAME_CLICK = "SETTINGS_ENABLE_MEMBER_NAME_CLICK"
|
||||||
|
|
||||||
private const val DID_ASK_TO_ENABLE_SESSION_PUSH = "DID_ASK_TO_ENABLE_SESSION_PUSH"
|
private const val DID_ASK_TO_ENABLE_SESSION_PUSH = "DID_ASK_TO_ENABLE_SESSION_PUSH"
|
||||||
|
|
||||||
|
@ -1216,14 +1217,22 @@ class VectorPreferences @Inject constructor(
|
||||||
return defaultPrefs.getBoolean(SETTINGS_SHOW_OPEN_ANONYMOUS, false)
|
return defaultPrefs.getBoolean(SETTINGS_SHOW_OPEN_ANONYMOUS, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SC addition
|
||||||
fun floatingDate(): Boolean {
|
fun floatingDate(): Boolean {
|
||||||
return defaultPrefs.getBoolean(SETTINGS_FLOATING_DATE, true)
|
return defaultPrefs.getBoolean(SETTINGS_FLOATING_DATE, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SC addition
|
||||||
fun spaceBackNavigation(): Boolean {
|
fun spaceBackNavigation(): Boolean {
|
||||||
return defaultPrefs.getBoolean(SETTINGS_SPACE_BACK_NAVIGATION, false)
|
return defaultPrefs.getBoolean(SETTINGS_SPACE_BACK_NAVIGATION, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SC addition
|
||||||
|
fun enableMemberNameClick(): Boolean {
|
||||||
|
return defaultPrefs.getBoolean(SETTINGS_ENABLE_MEMBER_NAME_CLICK, true)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* I likely do more fresh installs of the app than anyone else, so a shortcut to change some of the default settings to
|
* I likely do more fresh installs of the app than anyone else, so a shortcut to change some of the default settings to
|
||||||
* my preferred values can safe me some time
|
* my preferred values can safe me some time
|
||||||
|
@ -1250,6 +1259,7 @@ class VectorPreferences @Inject constructor(
|
||||||
.putBoolean(SETTINGS_SHOW_OPEN_ANONYMOUS, true)
|
.putBoolean(SETTINGS_SHOW_OPEN_ANONYMOUS, true)
|
||||||
.putBoolean(SETTINGS_FLOATING_DATE, true)
|
.putBoolean(SETTINGS_FLOATING_DATE, true)
|
||||||
.putBoolean(SETTINGS_FOLLOW_SYSTEM_LOCALE, true)
|
.putBoolean(SETTINGS_FOLLOW_SYSTEM_LOCALE, true)
|
||||||
|
.putBoolean(SETTINGS_ENABLE_MEMBER_NAME_CLICK, false)
|
||||||
.apply()
|
.apply()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -272,6 +272,12 @@
|
||||||
android:title="@string/settings_vibrate_on_mention"
|
android:title="@string/settings_vibrate_on_mention"
|
||||||
app:isPreferenceVisible="@bool/false_not_implemented" />
|
app:isPreferenceVisible="@bool/false_not_implemented" />
|
||||||
|
|
||||||
|
<im.vector.app.core.preference.VectorSwitchPreference
|
||||||
|
android:key="SETTINGS_ENABLE_MEMBER_NAME_CLICK"
|
||||||
|
android:title="@string/settings_enable_member_name_click"
|
||||||
|
android:summary="@string/settings_enable_member_name_click_summary"
|
||||||
|
android:defaultValue="true" />
|
||||||
|
|
||||||
<im.vector.app.core.preference.VectorSwitchPreference
|
<im.vector.app.core.preference.VectorSwitchPreference
|
||||||
android:key="SETTINGS_FLOATING_DATE"
|
android:key="SETTINGS_FLOATING_DATE"
|
||||||
android:title="@string/settings_floating_date"
|
android:title="@string/settings_floating_date"
|
||||||
|
|
Loading…
Reference in New Issue