Layout improvements

This commit is contained in:
Sylvain Berfini 2022-03-23 16:25:44 +01:00
parent 5c3b79abee
commit d6cd6af645
6 changed files with 149 additions and 152 deletions

View file

@ -3,7 +3,9 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
<variable
name="viewModel"
type="org.linphone.activities.voip.viewmodels.ControlsViewModel" />
@ -27,7 +29,7 @@
app:layout_constraintDimensionRatio="W,1.26:1"
app:layout_constraintEnd_toStartOf="@id/answer"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"/>
app:layout_constraintStart_toStartOf="parent" />
<ImageView
android:id="@+id/answer"

View file

@ -3,7 +3,9 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
<variable
name="controlsViewModel"
type="org.linphone.activities.voip.viewmodels.ControlsViewModel" />
@ -24,7 +26,7 @@
android:src="@drawable/icon_call_hangup"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="W,1.26:1"
app:layout_constraintStart_toStartOf="parent"/>
app:layout_constraintStart_toStartOf="parent" />
<ImageView
android:id="@+id/microphone"
@ -42,7 +44,7 @@
app:layout_constraintDimensionRatio="W,1:1"
app:layout_constraintEnd_toStartOf="@id/speaker"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="@id/hangup"/>
app:layout_constraintStart_toStartOf="@id/hangup" />
<ImageView
android:id="@+id/speaker"
@ -58,7 +60,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="W,1:1"
app:layout_constraintEnd_toEndOf="@id/numpad"
app:layout_constraintStart_toEndOf="@id/microphone"/>
app:layout_constraintStart_toEndOf="@id/microphone" />
<ImageView
android:id="@+id/numpad"
@ -72,7 +74,7 @@
android:visibility="@{controlsViewModel.isOutgoingEarlyMedia ? View.VISIBLE : View.GONE, default=gone}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="W,1:1"
app:layout_constraintEnd_toEndOf="parent"/>
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -3,10 +3,13 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
<variable
name="callsViewModel"
type="org.linphone.activities.voip.viewmodels.CallsViewModel" />
<variable
name="controlsViewModel"
type="org.linphone.activities.voip.viewmodels.ControlsViewModel" />

View file

@ -3,10 +3,13 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
<variable
name="callsViewModel"
type="org.linphone.activities.voip.viewmodels.CallsViewModel" />
<variable
name="controlsViewModel"
type="org.linphone.activities.voip.viewmodels.ControlsViewModel" />
@ -103,7 +106,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintWidth_max="350dp" />
app:layout_constraintWidth_max="@dimen/voip_buttons_max_width" />
<ViewStub
android:id="@+id/stub_numpad"

View file

@ -3,7 +3,9 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
<variable
name="data"
type="org.linphone.activities.voip.data.ConferenceParticipantDeviceData" />
@ -14,91 +16,81 @@
android:layout_height="@dimen/voip_active_speaker_miniature_size"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
app:layout_flexShrink="0"
app:layout_alignSelf="flex_end">
android:background="@{!data.isInConference ? @drawable/shape_remote_paused_background : data.videoEnabled ? @drawable/shape_remote_video_background : @drawable/shape_remote_background, default=@drawable/shape_remote_background}"
app:layout_alignSelf="flex_end"
app:layout_flexShrink="0">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@{!data.isInConference ? @drawable/shape_remote_paused_background : data.videoEnabled ? @drawable/shape_remote_video_background : @drawable/shape_remote_background, default=@drawable/shape_remote_background}"
app:layout_constraintTop_toTopOf="parent"
<include
layout="@layout/voip_contact_avatar"
android:layout_width="@dimen/voip_conference_active_speaker_miniature_avatar_size"
android:layout_height="@dimen/voip_conference_active_speaker_miniature_avatar_size"
android:visibility="@{data.videoEnabled || !data.isInConference ? View.GONE : View.VISIBLE, default=gone}"
app:data="@{data}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<include
android:layout_width="@dimen/voip_conference_active_speaker_miniature_avatar_size"
android:layout_height="@dimen/voip_conference_active_speaker_miniature_avatar_size"
android:visibility="@{data.videoEnabled || !data.isInConference ? View.GONE : View.VISIBLE, default=gone}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:data="@{data}"
layout="@layout/voip_contact_avatar" />
</androidx.constraintlayout.widget.ConstraintLayout>
app:layout_constraintTop_toTopOf="parent" />
<org.linphone.activities.voip.views.RoundCornersTextureView
android:id="@+id/participant_video_surface"
android:visibility="@{data.videoEnabled &amp;&amp; data.isInConference ? View.VISIBLE : View.GONE}"
participantTextureView="@{data}"
android:layout_width="0dp"
android:layout_height="0dp"
android:visibility="@{data.videoEnabled &amp;&amp; data.isInConference ? View.VISIBLE : View.GONE}"
app:alignTopRight="false"
app:displayMode="hybrid"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:visibility="@{data.isInConference ? View.GONE : View.VISIBLE, default=gone}"
android:layout_width="@dimen/voip_conference_active_speaker_miniature_avatar_size"
android:layout_height="@dimen/voip_conference_active_speaker_miniature_avatar_size"
android:src="@drawable/icon_pause"
android:background="@drawable/shape_button_background"
android:contentDescription="@string/content_description_participant_is_paused"
app:layout_constraintTop_toTopOf="parent"
android:src="@drawable/icon_pause"
android:visibility="@{data.isInConference ? View.GONE : View.VISIBLE, default=gone}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:onClick="@{() -> data.switchCamera()}"
android:visibility="@{data.videoEnabled &amp;&amp; data.isSwitchCameraAvailable() &amp;&amp; data.isInConference ? View.VISIBLE : View.GONE, default=gone}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:contentDescription="@string/content_description_switch_camera"
android:onClick="@{() -> data.switchCamera()}"
android:padding="5dp"
android:src="@drawable/icon_call_camera_switch"
android:contentDescription="@string/content_description_switch_camera"
app:layout_constraintTop_toTopOf="@id/participant_video_surface"
app:layout_constraintEnd_toEndOf="@id/participant_video_surface"/>
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:visibility="@{data.activeSpeaker ? View.VISIBLE : View.GONE, default=gone}"
android:layout_width="0dp"
android:layout_height="0dp"
android:contentDescription="@null"
android:src="@drawable/shape_conference_active_speaker_border"
android:visibility="@{data.activeSpeaker ? View.VISIBLE : View.GONE, default=gone}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="@drawable/shape_conference_active_speaker_border"
android:contentDescription="@null"/>
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/participant_name"
android:text="@{data.contact.fullName ?? data.displayName}"
style="@style/call_remote_name_font"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginBottom="5dp"
android:text="@{data.contact.fullName ?? data.displayName}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<!--<TextView
android:visibility="@{data.isInConference ? View.GONE : View.VISIBLE, default=gone}"
@ -114,14 +106,14 @@
<ImageView
android:layout_width="@dimen/voip_conference_participant_mic_muted_icon_size"
android:layout_height="@dimen/voip_conference_participant_mic_muted_icon_size"
android:visibility="@{data.micMuted ? View.VISIBLE : View.GONE, default=gone}"
android:padding="5dp"
android:layout_margin="5dp"
android:background="@drawable/shape_button_disabled_background"
android:src="@drawable/icon_mic_muted"
android:contentDescription="@string/content_description_conference_participant_mic_muted"
android:padding="5dp"
android:src="@drawable/icon_mic_muted"
android:visibility="@{data.micMuted ? View.VISIBLE : View.GONE, default=gone}"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -3,123 +3,118 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
<variable
name="data"
type="org.linphone.activities.voip.data.ConferenceParticipantDeviceData" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="5dp">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@{!data.isInConference ? @drawable/shape_remote_paused_background : data.videoEnabled ? @drawable/shape_remote_video_background : @drawable/shape_remote_background, default=@drawable/shape_remote_background}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@{!data.isInConference ? @drawable/shape_remote_paused_background : data.videoEnabled ? @drawable/shape_remote_video_background : @drawable/shape_remote_background, default=@drawable/shape_remote_background}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
<include
layout="@layout/voip_contact_avatar"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="30dp"
android:visibility="@{data.videoEnabled || !data.isInConference ? View.GONE : View.VISIBLE, default=gone}"
app:data="@{data}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1">
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHeight_max="200dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<include
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="30dp"
android:visibility="@{data.videoEnabled || !data.isInConference ? View.GONE : View.VISIBLE, default=gone}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHeight_max="200dp"
app:data="@{data}"
layout="@layout/voip_contact_avatar" />
<org.linphone.activities.voip.views.RoundCornersTextureView
android:id="@+id/participant_video_surface"
participantTextureView="@{data}"
android:layout_width="0dp"
android:layout_height="0dp"
android:visibility="@{data.videoEnabled &amp;&amp; data.isInConference ? View.VISIBLE : View.GONE}"
app:alignTopRight="false"
app:displayMode="hybrid"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<org.linphone.activities.voip.views.RoundCornersTextureView
android:id="@+id/participant_video_surface"
android:visibility="@{data.videoEnabled &amp;&amp; data.isInConference ? View.VISIBLE : View.GONE}"
participantTextureView="@{data}"
android:layout_width="0dp"
android:layout_height="0dp"
app:alignTopRight="false"
app:displayMode="hybrid"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_button_background"
android:contentDescription="@string/content_description_participant_is_paused"
android:src="@drawable/icon_pause"
android:visibility="@{data.isInConference ? View.GONE : View.VISIBLE, default=gone}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:visibility="@{data.isInConference ? View.GONE : View.VISIBLE, default=gone}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_pause"
android:background="@drawable/shape_button_background"
android:contentDescription="@string/content_description_participant_is_paused"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<ImageView
android:layout_width="0dp"
android:layout_height="0dp"
android:adjustViewBounds="true"
android:contentDescription="@null"
android:src="@drawable/shape_conference_active_speaker_border"
android:visibility="@{data.activeSpeaker ? View.VISIBLE : View.GONE, default=gone}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:visibility="@{data.activeSpeaker ? View.VISIBLE : View.GONE, default=gone}"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="@drawable/shape_conference_active_speaker_border"
android:adjustViewBounds="true"
android:contentDescription="@null"/>
<TextView
android:id="@+id/participant_name"
style="@style/call_remote_name_font"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginBottom="10dp"
android:text="@{data.contact.fullName ?? data.displayName}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/participant_name"
android:text="@{data.contact.fullName ?? data.displayName}"
style="@style/call_remote_name_font"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginStart="10dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<TextView
style="@style/call_remote_name_font"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:text="@string/conference_participant_paused"
android:visibility="@{data.isInConference ? View.GONE : View.VISIBLE, default=gone}"
app:layout_constraintBottom_toBottomOf="@id/participant_name"
app:layout_constraintStart_toEndOf="@id/participant_name" />
<TextView
android:visibility="@{data.isInConference ? View.GONE : View.VISIBLE, default=gone}"
android:text="@string/conference_participant_paused"
style="@style/call_remote_name_font"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
app:layout_constraintStart_toEndOf="@id/participant_name"
app:layout_constraintBottom_toBottomOf="@id/participant_name"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:contentDescription="@string/content_description_switch_camera"
android:onClick="@{() -> data.switchCamera()}"
android:padding="5dp"
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_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:onClick="@{() -> data.switchCamera()}"
android:visibility="@{data.videoEnabled &amp;&amp; data.isSwitchCameraAvailable() &amp;&amp; data.isInConference ? View.VISIBLE : View.GONE, default=gone}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:padding="5dp"
android:src="@drawable/icon_call_camera_switch"
android:contentDescription="@string/content_description_switch_camera"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<ImageView
android:layout_height="@dimen/voip_conference_participant_mic_muted_icon_size"
android:layout_width="@dimen/voip_conference_participant_mic_muted_icon_size"
android:visibility="@{data.micMuted ? View.VISIBLE : View.GONE, default=gone}"
android:background="@drawable/shape_button_disabled_background"
android:src="@drawable/icon_mic_muted"
android:padding="5dp"
android:layout_margin="5dp"
android:contentDescription="@string/content_description_conference_participant_mic_muted"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView
android:layout_width="@dimen/voip_conference_participant_mic_muted_icon_size"
android:layout_height="@dimen/voip_conference_participant_mic_muted_icon_size"
android:layout_margin="5dp"
android:background="@drawable/shape_button_disabled_background"
android:contentDescription="@string/content_description_conference_participant_mic_muted"
android:padding="5dp"
android:src="@drawable/icon_mic_muted"
android:visibility="@{data.micMuted ? View.VISIBLE : View.GONE, default=gone}"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>