mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Started call stats
This commit is contained in:
parent
a7c63c748a
commit
308aff5392
20 changed files with 596 additions and 23 deletions
|
|
@ -107,6 +107,17 @@ class ActiveCallFragment : GenericCallFragment() {
|
|||
override fun onSlide(bottomSheet: View, slideOffset: Float) { }
|
||||
}
|
||||
|
||||
private val callStatsBottomSheetCallback = object : BottomSheetBehavior.BottomSheetCallback() {
|
||||
override fun onStateChanged(bottomSheet: View, newState: Int) {
|
||||
if (newState == BottomSheetBehavior.STATE_COLLAPSED) {
|
||||
val callStatsBottomSheetBehavior = BottomSheetBehavior.from(bottomSheet)
|
||||
callStatsBottomSheetBehavior.state = BottomSheetBehavior.STATE_HIDDEN
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSlide(bottomSheet: View, slideOffset: Float) { }
|
||||
}
|
||||
|
||||
private val actionsBottomSheetCallback = object : BottomSheetBehavior.BottomSheetCallback() {
|
||||
override fun onStateChanged(bottomSheet: View, newState: Int) {
|
||||
if (newState == BottomSheetBehavior.STATE_EXPANDED) {
|
||||
|
|
@ -159,6 +170,7 @@ class ActiveCallFragment : GenericCallFragment() {
|
|||
binding.viewModel = callViewModel
|
||||
binding.callsViewModel = callsViewModel
|
||||
binding.numpadModel = callViewModel.numpadModel
|
||||
binding.callStatsModel = callViewModel.callStatsModel
|
||||
|
||||
val actionsBottomSheetBehavior = BottomSheetBehavior.from(binding.bottomBar.root)
|
||||
actionsBottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED
|
||||
|
|
@ -168,6 +180,10 @@ class ActiveCallFragment : GenericCallFragment() {
|
|||
numpadBottomSheetBehavior.state = BottomSheetBehavior.STATE_HIDDEN
|
||||
numpadBottomSheetBehavior.addBottomSheetCallback(numpadBottomSheetCallback)
|
||||
|
||||
val callStatsBottomSheetBehavior = BottomSheetBehavior.from(binding.callStats.root)
|
||||
callStatsBottomSheetBehavior.state = BottomSheetBehavior.STATE_HIDDEN
|
||||
callStatsBottomSheetBehavior.addBottomSheetCallback(callStatsBottomSheetCallback)
|
||||
|
||||
binding.setBackClickListener {
|
||||
requireActivity().finish()
|
||||
}
|
||||
|
|
@ -183,7 +199,9 @@ class ActiveCallFragment : GenericCallFragment() {
|
|||
}
|
||||
|
||||
binding.setCallStatisticsClickListener {
|
||||
showCallStatistics()
|
||||
actionsBottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED
|
||||
numpadBottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED
|
||||
callStatsBottomSheetBehavior.state = BottomSheetBehavior.STATE_EXPANDED
|
||||
}
|
||||
|
||||
sharedViewModel = requireActivity().run {
|
||||
|
|
@ -205,6 +223,7 @@ class ActiveCallFragment : GenericCallFragment() {
|
|||
Log.i("$TAG Switching full screen mode to ${if (hide) "ON" else "OFF"}")
|
||||
sharedViewModel.toggleFullScreenEvent.value = Event(hide)
|
||||
numpadBottomSheetBehavior.state = BottomSheetBehavior.STATE_HIDDEN
|
||||
callStatsBottomSheetBehavior.state = BottomSheetBehavior.STATE_HIDDEN
|
||||
}
|
||||
|
||||
callViewModel.showZrtpSasDialogEvent.observe(viewLifecycleOwner) {
|
||||
|
|
@ -371,10 +390,6 @@ class ActiveCallFragment : GenericCallFragment() {
|
|||
set.applyTo(constraintLayout)
|
||||
}
|
||||
|
||||
private fun showCallStatistics() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
private fun showMediaEncryptionStatistics(model: CallMediaEncryptionModel) {
|
||||
val modalBottomSheet = MediaEncryptionStatisticsDialogFragment(model)
|
||||
modalBottomSheet.show(
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import com.google.android.material.bottomsheet.BottomSheetBehavior
|
|||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
import org.linphone.R
|
||||
import org.linphone.databinding.CallAudioDevicesMenuBinding
|
||||
import org.linphone.databinding.CallAudioDevicesBottomSheetBinding
|
||||
import org.linphone.ui.call.model.AudioDeviceModel
|
||||
|
||||
@UiThread
|
||||
|
|
@ -68,7 +68,8 @@ class AudioDevicesMenuDialogFragment(
|
|||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
val view = CallAudioDevicesMenuBinding.inflate(layoutInflater)
|
||||
val view = CallAudioDevicesBottomSheetBinding.inflate(layoutInflater)
|
||||
view.lifecycleOwner = viewLifecycleOwner
|
||||
|
||||
for (device in devicesList) {
|
||||
device.dismissDialog = {
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ class CallMenuDialogFragment(
|
|||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
val view = CallsListLongPressMenuBinding.inflate(layoutInflater)
|
||||
view.lifecycleOwner = viewLifecycleOwner
|
||||
|
||||
view.setHangUpClickListener {
|
||||
callModel.hangUp()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* Copyright (c) 2010-2023 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.call.fragment
|
||||
|
||||
import android.app.Dialog
|
||||
import android.content.DialogInterface
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.annotation.UiThread
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
import org.linphone.databinding.CallStatsBottomSheetBindingImpl
|
||||
import org.linphone.ui.call.model.CallStatsModel
|
||||
|
||||
@UiThread
|
||||
class CallStatisticsDialogFragment(
|
||||
private val model: CallStatsModel,
|
||||
private val onDismiss: (() -> Unit)? = null
|
||||
) : BottomSheetDialogFragment() {
|
||||
companion object {
|
||||
const val TAG = "CallStatisticsDialogFragment"
|
||||
}
|
||||
|
||||
override fun onCancel(dialog: DialogInterface) {
|
||||
onDismiss?.invoke()
|
||||
super.onCancel(dialog)
|
||||
}
|
||||
|
||||
override fun onDismiss(dialog: DialogInterface) {
|
||||
onDismiss?.invoke()
|
||||
super.onDismiss(dialog)
|
||||
}
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val dialog = super.onCreateDialog(savedInstanceState) as BottomSheetDialog
|
||||
// Makes sure all menu entries are visible,
|
||||
// required for landscape mode (otherwise only first item is visible)
|
||||
dialog.behavior.state = BottomSheetBehavior.STATE_EXPANDED
|
||||
return dialog
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
val view = CallStatsBottomSheetBindingImpl.inflate(layoutInflater)
|
||||
view.lifecycleOwner = viewLifecycleOwner
|
||||
|
||||
view.model = model
|
||||
|
||||
return view.root
|
||||
}
|
||||
}
|
||||
|
|
@ -29,7 +29,7 @@ import androidx.annotation.UiThread
|
|||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
import org.linphone.databinding.CallConferenceLayoutMenuBinding
|
||||
import org.linphone.databinding.CallConferenceLayoutBottomSheetBinding
|
||||
import org.linphone.ui.call.model.ConferenceModel
|
||||
|
||||
@UiThread
|
||||
|
|
@ -64,7 +64,8 @@ class ConferenceLayoutMenuDialogFragment(
|
|||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
val view = CallConferenceLayoutMenuBinding.inflate(layoutInflater)
|
||||
val view = CallConferenceLayoutBottomSheetBinding.inflate(layoutInflater)
|
||||
view.lifecycleOwner = viewLifecycleOwner
|
||||
|
||||
view.viewModel = conferenceModel
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import androidx.annotation.UiThread
|
|||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
import org.linphone.databinding.CallMediaEncryptionStatsMenuBinding
|
||||
import org.linphone.databinding.CallMediaEncryptionStatsBottomSheetBinding
|
||||
import org.linphone.ui.call.model.CallMediaEncryptionModel
|
||||
|
||||
@UiThread
|
||||
|
|
@ -64,7 +64,8 @@ class MediaEncryptionStatisticsDialogFragment(
|
|||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
val view = CallMediaEncryptionStatsMenuBinding.inflate(layoutInflater)
|
||||
val view = CallMediaEncryptionStatsBottomSheetBinding.inflate(layoutInflater)
|
||||
view.lifecycleOwner = viewLifecycleOwner
|
||||
|
||||
view.model = model
|
||||
|
||||
|
|
|
|||
100
app/src/main/java/org/linphone/ui/call/model/CallStatsModel.kt
Normal file
100
app/src/main/java/org/linphone/ui/call/model/CallStatsModel.kt
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
/*
|
||||
* Copyright (c) 2010-2023 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.call.model
|
||||
|
||||
import androidx.annotation.WorkerThread
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import kotlin.math.roundToInt
|
||||
import org.linphone.R
|
||||
import org.linphone.core.Call
|
||||
import org.linphone.core.CallStats
|
||||
import org.linphone.core.StreamType
|
||||
import org.linphone.utils.AppUtils
|
||||
|
||||
class CallStatsModel @WorkerThread constructor() {
|
||||
val audioCodec = MutableLiveData<String>()
|
||||
val audioBandwidth = MutableLiveData<String>()
|
||||
|
||||
val isVideoEnabled = MutableLiveData<Boolean>()
|
||||
val videoCodec = MutableLiveData<String>()
|
||||
val videoBandwidth = MutableLiveData<String>()
|
||||
val videoResolution = MutableLiveData<String>()
|
||||
val videoFps = MutableLiveData<String>()
|
||||
|
||||
@WorkerThread
|
||||
fun update(call: Call, stats: CallStats?) {
|
||||
stats ?: return
|
||||
isVideoEnabled.postValue(call.params.isVideoEnabled)
|
||||
|
||||
when (stats.type) {
|
||||
StreamType.Audio -> {
|
||||
val payloadType = call.currentParams.usedAudioPayloadType
|
||||
val clockRate = (payloadType?.clockRate ?: 0) / 1000
|
||||
val codecLabel = AppUtils.getFormattedString(
|
||||
R.string.call_stats_codec_label,
|
||||
"${payloadType?.mimeType}/$clockRate kHz"
|
||||
)
|
||||
audioCodec.postValue(codecLabel)
|
||||
|
||||
val uploadBandwidth = stats.uploadBandwidth.roundToInt()
|
||||
val downloadBandwidth = stats.downloadBandwidth.roundToInt()
|
||||
val bandwidthLabel = AppUtils.getFormattedString(
|
||||
R.string.call_stats_bandwidth_label,
|
||||
"↑ $uploadBandwidth kbits/s ↓ $downloadBandwidth kbits/s"
|
||||
)
|
||||
audioBandwidth.postValue(bandwidthLabel)
|
||||
}
|
||||
StreamType.Video -> {
|
||||
val payloadType = call.currentParams.usedVideoPayloadType
|
||||
val clockRate = (payloadType?.clockRate ?: 0) / 1000
|
||||
val codecLabel = AppUtils.getFormattedString(
|
||||
R.string.call_stats_codec_label,
|
||||
"${payloadType?.mimeType}/$clockRate kHz"
|
||||
)
|
||||
videoCodec.postValue(codecLabel)
|
||||
|
||||
val uploadBandwidth = stats.uploadBandwidth.roundToInt()
|
||||
val downloadBandwidth = stats.downloadBandwidth.roundToInt()
|
||||
val bandwidthLabel = AppUtils.getFormattedString(
|
||||
R.string.call_stats_bandwidth_label,
|
||||
"↑ $uploadBandwidth kbits/s ↓ $downloadBandwidth kbits/s"
|
||||
)
|
||||
videoBandwidth.postValue(bandwidthLabel)
|
||||
|
||||
val sentResolution = call.currentParams.sentVideoDefinition?.name
|
||||
val receivedResolution = call.currentParams.receivedVideoDefinition?.name
|
||||
val resolutionLabel = AppUtils.getFormattedString(
|
||||
R.string.call_stats_resolution_label,
|
||||
"↑ $sentResolution ↓ $receivedResolution"
|
||||
)
|
||||
videoResolution.postValue(resolutionLabel)
|
||||
|
||||
val sentFps = call.currentParams.sentFramerate.roundToInt()
|
||||
val receivedFps = call.currentParams.receivedFramerate.roundToInt()
|
||||
val fpsLabel = AppUtils.getFormattedString(
|
||||
R.string.call_stats_fps_label,
|
||||
"↑ $sentFps ↓ $receivedFps"
|
||||
)
|
||||
videoFps.postValue(fpsLabel)
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -116,7 +116,7 @@ class ConferenceParticipantDeviceModel @WorkerThread constructor(
|
|||
if (streamType == StreamType.Video) {
|
||||
isVideoAvailable.postValue(available)
|
||||
if (available) {
|
||||
updateWindowId(textureView)
|
||||
updateWindowId()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -182,20 +182,26 @@ class ConferenceParticipantDeviceModel @WorkerThread constructor(
|
|||
)
|
||||
textureView = view
|
||||
coreContext.postOnCoreThread {
|
||||
updateWindowId(textureView)
|
||||
updateWindowId()
|
||||
}
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
private fun updateWindowId(windowId: Any?) {
|
||||
Log.i(
|
||||
"$$TAG Setting participant [${device.address.asStringUriOnly()}] window ID [$windowId]"
|
||||
)
|
||||
// SDK does it but it's a bit better this way, prevents going to participants map in PlatformHelper for nothing
|
||||
if (isMe) {
|
||||
coreContext.core.nativePreviewWindowId = windowId
|
||||
private fun updateWindowId() {
|
||||
if (::textureView.isInitialized) {
|
||||
Log.i(
|
||||
"$$TAG Setting participant [${device.address.asStringUriOnly()}] window ID [$textureView]"
|
||||
)
|
||||
// SDK does it but it's a bit better this way, prevents going to participants map in PlatformHelper for nothing
|
||||
if (isMe) {
|
||||
coreContext.core.nativePreviewWindowId = textureView
|
||||
} else {
|
||||
device.nativeVideoWindowId = textureView
|
||||
}
|
||||
} else {
|
||||
device.nativeVideoWindowId = windowId
|
||||
Log.e(
|
||||
"$TAG TextureView for participant [${device.address.asStringUriOnly()}] wasn't initialized yet!"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ import org.linphone.core.Address
|
|||
import org.linphone.core.AudioDevice
|
||||
import org.linphone.core.Call
|
||||
import org.linphone.core.CallListenerStub
|
||||
import org.linphone.core.CallStats
|
||||
import org.linphone.core.ChatRoom.SecurityLevel
|
||||
import org.linphone.core.Core
|
||||
import org.linphone.core.CoreListenerStub
|
||||
|
|
@ -49,6 +50,7 @@ import org.linphone.core.StreamType
|
|||
import org.linphone.core.tools.Log
|
||||
import org.linphone.ui.call.model.AudioDeviceModel
|
||||
import org.linphone.ui.call.model.CallMediaEncryptionModel
|
||||
import org.linphone.ui.call.model.CallStatsModel
|
||||
import org.linphone.ui.call.model.ConferenceModel
|
||||
import org.linphone.ui.main.contacts.model.ContactAvatarModel
|
||||
import org.linphone.ui.main.history.model.NumpadModel
|
||||
|
|
@ -102,6 +104,8 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
|
|||
|
||||
val hideVideo = MutableLiveData<Boolean>()
|
||||
|
||||
val callStatsModel = CallStatsModel()
|
||||
|
||||
val incomingCallTitle: MutableLiveData<String> by lazy {
|
||||
MutableLiveData<String>()
|
||||
}
|
||||
|
|
@ -198,6 +202,10 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
|
|||
isRemoteRecordingEvent.postValue(Event(Pair(recording, displayedName.value.orEmpty())))
|
||||
}
|
||||
|
||||
override fun onStatsUpdated(call: Call, stats: CallStats) {
|
||||
callStatsModel.update(call, stats)
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
override fun onStateChanged(call: Call, state: Call.State, message: String) {
|
||||
Log.i("$TAG Call [${call.remoteAddress.asStringUriOnly()}] state changed [$state]")
|
||||
|
|
@ -768,6 +776,7 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
|
|||
|
||||
terminatedByUsed = false
|
||||
currentCall = call
|
||||
callStatsModel.update(call, call.audioStats)
|
||||
call.addListener(callListener)
|
||||
|
||||
if (call.conference != null) {
|
||||
|
|
|
|||
7
app/src/main/res/color/in_call_button_color.xml
Normal file
7
app/src/main/res/color/in_call_button_color.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true"
|
||||
android:color="@color/white" />
|
||||
<item
|
||||
android:color="@color/transparent_color"/>
|
||||
</selector>
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="48dp" />
|
||||
<stroke android:color="?attr/color_main2_400" android:width="1dp"/>
|
||||
<solid android:color="@color/in_call_button_color" />
|
||||
<stroke android:color="@color/gray_main2_400" android:width="1dp"/>
|
||||
</shape>
|
||||
173
app/src/main/res/layout-land/call_stats_bottom_sheet.xml
Normal file
173
app/src/main/res/layout-land/call_stats_bottom_sheet.xml
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
<?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.call.model.CallStatsModel" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/black"
|
||||
app:behavior_hideable="true"
|
||||
app:behavior_peekHeight="0dp"
|
||||
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
|
||||
|
||||
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
|
||||
android:id="@+id/handle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="11dp"
|
||||
android:src="@drawable/shape_drawer_handle"
|
||||
app:tint="@color/white"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/audio_stats"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:background="@drawable/shape_squircle_gray_600_background"
|
||||
app:layout_constraintVertical_bias="0"
|
||||
app:layout_constraintWidth_percent="0.45"
|
||||
app:layout_constraintTop_toBottomOf="@id/handle"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/video_stats"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_700"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/call_stats_audio_title"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="@{model.audioCodec, default=@string/call_stats_codec_label}"
|
||||
android:textColor="@color/white"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@{model.audioBandwidth, default=@string/call_stats_bandwidth_label}"
|
||||
android:textColor="@color/white"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/video_stats"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:background="@drawable/shape_squircle_gray_600_background"
|
||||
android:visibility="@{model.isVideoEnabled ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintWidth_percent="0.45"
|
||||
app:layout_constraintTop_toBottomOf="@id/handle"
|
||||
app:layout_constraintStart_toEndOf="@id/audio_stats"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_700"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/call_stats_video_title"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="@{model.videoCodec, default=@string/call_stats_codec_label}"
|
||||
android:textColor="@color/white"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@{model.videoBandwidth, default=@string/call_stats_bandwidth_label}"
|
||||
android:textColor="@color/white"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@{model.videoResolution, default=@string/call_stats_resolution_label}"
|
||||
android:textColor="@color/white"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@{model.videoFps, default=@string/call_stats_fps_label}"
|
||||
android:textColor="@color/white"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
|
|
@ -220,7 +220,7 @@
|
|||
android:paddingBottom="12dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:background="@drawable/shape_squircle_main2_400_border"
|
||||
android:background="@drawable/shape_squircle_in_call_button_background"
|
||||
android:text="@string/conference_share_link_title"
|
||||
android:textSize="18sp"
|
||||
android:textColor="@color/gray_main2_400"
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@
|
|||
<variable
|
||||
name="numpadModel"
|
||||
type="org.linphone.ui.main.history.model.NumpadModel" />
|
||||
<variable
|
||||
name="callStatsModel"
|
||||
type="org.linphone.ui.call.model.CallStatsModel" />
|
||||
</data>
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
|
|
@ -305,6 +308,11 @@
|
|||
layout="@layout/call_numpad_bottom_sheet"
|
||||
bind:model="@{numpadModel}"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/call_stats"
|
||||
layout="@layout/call_stats_bottom_sheet"
|
||||
bind:model="@{callStatsModel}"/>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
</layout>
|
||||
169
app/src/main/res/layout/call_stats_bottom_sheet.xml
Normal file
169
app/src/main/res/layout/call_stats_bottom_sheet.xml
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
<?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.call.model.CallStatsModel" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/black"
|
||||
app:behavior_hideable="true"
|
||||
app:behavior_peekHeight="0dp"
|
||||
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
|
||||
|
||||
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
|
||||
android:id="@+id/handle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="11dp"
|
||||
android:src="@drawable/shape_drawer_handle"
|
||||
app:tint="@color/white"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/audio_stats"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:background="@drawable/shape_squircle_gray_600_background"
|
||||
app:layout_constraintTop_toBottomOf="@id/handle"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/video_stats"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_700"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/call_stats_audio_title"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="@{model.audioCodec, default=@string/call_stats_codec_label}"
|
||||
android:textColor="@color/white"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@{model.audioBandwidth, default=@string/call_stats_bandwidth_label}"
|
||||
android:textColor="@color/white"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/video_stats"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:background="@drawable/shape_squircle_gray_600_background"
|
||||
android:visibility="@{model.isVideoEnabled ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintTop_toBottomOf="@id/audio_stats"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_700"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/call_stats_video_title"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="@{model.videoCodec, default=@string/call_stats_codec_label}"
|
||||
android:textColor="@color/white"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@{model.videoBandwidth, default=@string/call_stats_bandwidth_label}"
|
||||
android:textColor="@color/white"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@{model.videoResolution, default=@string/call_stats_resolution_label}"
|
||||
android:textColor="@color/white"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@{model.videoFps, default=@string/call_stats_fps_label}"
|
||||
android:textColor="@color/white"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
|
|
@ -548,6 +548,13 @@
|
|||
<string name="call_audio_device_type_headset">Headset</string>
|
||||
<string name="call_audio_device_type_headphones">Headphones</string>
|
||||
|
||||
<string name="call_stats_audio_title">Audio</string>
|
||||
<string name="call_stats_codec_label">Codec: %s</string>
|
||||
<string name="call_stats_bandwidth_label">Bandwidth: %s</string>
|
||||
<string name="call_stats_video_title">Video</string>
|
||||
<string name="call_stats_resolution_label">Resolution: %s</string>
|
||||
<string name="call_stats_fps_label">FPS: %s</string>
|
||||
|
||||
<string name="call_stats_media_encryption">Media encryption: %s</string>
|
||||
<string name="call_stats_media_encryption_zrtp_post_quantum">Post Quantum ZRTP</string>
|
||||
<string name="call_stats_zrtp_cipher_algo">Cipher algorithm: %s</string>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue