Added back IPv6 network setting

This commit is contained in:
Sylvain Berfini 2024-06-18 11:52:04 +02:00
parent b3464433ed
commit e80c0e6068
5 changed files with 44 additions and 1 deletions

View file

@ -203,7 +203,9 @@ class TelecomCallControlCallback(
if (result is CallControlResult.Error) {
Log.e("$TAG Failed to change endpoint audio device, error [$result]")
} else {
Log.i("$TAG It took [$attempts] attempt(s) to change endpoint audio device...")
Log.i(
"$TAG It took [$attempts] attempt(s) to change endpoint audio device..."
)
}
}

View file

@ -118,6 +118,7 @@ class SettingsViewModel @UiThread constructor() : GenericViewModel() {
// Network settings
val useWifiOnly = MutableLiveData<Boolean>()
val allowIpv6 = MutableLiveData<Boolean>()
// User Interface settings
val showThemeSelector = MutableLiveData<Boolean>()
@ -234,6 +235,7 @@ class SettingsViewModel @UiThread constructor() : GenericViewModel() {
autoRecordCalls.postValue(corePreferences.automaticallyStartCallRecording)
useWifiOnly.postValue(core.isWifiOnlyEnabled)
allowIpv6.postValue(core.isIpv6Enabled)
autoDownloadEnabled.postValue(core.maxSizeForAutoDownloadIncomingFiles == 0)
@ -443,6 +445,15 @@ class SettingsViewModel @UiThread constructor() : GenericViewModel() {
}
}
@UiThread
fun toggleIpv6() {
val newValue = allowIpv6.value == false
coreContext.postOnCoreThread { core ->
core.isIpv6Enabled = newValue
allowIpv6.postValue(newValue)
}
}
@UiThread
fun toggleUserInterfaceExpand() {
expandUserInterface.value = expandUserInterface.value == false

View file

@ -44,6 +44,34 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/settings_title_style"
android:onClick="@{() -> viewModel.toggleIpv6()}"
android:id="@+id/ipv6_enabled_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="10dp"
android:text="@string/settings_network_allow_ipv6"
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintTop_toTopOf="@id/ipv6_enabled_switch"
app:layout_constraintBottom_toBottomOf="@id/ipv6_enabled_switch"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/ipv6_enabled_switch"/>
<com.google.android.material.materialswitch.MaterialSwitch
style="@style/material_switch_style"
android:id="@+id/ipv6_enabled_switch"
android:onClick="@{() -> viewModel.toggleIpv6()}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:checked="@{viewModel.allowIpv6}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/wifi_only_switch" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View file

@ -223,6 +223,7 @@
<string name="settings_meetings_layout_mosaic_label">Mosaïque</string>
<string name="settings_network_title">Réseau</string>
<string name="settings_network_use_wifi_only">Se connecter uniquement via le Wi-Fi</string>
<string name="settings_network_allow_ipv6">Autoriser l\'IPv6</string>
<string name="settings_user_interface_title">Affichage</string>
<string name="settings_user_interface_theme_title">Thème</string>
<string name="settings_user_interface_dark_theme_label">Sombre</string>

View file

@ -259,6 +259,7 @@
<string name="settings_meetings_layout_mosaic_label">Mosaic</string>
<string name="settings_network_title">Network</string>
<string name="settings_network_use_wifi_only">Use only Wi-Fi networks</string>
<string name="settings_network_allow_ipv6">Allow IPv6</string>
<string name="settings_user_interface_title">User interface</string>
<string name="settings_user_interface_theme_title">Theme</string>
<string name="settings_user_interface_dark_theme_label">Dark theme</string>