Possibility to hide start call buttons from the toolbar

Change-Id: Ica35e0dfd6b82beb90754dd5997fa0d756d816a5
This commit is contained in:
SpiritCroc 2022-03-15 20:18:33 +01:00
parent 5bdb6a5dfd
commit 31c01c98de
5 changed files with 19 additions and 2 deletions

View File

@ -27,6 +27,7 @@ Here you can find some extra features and changes compared to Element Android (w
- Smaller compose area (as before Element 1.0.12)
- Compose area: emoji button on the left, attachments button on the right (flipped compared to Element, but what most other messengers do, thus more familiar to most users)
- Setting to re-alert for new messages even if there's still an old notification for that room
- Setting to hide start call buttons from the room's toolbar
- Branding (name, app icon, links)
- Show a toast instead of a snackbar after copying text, in order to not block the input area right after copying

View File

@ -728,8 +728,8 @@ class TimelineViewModel @AssistedInject constructor(
R.id.timeline_setting -> false // replaced by show_room_info (downstream)
R.id.invite -> false // state.canInvite // SC: disabled, we can do that over show_participants as well
R.id.open_matrix_apps -> session.integrationManagerService().isIntegrationEnabled()
R.id.voice_call -> state.isWebRTCCallOptionAvailable()
R.id.video_call -> state.isWebRTCCallOptionAvailable() || state.jitsiState.confId == null || state.jitsiState.hasJoined
R.id.voice_call -> !vectorPreferences.hideCallButtons() && state.isWebRTCCallOptionAvailable()
R.id.video_call -> !vectorPreferences.hideCallButtons() && (state.isWebRTCCallOptionAvailable() || state.jitsiState.confId == null || state.jitsiState.hasJoined)
// Show Join conference button only if there is an active conf id not joined. Otherwise fallback to default video disabled. ^
R.id.join_conference -> !state.isWebRTCCallOptionAvailable() && state.jitsiState.confId != null && !state.jitsiState.hasJoined
R.id.search -> state.isSearchAvailable()

View File

@ -216,6 +216,7 @@ class VectorPreferences @Inject constructor(private val context: Context, privat
private const val SETTINGS_SPACE_MEMBERS_IN_SPACE_ROOMS = "SETTINGS_SPACE_MEMBERS_IN_SPACE_ROOMS"
private const val SETTINGS_ENABLE_SPACE_PAGER = "SETTINGS_ENABLE_SPACE_PAGER"
private const val SETTINGS_NOTIF_ONLY_ALERT_ONCE = "SETTINGS_NOTIF_ONLY_ALERT_ONCE"
private const val SETTINGS_HIDE_CALL_BUTTONS = "SETTINGS_HIDE_CALL_BUTTONS"
private const val DID_ASK_TO_ENABLE_SESSION_PUSH = "DID_ASK_TO_ENABLE_SESSION_PUSH"
@ -1083,6 +1084,11 @@ class VectorPreferences @Inject constructor(private val context: Context, privat
return defaultPrefs.getBoolean(SETTINGS_NOTIF_ONLY_ALERT_ONCE, true)
}
// SC addition
fun hideCallButtons(): Boolean {
return defaultPrefs.getBoolean(SETTINGS_HIDE_CALL_BUTTONS, false)
}
/**
* 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

View File

@ -165,6 +165,8 @@
<string name="settings_notif_only_alert_once">Only alert once</string>
<string name="settings_notif_only_alert_once_summary">Omit alert sounds for new messages if there is already an open notification for that chat</string>
<string name="settings_hide_call_buttons">Hide call buttons</string>
<string name="settings_hide_call_buttons_summary">Never show buttons in the room toolbar to start voice or video calls</string>
<!-- Default notification rule -->
<string name="room_settings_default">Default</string>

View File

@ -6,10 +6,18 @@
<im.vector.app.core.preference.VectorSwitchPreference
android:defaultValue="true"
android:dependency="SETTINGS_HIDE_CALL_BUTTONS"
android:key="SETTINGS_CALL_PREVENT_ACCIDENTAL_CALL_KEY"
android:summary="@string/settings_call_show_confirmation_dialog_summary"
android:title="@string/settings_call_show_confirmation_dialog_title" />
<im.vector.app.core.preference.VectorSwitchPreference
android:defaultValue="false"
android:disableDependentsState="true"
android:key="SETTINGS_HIDE_CALL_BUTTONS"
android:title="@string/settings_hide_call_buttons"
android:summary="@string/settings_hide_call_buttons_summary" />
<im.vector.app.core.preference.VectorSwitchPreference
android:defaultValue="true"
android:disableDependentsState="true"