mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Show camera icon instead of phone icon when incoming call is video
This commit is contained in:
parent
3b12128953
commit
29a4607bdc
3 changed files with 12 additions and 1 deletions
|
|
@ -57,6 +57,8 @@ class ControlsViewModel : ViewModel() {
|
|||
|
||||
val isIncomingEarlyMediaVideo = MutableLiveData<Boolean>()
|
||||
|
||||
val isIncomingCallVideo = MutableLiveData<Boolean>()
|
||||
|
||||
val showExtras = MutableLiveData<Boolean>()
|
||||
|
||||
val fullScreenMode = MutableLiveData<Boolean>()
|
||||
|
|
@ -123,6 +125,7 @@ class ControlsViewModel : ViewModel() {
|
|||
Log.i("[Call Controls] State changed: $state")
|
||||
isOutgoingEarlyMedia.value = state == Call.State.OutgoingEarlyMedia
|
||||
isIncomingEarlyMediaVideo.value = state == Call.State.IncomingEarlyMedia && call.remoteParams?.isVideoEnabled == true
|
||||
isIncomingCallVideo.value = call.remoteParams?.isVideoEnabled == true
|
||||
attendedTransfer.value = core.callsNb > 1
|
||||
|
||||
if (state == Call.State.StreamsRunning) {
|
||||
|
|
@ -237,6 +240,7 @@ class ControlsViewModel : ViewModel() {
|
|||
Log.i("[Call Controls] Current state is: $state")
|
||||
isOutgoingEarlyMedia.value = state == Call.State.OutgoingEarlyMedia
|
||||
isIncomingEarlyMediaVideo.value = state == Call.State.IncomingEarlyMedia && currentCall?.remoteParams?.isVideoEnabled == true
|
||||
isIncomingCallVideo.value = currentCall?.remoteParams?.isVideoEnabled == true
|
||||
|
||||
updateUI()
|
||||
|
||||
|
|
|
|||
7
app/src/main/res/drawable/icon_call_answer_video.xml
Normal file
7
app/src/main/res/drawable/icon_call_answer_video.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>
|
||||
<bitmap android:src="@drawable/voip_camera_on"
|
||||
android:tint="@color/white_color"/>
|
||||
</item>
|
||||
</selector>
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
android:contentDescription="@string/content_description_answer_call"
|
||||
android:onClick="@{() -> viewModel.answer()}"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/icon_call_answer"
|
||||
android:src="@{viewModel.isIncomingCallVideo ? @drawable/icon_call_answer_video : @drawable/icon_call_answer, default=@drawable/icon_call_answer_video}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="W,1.26:1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue