mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Added setting to allow to switch to fullscreen automatically when a video call is answered (disabled by default)
This commit is contained in:
parent
59eb436423
commit
163e2adfde
2 changed files with 19 additions and 3 deletions
|
|
@ -29,6 +29,7 @@ import androidx.constraintlayout.widget.ConstraintSet
|
|||
import androidx.navigation.navGraphViewModels
|
||||
import androidx.window.layout.FoldingFeature
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
import org.linphone.R
|
||||
import org.linphone.activities.*
|
||||
import org.linphone.activities.main.MainActivity
|
||||
|
|
@ -78,12 +79,21 @@ class SingleCallFragment : GenericVideoPreviewFragment<VoipSingleCallFragmentBin
|
|||
|
||||
callsViewModel.currentCallData.observe(
|
||||
viewLifecycleOwner
|
||||
) {
|
||||
if (it != null) {
|
||||
) { callData ->
|
||||
if (callData != null) {
|
||||
val call = callData.call
|
||||
|
||||
val timer = binding.root.findViewById<Chronometer>(R.id.active_call_timer)
|
||||
timer.base =
|
||||
SystemClock.elapsedRealtime() - (1000 * it.call.duration) // Linphone timestamps are in seconds
|
||||
SystemClock.elapsedRealtime() - (1000 * call.duration) // Linphone timestamps are in seconds
|
||||
timer.start()
|
||||
|
||||
if (corePreferences.enableFullScreenWhenJoiningVideoCall) {
|
||||
if (call.currentParams.isVideoEnabled) {
|
||||
Log.i("[Single Call] Call params have video enabled, enabling full screen mode")
|
||||
controlsViewModel.fullScreenMode.value = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -359,6 +359,12 @@ class CorePreferences constructor(private val context: Context) {
|
|||
config.setBool("audio", "android_pause_calls_when_audio_focus_lost", value)
|
||||
}
|
||||
|
||||
var enableFullScreenWhenJoiningVideoCall: Boolean
|
||||
get() = config.getBool("app", "enter_video_call_enable_full_screen_mode", false)
|
||||
set(value) {
|
||||
config.setBool("app", "enter_video_call_enable_full_screen_mode", value)
|
||||
}
|
||||
|
||||
var enableFullScreenWhenJoiningVideoConference: Boolean
|
||||
get() = config.getBool("app", "enter_video_conference_enable_full_screen_mode", true)
|
||||
set(value) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue