Hide StaticImage camera in video settings
This commit is contained in:
parent
16b5ff4ee5
commit
4e375754ed
3 changed files with 19 additions and 3 deletions
|
@ -25,6 +25,7 @@ import org.linphone.LinphoneApplication.Companion.coreContext
|
||||||
import org.linphone.R
|
import org.linphone.R
|
||||||
import org.linphone.activities.main.settings.SettingListenerStub
|
import org.linphone.activities.main.settings.SettingListenerStub
|
||||||
import org.linphone.core.Factory
|
import org.linphone.core.Factory
|
||||||
|
import org.linphone.core.tools.Log
|
||||||
|
|
||||||
class VideoSettingsViewModel : GenericSettingsViewModel() {
|
class VideoSettingsViewModel : GenericSettingsViewModel() {
|
||||||
val enableVideoListener = object : SettingListenerStub() {
|
val enableVideoListener = object : SettingListenerStub() {
|
||||||
|
@ -122,11 +123,23 @@ class VideoSettingsViewModel : GenericSettingsViewModel() {
|
||||||
private fun initCameraDevicesList() {
|
private fun initCameraDevicesList() {
|
||||||
val labels = arrayListOf<String>()
|
val labels = arrayListOf<String>()
|
||||||
for (camera in core.videoDevicesList) {
|
for (camera in core.videoDevicesList) {
|
||||||
labels.add(camera)
|
if (prefs.hideStaticImageCamera && camera.startsWith("StaticImage")) {
|
||||||
|
Log.w("[Video Settings] Do not display StaticImage camera")
|
||||||
|
} else {
|
||||||
|
labels.add(camera)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cameraDeviceLabels.value = labels
|
cameraDeviceLabels.value = labels
|
||||||
cameraDeviceIndex.value = labels.indexOf(core.videoDevice)
|
val index = labels.indexOf(core.videoDevice)
|
||||||
|
if (index == -1) {
|
||||||
|
val firstDevice = cameraDeviceLabels.value.orEmpty().firstOrNull()
|
||||||
|
Log.w("[Video Settings] Device not found in labels list: ${core.videoDevice}, replace it by $firstDevice")
|
||||||
|
cameraDeviceIndex.value = 0
|
||||||
|
core.videoDevice = firstDevice
|
||||||
|
} else {
|
||||||
|
cameraDeviceIndex.value = index
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initVideoSizeList() {
|
private fun initVideoSizeList() {
|
||||||
|
|
|
@ -84,6 +84,9 @@ class CorePreferences constructor(private val context: Context) {
|
||||||
get() = config.getBool("app", "video_preview", false)
|
get() = config.getBool("app", "video_preview", false)
|
||||||
set(value) = config.setBool("app", "video_preview", value)
|
set(value) = config.setBool("app", "video_preview", value)
|
||||||
|
|
||||||
|
val hideStaticImageCamera: Boolean
|
||||||
|
get() = config.getBool("app", "hide_static_image_camera", true)
|
||||||
|
|
||||||
/* Chat */
|
/* Chat */
|
||||||
|
|
||||||
var makePublicDownloadedImages: Boolean
|
var makePublicDownloadedImages: Boolean
|
||||||
|
|
|
@ -12,7 +12,7 @@ buildscript {
|
||||||
|
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.6.2'
|
classpath 'com.android.tools.build:gradle:3.6.3'
|
||||||
classpath 'com.google.gms:google-services:4.3.3'
|
classpath 'com.google.gms:google-services:4.3.3'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath "org.jlleitschuh.gradle:ktlint-gradle:9.1.1"
|
classpath "org.jlleitschuh.gradle:ktlint-gradle:9.1.1"
|
||||||
|
|
Loading…
Reference in a new issue