Voice Broadcast - Move Android API check on fragment

This commit is contained in:
Florian Renaud 2022-10-18 21:06:59 +02:00
parent 63c02c6fef
commit 90803be3ee
3 changed files with 4 additions and 15 deletions

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- This file contains values to show or hide some settings, and default values for some settings
- boolean keys ending with "_visible" set the visibility of the setting
- boolean keys ending with "_default" set the default value of the setting
When a setting is hidden, the default value still applies
-->
<!-- Level 1: Labs -->
<bool name="settings_labs_enable_voice_broadcast_visible">true</bool>
</resources>

View file

@ -49,7 +49,7 @@
<bool name="settings_timeline_show_live_sender_info_default">false</bool> <bool name="settings_timeline_show_live_sender_info_default">false</bool>
<bool name="settings_labs_rich_text_editor_visible">true</bool> <bool name="settings_labs_rich_text_editor_visible">true</bool>
<bool name="settings_labs_rich_text_editor_default">false</bool> <bool name="settings_labs_rich_text_editor_default">false</bool>
<bool name="settings_labs_enable_voice_broadcast_visible">false</bool> <!-- Note: also defined in values-v29 --> <bool name="settings_labs_enable_voice_broadcast_visible">true</bool>
<bool name="settings_labs_enable_voice_broadcast_default">false</bool> <bool name="settings_labs_enable_voice_broadcast_default">false</bool>
<!-- Level 1: Advanced settings --> <!-- Level 1: Advanced settings -->

View file

@ -16,6 +16,7 @@
package im.vector.app.features.settings.labs package im.vector.app.features.settings.labs
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.text.method.LinkMovementMethod import android.text.method.LinkMovementMethod
import android.widget.TextView import android.widget.TextView
@ -91,7 +92,8 @@ class VectorSettingsLabsFragment :
} }
findPreference<VectorSwitchPreference>(VectorPreferences.SETTINGS_LABS_VOICE_BROADCAST_KEY)?.let { pref -> findPreference<VectorSwitchPreference>(VectorPreferences.SETTINGS_LABS_VOICE_BROADCAST_KEY)?.let { pref ->
pref.isVisible = vectorFeatures.isVoiceBroadcastEnabled() // Voice Broadcast recording is not available on Android < 10
pref.isVisible = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && vectorFeatures.isVoiceBroadcastEnabled()
} }
configureUnreadNotificationsAsTabPreference() configureUnreadNotificationsAsTabPreference()