mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 19:38:08 +00:00
Added audio & video codecs settings in advanced parameters
This commit is contained in:
parent
4f6c5c7f48
commit
bf64b496c9
6 changed files with 362 additions and 74 deletions
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* Copyright (c) 2010-2024 Belledonne Communications SARL.
|
||||
*
|
||||
* This file is part of linphone-android
|
||||
* (see https://www.linphone.org).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.linphone.ui.main.settings.model
|
||||
|
||||
import androidx.annotation.UiThread
|
||||
import androidx.annotation.WorkerThread
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
|
||||
class CodecModel @WorkerThread constructor(
|
||||
val mimeType: String,
|
||||
val clockRate: Int,
|
||||
val recvFmtp: String?,
|
||||
val isAudioCodec: Boolean,
|
||||
enabled: Boolean,
|
||||
val onEnabledChanged: ((enabled: Boolean) -> Unit)
|
||||
) {
|
||||
val isEnabled = MutableLiveData<Boolean>()
|
||||
|
||||
val subtitle = MutableLiveData<String>()
|
||||
|
||||
init {
|
||||
isEnabled.postValue(enabled)
|
||||
if (isAudioCodec) {
|
||||
subtitle.postValue("$clockRate Hz")
|
||||
} else {
|
||||
subtitle.postValue(recvFmtp.orEmpty())
|
||||
}
|
||||
}
|
||||
|
||||
@UiThread
|
||||
fun toggleEnabled() {
|
||||
val newValue = isEnabled.value == false
|
||||
onEnabledChanged(newValue)
|
||||
isEnabled.postValue(newValue)
|
||||
}
|
||||
}
|
||||
|
|
@ -35,6 +35,7 @@ import org.linphone.core.VFS
|
|||
import org.linphone.core.tools.Log
|
||||
import org.linphone.ui.GenericViewModel
|
||||
import org.linphone.ui.main.settings.model.CardDavLdapModel
|
||||
import org.linphone.ui.main.settings.model.CodecModel
|
||||
import org.linphone.utils.AppUtils
|
||||
import org.linphone.utils.Event
|
||||
|
||||
|
|
@ -152,14 +153,20 @@ class SettingsViewModel @UiThread constructor() : GenericViewModel() {
|
|||
|
||||
val remoteProvisioningUrl = MutableLiveData<String>()
|
||||
|
||||
val expandAudioDevices = MutableLiveData<Boolean>()
|
||||
val inputAudioDeviceIndex = MutableLiveData<Int>()
|
||||
val inputAudioDeviceLabels = arrayListOf<String>()
|
||||
private val inputAudioDeviceValues = arrayListOf<AudioDevice>()
|
||||
|
||||
val outputAudioDeviceIndex = MutableLiveData<Int>()
|
||||
val outputAudioDeviceLabels = arrayListOf<String>()
|
||||
private val outputAudioDeviceValues = arrayListOf<AudioDevice>()
|
||||
|
||||
val expandAudioCodecs = MutableLiveData<Boolean>()
|
||||
val audioCodecs = MutableLiveData<List<CodecModel>>()
|
||||
|
||||
val expandVideoCodecs = MutableLiveData<Boolean>()
|
||||
val videoCodecs = MutableLiveData<List<CodecModel>>()
|
||||
|
||||
private val coreListener = object : CoreListenerStub() {
|
||||
override fun onAudioDevicesListUpdated(core: Core) {
|
||||
Log.i(
|
||||
|
|
@ -188,6 +195,9 @@ class SettingsViewModel @UiThread constructor() : GenericViewModel() {
|
|||
expandMeetings.value = false
|
||||
expandNetwork.value = false
|
||||
expandUserInterface.value = false
|
||||
expandAudioDevices.value = false
|
||||
expandAudioCodecs.value = false
|
||||
expandVideoCodecs.value = false
|
||||
|
||||
isVfsEnabled.value = VFS.isEnabled(coreContext.context)
|
||||
|
||||
|
|
@ -222,6 +232,7 @@ class SettingsViewModel @UiThread constructor() : GenericViewModel() {
|
|||
remoteProvisioningUrl.postValue(core.provisioningUri)
|
||||
|
||||
setupAudioDevices()
|
||||
setupCodecs()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -497,6 +508,11 @@ class SettingsViewModel @UiThread constructor() : GenericViewModel() {
|
|||
}
|
||||
}
|
||||
|
||||
@UiThread
|
||||
fun toggleAudioDevicesExpand() {
|
||||
expandAudioDevices.value = expandAudioDevices.value == false
|
||||
}
|
||||
|
||||
@UiThread
|
||||
fun setInputAudioDevice(index: Int) {
|
||||
coreContext.postOnCoreThread { core ->
|
||||
|
|
@ -527,6 +543,8 @@ class SettingsViewModel @UiThread constructor() : GenericViewModel() {
|
|||
Log.i("$TAG Current default input audio device is [${defaultInputAudioDevice?.id}]")
|
||||
for (audioDevice in core.extendedAudioDevices) {
|
||||
if (audioDevice.hasCapability(AudioDevice.Capabilities.CapabilityRecord)) {
|
||||
if (audioDevice.id.contains("deprecated")) continue
|
||||
|
||||
inputAudioDeviceLabels.add(audioDevice.id)
|
||||
inputAudioDeviceValues.add(audioDevice)
|
||||
if (audioDevice.id == defaultInputAudioDevice?.id) {
|
||||
|
|
@ -541,6 +559,8 @@ class SettingsViewModel @UiThread constructor() : GenericViewModel() {
|
|||
Log.i("$TAG Current default output audio device is [${defaultOutputAudioDevice?.id}]")
|
||||
for (audioDevice in core.extendedAudioDevices) {
|
||||
if (audioDevice.hasCapability(AudioDevice.Capabilities.CapabilityPlay)) {
|
||||
if (audioDevice.id.contains("deprecated")) continue
|
||||
|
||||
outputAudioDeviceLabels.add(audioDevice.id)
|
||||
outputAudioDeviceValues.add(audioDevice)
|
||||
if (audioDevice.id == defaultOutputAudioDevice?.id) {
|
||||
|
|
@ -550,4 +570,43 @@ class SettingsViewModel @UiThread constructor() : GenericViewModel() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@UiThread
|
||||
fun toggleAudioCodecsExpand() {
|
||||
expandAudioCodecs.value = expandAudioCodecs.value == false
|
||||
}
|
||||
|
||||
@UiThread
|
||||
fun toggleVideoCodecsExpand() {
|
||||
expandVideoCodecs.value = expandVideoCodecs.value == false
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
private fun setupCodecs() {
|
||||
val core = coreContext.core
|
||||
|
||||
val audioCodecsList = arrayListOf<CodecModel>()
|
||||
for (payload in core.audioPayloadTypes) {
|
||||
val model = CodecModel(
|
||||
payload.mimeType,
|
||||
payload.clockRate,
|
||||
null,
|
||||
true,
|
||||
payload.enabled()
|
||||
) { enabled ->
|
||||
payload.enable(enabled)
|
||||
}
|
||||
audioCodecsList.add(model)
|
||||
}
|
||||
audioCodecs.postValue(audioCodecsList)
|
||||
|
||||
val videoCodecsList = arrayListOf<CodecModel>()
|
||||
for (payload in core.videoPayloadTypes) {
|
||||
val model = CodecModel(payload.mimeType, -1, payload.recvFmtp, false, payload.enabled()) { enabled ->
|
||||
payload.enable(enabled)
|
||||
}
|
||||
videoCodecsList.add(model)
|
||||
}
|
||||
videoCodecs.postValue(videoCodecsList)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,92 +141,199 @@
|
|||
app:layout_constraintTop_toBottomOf="@id/remote_provisioning"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/header_style"
|
||||
android:id="@+id/input_audio_device_label"
|
||||
android:layout_width="wrap_content"
|
||||
style="@style/section_header_style"
|
||||
android:id="@+id/audio_devices_title"
|
||||
android:onClick="@{() -> viewModel.toggleAudioDevicesExpand()}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:padding="5dp"
|
||||
android:layout_marginStart="26dp"
|
||||
android:layout_marginEnd="26dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/settings_advanced_input_audio_device_title"
|
||||
android:text="@string/settings_advanced_audio_devices_title"
|
||||
android:drawableEnd="@{viewModel.expandAudioDevices ? @drawable/caret_up : @drawable/caret_down, default=@drawable/caret_up}"
|
||||
android:drawableTint="?attr/color_main2_600"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/download_and_apply"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatSpinner
|
||||
style="@style/default_text_style"
|
||||
android:id="@+id/input_audio_device"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/audio_devices"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/gray_main2_600"
|
||||
android:gravity="center_vertical"
|
||||
android:overlapAnchor="false"
|
||||
android:dropDownVerticalOffset="25dp"
|
||||
android:spinnerMode="dropdown"
|
||||
android:popupBackground="@drawable/shape_squircle_white_background"
|
||||
android:background="@drawable/edit_text_background"
|
||||
app:layout_constraintTop_toBottomOf="@id/input_audio_device_label"
|
||||
app:layout_constraintStart_toStartOf="@id/input_audio_device_label"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/input_audio_device_caret"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/caret_down"
|
||||
android:contentDescription="@null"
|
||||
app:layout_constraintTop_toTopOf="@id/input_audio_device"
|
||||
app:layout_constraintBottom_toBottomOf="@id/input_audio_device"
|
||||
app:layout_constraintEnd_toEndOf="@id/input_audio_device"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/header_style"
|
||||
android:id="@+id/output_audio_device_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/settings_advanced_output_audio_device_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/input_audio_device"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatSpinner
|
||||
style="@style/default_text_style"
|
||||
android:id="@+id/output_audio_device"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/gray_main2_600"
|
||||
android:gravity="center_vertical"
|
||||
android:overlapAnchor="false"
|
||||
android:dropDownVerticalOffset="25dp"
|
||||
android:spinnerMode="dropdown"
|
||||
android:popupBackground="@drawable/shape_squircle_white_background"
|
||||
android:background="@drawable/edit_text_background"
|
||||
app:layout_constraintTop_toBottomOf="@id/output_audio_device_label"
|
||||
app:layout_constraintStart_toStartOf="@id/output_audio_device_label"
|
||||
android:paddingBottom="16dp"
|
||||
android:background="@drawable/shape_squircle_white_background"
|
||||
android:orientation="vertical"
|
||||
android:visibility="@{viewModel.expandAudioDevices ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintTop_toBottomOf="@id/audio_devices_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/header_style"
|
||||
android:id="@+id/input_audio_device_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/settings_advanced_input_audio_device_title"
|
||||
android:visibility="@{viewModel.expandAudioDevices ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatSpinner
|
||||
style="@style/default_text_style"
|
||||
android:id="@+id/input_audio_device"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/gray_main2_600"
|
||||
android:gravity="center_vertical"
|
||||
android:overlapAnchor="false"
|
||||
android:dropDownVerticalOffset="2dp"
|
||||
android:spinnerMode="dropdown"
|
||||
android:popupBackground="@drawable/shape_squircle_white_background"
|
||||
android:background="@drawable/edit_text_background"
|
||||
android:visibility="@{viewModel.expandAudioDevices ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintTop_toBottomOf="@id/input_audio_device_label"
|
||||
app:layout_constraintStart_toStartOf="@id/input_audio_device_label"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/input_audio_device_caret"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/caret_down"
|
||||
android:contentDescription="@null"
|
||||
android:visibility="@{viewModel.expandAudioDevices ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintTop_toTopOf="@id/input_audio_device"
|
||||
app:layout_constraintBottom_toBottomOf="@id/input_audio_device"
|
||||
app:layout_constraintEnd_toEndOf="@id/input_audio_device"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/header_style"
|
||||
android:id="@+id/output_audio_device_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/settings_advanced_output_audio_device_title"
|
||||
android:visibility="@{viewModel.expandAudioDevices ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/input_audio_device"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatSpinner
|
||||
style="@style/default_text_style"
|
||||
android:id="@+id/output_audio_device"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/gray_main2_600"
|
||||
android:gravity="center_vertical"
|
||||
android:overlapAnchor="false"
|
||||
android:dropDownVerticalOffset="2dp"
|
||||
android:spinnerMode="dropdown"
|
||||
android:popupBackground="@drawable/shape_squircle_white_background"
|
||||
android:background="@drawable/edit_text_background"
|
||||
android:visibility="@{viewModel.expandAudioDevices ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintTop_toBottomOf="@id/output_audio_device_label"
|
||||
app:layout_constraintStart_toStartOf="@id/output_audio_device_label"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/output_audio_device_caret"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/caret_down"
|
||||
android:contentDescription="@null"
|
||||
android:visibility="@{viewModel.expandAudioDevices ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintTop_toTopOf="@id/output_audio_device"
|
||||
app:layout_constraintBottom_toBottomOf="@id/output_audio_device"
|
||||
app:layout_constraintEnd_toEndOf="@id/output_audio_device"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/section_header_style"
|
||||
android:id="@+id/audio_codecs_title"
|
||||
android:onClick="@{() -> viewModel.toggleAudioCodecsExpand()}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="5dp"
|
||||
android:layout_marginStart="26dp"
|
||||
android:layout_marginEnd="26dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/settings_advanced_audio_codecs_title"
|
||||
android:drawableEnd="@{viewModel.expandAudioCodecs ? @drawable/caret_up : @drawable/caret_down, default=@drawable/caret_up}"
|
||||
android:drawableTint="?attr/color_main2_600"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/audio_devices"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/audio_codecs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="16dp"
|
||||
android:background="@drawable/shape_squircle_white_background"
|
||||
android:visibility="@{viewModel.expandAudioCodecs ? View.VISIBLE : View.GONE}"
|
||||
entries="@{viewModel.audioCodecs}"
|
||||
layout="@{@layout/settings_codec_list_cell}"
|
||||
app:layout_constraintTop_toBottomOf="@id/audio_codecs_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/output_audio_device_caret"
|
||||
android:layout_width="wrap_content"
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/section_header_style"
|
||||
android:id="@+id/video_codecs_title"
|
||||
android:onClick="@{() -> viewModel.toggleVideoCodecsExpand()}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="5dp"
|
||||
android:layout_marginStart="26dp"
|
||||
android:layout_marginEnd="26dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/settings_advanced_video_codecs_title"
|
||||
android:drawableEnd="@{viewModel.expandVideoCodecs ? @drawable/caret_up : @drawable/caret_down, default=@drawable/caret_up}"
|
||||
android:drawableTint="?attr/color_main2_600"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/audio_codecs"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/video_codecs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/caret_down"
|
||||
android:contentDescription="@null"
|
||||
app:layout_constraintTop_toTopOf="@id/output_audio_device"
|
||||
app:layout_constraintBottom_toBottomOf="@id/output_audio_device"
|
||||
app:layout_constraintEnd_toEndOf="@id/output_audio_device"/>
|
||||
android:layout_marginBottom="@dimen/screen_bottom_margin"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="16dp"
|
||||
android:background="@drawable/shape_squircle_white_background"
|
||||
android:visibility="@{viewModel.expandVideoCodecs ? View.VISIBLE : View.GONE}"
|
||||
entries="@{viewModel.videoCodecs}"
|
||||
layout="@{@layout/settings_codec_list_cell}"
|
||||
app:layout_constraintTop_toBottomOf="@id/video_codecs_title"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
|
|
|||
63
app/src/main/res/layout/settings_codec_list_cell.xml
Normal file
63
app/src/main/res/layout/settings_codec_list_cell.xml
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View" />
|
||||
<variable
|
||||
name="model"
|
||||
type="org.linphone.ui.main.settings.model.CodecModel" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/settings_title_style"
|
||||
android:onClick="@{() -> model.toggleEnabled()}"
|
||||
android:id="@+id/codec_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="@{model.mimeType, default=`Opus`}"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_constraintTop_toTopOf="@id/codec_switch"
|
||||
app:layout_constraintBottom_toTopOf="@id/codec_subtitle"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/codec_switch"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/settings_subtitle_style"
|
||||
android:onClick="@{() -> model.toggleEnabled()}"
|
||||
android:id="@+id/codec_subtitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="@{model.subtitle, default=`48000 Hz`}"
|
||||
android:visibility="@{model.subtitle.isEmpty() ? View.GONE : View.VISIBLE}"
|
||||
app:layout_constraintTop_toBottomOf="@id/codec_title"
|
||||
app:layout_constraintBottom_toBottomOf="@id/codec_switch"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/codec_switch"/>
|
||||
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
style="@style/material_switch_style"
|
||||
android:id="@+id/codec_switch"
|
||||
android:onClick="@{() -> model.toggleEnabled()}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:checked="@{model.enabled}"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
|
|
@ -278,8 +278,11 @@
|
|||
<string name="settings_advanced_keep_alive_service_title">Garder l\'app en vie via un Service</string>
|
||||
<string name="settings_advanced_remote_provisioning_url">URL de configuration distante</string>
|
||||
<string name="settings_advanced_download_apply_remote_provisioning">Télécharger & appliquer</string>
|
||||
<string name="settings_advanced_audio_devices_title">Périphériques audio</string>
|
||||
<string name="settings_advanced_input_audio_device_title">Périphérique de capture par défaut</string>
|
||||
<string name="settings_advanced_output_audio_device_title">Périphérique d\'écoute par défaut</string>
|
||||
<string name="settings_advanced_audio_codecs_title">Codecs audio</string>
|
||||
<string name="settings_advanced_video_codecs_title">Codecs vidéo</string>
|
||||
|
||||
<!-- Account profile & settings -->
|
||||
<string name="manage_account_title">Votre compte</string>
|
||||
|
|
|
|||
|
|
@ -313,8 +313,11 @@
|
|||
<string name="settings_advanced_keep_alive_service_title">Keep app alive using Service</string>
|
||||
<string name="settings_advanced_remote_provisioning_url">Remote provisioning URL</string>
|
||||
<string name="settings_advanced_download_apply_remote_provisioning">Download & apply</string>
|
||||
<string name="settings_advanced_audio_devices_title">Audio devices</string>
|
||||
<string name="settings_advanced_input_audio_device_title">Default input audio device</string>
|
||||
<string name="settings_advanced_output_audio_device_title">Default output audio device</string>
|
||||
<string name="settings_advanced_audio_codecs_title">Audio codecs</string>
|
||||
<string name="settings_advanced_video_codecs_title">Video codecs</string>
|
||||
|
||||
<!-- Account profile & settings -->
|
||||
<string name="manage_account_title">Manage account</string>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue