mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-16 12:00:03 +03:00
Bring back setting to disable voice message recorder button
Change-Id: I81d647796b82e2034383278da7b169795a092f2e
This commit is contained in:
parent
033c3f7792
commit
8892248071
4 changed files with 19 additions and 4 deletions
|
@ -989,7 +989,7 @@ class RoomDetailFragment @Inject constructor(
|
|||
autoCompleter.exitSpecialMode()
|
||||
views.composerLayout.collapse()
|
||||
|
||||
views.voiceMessageRecorderView.isVisible = text.isBlank()
|
||||
views.voiceMessageRecorderView.isVisible = text.isBlank() && vectorPreferences.useVoiceMessage()
|
||||
|
||||
updateComposerText(text)
|
||||
views.composerLayout.views.sendButton.contentDescription = getString(R.string.send)
|
||||
|
@ -1330,7 +1330,7 @@ class RoomDetailFragment @Inject constructor(
|
|||
}
|
||||
|
||||
override fun onTextBlankStateChanged(isBlank: Boolean) {
|
||||
if (!views.composerLayout.views.sendButton.isVisible) {
|
||||
if (!views.composerLayout.views.sendButton.isVisible && vectorPreferences.useVoiceMessage()) {
|
||||
// Animate alpha to prevent overlapping with the animation of the send button
|
||||
views.voiceMessageRecorderView.alpha = 0f
|
||||
views.voiceMessageRecorderView.isVisible = true
|
||||
|
@ -1403,10 +1403,10 @@ class RoomDetailFragment @Inject constructor(
|
|||
if (state.canSendMessage) {
|
||||
if (!views.voiceMessageRecorderView.isActive()) {
|
||||
views.composerLayout.isVisible = true
|
||||
views.voiceMessageRecorderView.isVisible = views.composerLayout.text?.isBlank().orFalse()
|
||||
views.voiceMessageRecorderView.isVisible = vectorPreferences.useVoiceMessage() && views.composerLayout.text?.isBlank().orFalse()
|
||||
views.composerLayout.setRoomEncrypted(summary.isEncrypted)
|
||||
views.notificationAreaView.render(NotificationAreaView.State.Hidden)
|
||||
views.composerLayout.alwaysShowSendButton = false
|
||||
views.composerLayout.alwaysShowSendButton = !vectorPreferences.useVoiceMessage()
|
||||
}
|
||||
} else {
|
||||
views.composerLayout.isVisible = false
|
||||
|
|
|
@ -202,6 +202,7 @@ class VectorPreferences @Inject constructor(private val context: Context) {
|
|||
private const val SETTINGS_USER_COLOR_MODE_DEFAULT = "SETTINGS_USER_COLOR_MODE_DEFAULT"
|
||||
private const val SETTINGS_USER_COLOR_MODE_PUBLIC_ROOM = "SETTINGS_USER_COLOR_MODE_PUBLIC_ROOM"
|
||||
private const val SETTINGS_OPEN_CHATS_AT_FIRST_UNREAD = "SETTINGS_OPEN_CHATS_AT_FIRST_UNREAD"
|
||||
private const val SETTINGS_VOICE_MESSAGE = "SETTINGS_VOICE_MESSAGE"
|
||||
|
||||
private const val DID_ASK_TO_ENABLE_SESSION_PUSH = "DID_ASK_TO_ENABLE_SESSION_PUSH"
|
||||
|
||||
|
@ -1001,6 +1002,11 @@ class VectorPreferences @Inject constructor(private val context: Context) {
|
|||
return defaultPrefs.getBoolean(SETTINGS_OPEN_CHATS_AT_FIRST_UNREAD, false)
|
||||
}
|
||||
|
||||
// Element removed this, SC added it back (but this time, default to true)
|
||||
fun useVoiceMessage(): Boolean {
|
||||
return defaultPrefs.getBoolean(SETTINGS_VOICE_MESSAGE, true)
|
||||
}
|
||||
|
||||
/**
|
||||
* The user enable protecting app access with pin code.
|
||||
* Currently we use the pin code store to know if the pin is enabled, so this is not used
|
||||
|
|
|
@ -87,6 +87,9 @@
|
|||
<string name="settings_open_chats_at_first_unread">Open at first unread</string>
|
||||
<string name="settings_open_chats_at_first_unread_summary">Open chats at the first unread message instead of at the bottom.</string>
|
||||
|
||||
<string name="settings_show_voice_message_recorder_ui">Voice messages</string>
|
||||
<string name="settings_show_voice_message_recorder_ui_summary">Show a button to record voice messages</string>
|
||||
|
||||
<!-- Accent colors -->
|
||||
<string name="sc_accent_greenlight">Light green</string>
|
||||
<string name="sc_accent_greendark">Dark green</string>
|
||||
|
|
|
@ -63,6 +63,12 @@
|
|||
android:key="SETTINGS_LABS_ENABLE_SWIPE_TO_REPLY"
|
||||
android:title="@string/labs_swipe_to_reply_in_timeline" />
|
||||
|
||||
<im.vector.app.core.preference.VectorSwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="SETTINGS_VOICE_MESSAGE"
|
||||
android:title="@string/settings_show_voice_message_recorder_ui"
|
||||
android:summary="@string/settings_show_voice_message_recorder_ui_summary" />
|
||||
|
||||
<im.vector.app.core.preference.VectorSwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="SETTINGS_LABS_UNREAD_NOTIFICATIONS_AS_TAB"
|
||||
|
|
Loading…
Add table
Reference in a new issue