Show our device (in conference) with a different background color + fixed our avatar size in active speaker

This commit is contained in:
Sylvain Berfini 2022-09-07 17:08:08 +02:00
parent ab6c3004de
commit 6bc4352313
11 changed files with 31 additions and 31 deletions

View file

@ -428,14 +428,12 @@ class ConferenceCallFragment : GenericFragment<VoipConferenceCallFragmentBinding
}
val size = resources.getDimension(R.dimen.voip_active_speaker_miniature_size).toInt()
set.constrainWidth(
R.id.local_participant_background,
size
)
set.constrainHeight(
R.id.local_participant_background,
size
)
set.constrainWidth(R.id.local_participant_background, size)
set.constrainHeight(R.id.local_participant_background, size)
val avatarSize = resources.getDimension(R.dimen.voip_conference_active_speaker_miniature_avatar_size).toInt()
set.constrainWidth(R.id.local_participant_avatar, avatarSize)
set.constrainHeight(R.id.local_participant_avatar, avatarSize)
Log.i("[Conference Call] Updating active speaker layout for 3 or more participants")
if (corePreferences.enableAnimations) {
@ -471,14 +469,12 @@ class ConferenceCallFragment : GenericFragment<VoipConferenceCallFragmentBinding
)
val size = resources.getDimension(R.dimen.voip_active_speaker_miniature_size).toInt()
set.constrainWidth(
R.id.local_participant_background,
size
)
set.constrainHeight(
R.id.local_participant_background,
size
)
set.constrainWidth(R.id.local_participant_background, size)
set.constrainHeight(R.id.local_participant_background, size)
val avatarSize = resources.getDimension(R.dimen.voip_conference_active_speaker_miniature_avatar_size).toInt()
set.constrainWidth(R.id.local_participant_avatar, avatarSize)
set.constrainHeight(R.id.local_participant_avatar, avatarSize)
Log.i("[Conference Call] Updating active speaker layout for 2 participants")
if (corePreferences.enableAnimations) {
@ -527,6 +523,8 @@ class ConferenceCallFragment : GenericFragment<VoipConferenceCallFragmentBinding
set.constrainWidth(R.id.local_participant_background, 0)
set.constrainHeight(R.id.local_participant_background, 0)
set.constrainWidth(R.id.local_participant_avatar, 0)
set.constrainHeight(R.id.local_participant_avatar, 0)
Log.i("[Conference Call] Updating active speaker layout for 1 participant (myself)")
if (corePreferences.enableAnimations) {

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<corners android:radius="6.7dp" />
<solid android:color="?attr/voipMeParticipantBackgroundColor"/>
</shape>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<corners android:radius="20dp" />
<solid android:color="?attr/voipMeParticipantBackgroundColor"/>
</shape>

View file

@ -227,7 +227,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="@id/hinge_bottom"
android:layout_marginTop="@{controlsViewModel.fullScreenMode ? @dimen/margin_0dp : @dimen/voip_active_speaker_top_margin, default=@dimen/voip_active_speaker_top_margin}"
android:background="@drawable/shape_remote_background"
android:background="@drawable/shape_me_background"
android:onClick="@{() -> controlsViewModel.toggleFullScreen()}"/>
<ImageView

View file

@ -227,7 +227,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="@id/hinge_bottom"
android:layout_marginTop="@{controlsViewModel.fullScreenMode ? @dimen/margin_0dp : @dimen/voip_active_speaker_top_margin, default=@dimen/voip_active_speaker_top_margin}"
android:background="@drawable/shape_remote_background"
android:background="@drawable/shape_me_background"
android:onClick="@{() -> controlsViewModel.toggleFullScreen()}"/>
<ImageView

View file

@ -57,17 +57,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:layout_width="@dimen/conference_miniature_switch_camera_icon_size"
android:layout_height="@dimen/conference_miniature_switch_camera_icon_size"
android:layout_margin="5dp"
android:contentDescription="@string/content_description_switch_camera"
android:onClick="@{() -> data.switchCamera()}"
android:src="@drawable/icon_call_camera_switch"
android:visibility="@{data.videoEnabled &amp;&amp; data.isSwitchCameraAvailable() &amp;&amp; data.isInConference ? View.VISIBLE : View.GONE, default=gone}"
app:layout_constraintEnd_toEndOf="@id/participant_video_surface"
app:layout_constraintTop_toTopOf="@id/participant_video_surface" />
<ImageView
android:layout_width="0dp"
android:layout_height="0dp"

View file

@ -23,7 +23,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="5dp"
android:background="@drawable/shape_audio_only_remote_background"
android:background="@{data.isMe ? @drawable/shape_audio_only_me_background : @drawable/shape_audio_only_remote_background, default=@drawable/shape_audio_only_remote_background}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View file

@ -20,7 +20,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="5dp"
android:background="@{!data.isInConference &amp;&amp; !data.isJoining ? @drawable/shape_remote_paused_background : @drawable/shape_remote_background, default=@drawable/shape_remote_background}"
android:background="@{!data.isInConference &amp;&amp; !data.isJoining ? @drawable/shape_remote_paused_background : data.isMe ? @drawable/shape_me_background : @drawable/shape_remote_background, default=@drawable/shape_remote_background}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View file

@ -49,6 +49,7 @@
<item name="voipBackgroundColor">@color/voip_dark_color</item>
<item name="voipBackgroundBWColor">@color/voip_dark_color</item>
<item name="voipParticipantBackgroundColor">@color/voip_dark_color2</item>
<item name="voipMeParticipantBackgroundColor">@color/voip_dark_color3</item>
<item name="voipExtraButtonsBackgroundColor">@color/voip_dark_color3</item>
<item name="voipToolbarBackgroundColor">@color/voip_dark_color4</item>
<item name="voipDrawableColor">@color/white_color</item>

View file

@ -33,6 +33,7 @@
<attr name="voipBackgroundColor" format="color" />
<attr name="voipBackgroundBWColor" format="color" />
<attr name="voipMeParticipantBackgroundColor" format="color" />
<attr name="voipParticipantBackgroundColor" format="color" />
<attr name="voipExtraButtonsBackgroundColor" format="color" />
<attr name="voipToolbarBackgroundColor" format="color" />

View file

@ -56,6 +56,7 @@
<item name="voipBackgroundColor">@color/voip_gray_blue_color</item>
<item name="voipBackgroundBWColor">@color/white_color</item>
<item name="voipParticipantBackgroundColor">@color/voip_gray_background</item>
<item name="voipMeParticipantBackgroundColor">@color/voip_dark_color3</item>
<item name="voipExtraButtonsBackgroundColor">@color/voip_gray</item>
<item name="voipToolbarBackgroundColor">@color/toolbar_color</item>
<item name="voipDrawableColor">@color/voip_dark_gray</item>