Layouts cleanup

This commit is contained in:
Sylvain Berfini 2024-05-03 16:42:44 +02:00
parent c9c362d570
commit efbcfee316
14 changed files with 77 additions and 75 deletions

View file

@ -72,13 +72,13 @@ class ActiveConferenceCallFragment : GenericCallFragment() {
requireContext(),
R.drawable.animated_handle_to_caret
)
binding.bottomBar.mainActions.handle.setImageDrawable(drawable)
binding.bottomBar.mainActions.callActionsHandle.setImageDrawable(drawable)
} else if (newState == BottomSheetBehavior.STATE_COLLAPSED) {
val drawable = AnimatedVectorDrawableCompat.create(
requireContext(),
R.drawable.animated_caret_to_handle
)
binding.bottomBar.mainActions.handle.setImageDrawable(drawable)
binding.bottomBar.mainActions.callActionsHandle.setImageDrawable(drawable)
}
}
@ -165,16 +165,16 @@ class ActiveConferenceCallFragment : GenericCallFragment() {
requireContext(),
R.drawable.animated_caret_to_handle
)
binding.bottomBar.mainActions.handle.setImageDrawable(drawable)
binding.bottomBar.mainActions.handle.startAnimatedDrawable()
binding.bottomBar.mainActions.callActionsHandle.setImageDrawable(drawable)
binding.bottomBar.mainActions.callActionsHandle.startAnimatedDrawable()
actionsBottomSheetBehavior.state = BottomSheetBehavior.STATE_EXPANDED
} else if (state == BottomSheetBehavior.STATE_EXPANDED) {
val drawable = AnimatedVectorDrawableCompat.create(
requireContext(),
R.drawable.animated_handle_to_caret
)
binding.bottomBar.mainActions.handle.setImageDrawable(drawable)
binding.bottomBar.mainActions.handle.startAnimatedDrawable()
binding.bottomBar.mainActions.callActionsHandle.setImageDrawable(drawable)
binding.bottomBar.mainActions.callActionsHandle.startAnimatedDrawable()
actionsBottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED
}
}

View file

@ -111,13 +111,13 @@ class ActiveCallFragment : GenericCallFragment() {
requireContext(),
R.drawable.animated_handle_to_caret
)
binding.bottomBar.mainActions.handle.setImageDrawable(drawable)
binding.bottomBar.mainActions.callActionsHandle.setImageDrawable(drawable)
} else if (newState == BottomSheetBehavior.STATE_COLLAPSED) {
val drawable = AnimatedVectorDrawableCompat.create(
requireContext(),
R.drawable.animated_caret_to_handle
)
binding.bottomBar.mainActions.handle.setImageDrawable(drawable)
binding.bottomBar.mainActions.callActionsHandle.setImageDrawable(drawable)
}
}
@ -270,16 +270,16 @@ class ActiveCallFragment : GenericCallFragment() {
requireContext(),
R.drawable.animated_caret_to_handle
)
binding.bottomBar.mainActions.handle.setImageDrawable(drawable)
binding.bottomBar.mainActions.handle.startAnimatedDrawable()
binding.bottomBar.mainActions.callActionsHandle.setImageDrawable(drawable)
binding.bottomBar.mainActions.callActionsHandle.startAnimatedDrawable()
actionsBottomSheetBehavior.state = BottomSheetBehavior.STATE_EXPANDED
} else if (state == BottomSheetBehavior.STATE_EXPANDED) {
val drawable = AnimatedVectorDrawableCompat.create(
requireContext(),
R.drawable.animated_handle_to_caret
)
binding.bottomBar.mainActions.handle.setImageDrawable(drawable)
binding.bottomBar.mainActions.handle.startAnimatedDrawable()
binding.bottomBar.mainActions.callActionsHandle.setImageDrawable(drawable)
binding.bottomBar.mainActions.callActionsHandle.startAnimatedDrawable()
actionsBottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED
}
}

View file

@ -17,7 +17,7 @@
<ImageView
android:onClick="@{() -> viewModel.toggleExpandActionsMenu()}"
android:id="@+id/handle"
android:id="@+id/call_actions_handle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="11dp"

View file

@ -22,7 +22,7 @@
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
android:id="@+id/handle"
android:id="@+id/media_encryption_handle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="11dp"
@ -39,7 +39,7 @@
android:layout_marginEnd="20dp"
android:layout_marginBottom="20dp"
android:background="@drawable/shape_squircle_gray_600_background"
app:layout_constraintTop_toBottomOf="@id/handle"
app:layout_constraintTop_toBottomOf="@id/media_encryption_handle"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"

View file

@ -25,7 +25,7 @@
tools:ignore="HardcodedText">
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
android:id="@+id/handle"
android:id="@+id/numpad_handle"
android:onClick="@{handleClickedListener}"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -66,7 +66,7 @@
android:padding="20dp"
android:elevation="3dp"
app:tint="@color/white"
app:layout_constraintTop_toBottomOf="@id/handle"
app:layout_constraintTop_toBottomOf="@id/numpad_handle"
app:layout_constraintStart_toEndOf="@id/digits_history"
app:layout_constraintEnd_toEndOf="parent"/>
@ -92,7 +92,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
app:layout_constraintTop_toBottomOf="@id/handle"
app:layout_constraintTop_toBottomOf="@id/numpad_handle"
app:layout_constraintStart_toStartOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
@ -102,7 +102,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2"
app:layout_constraintTop_toBottomOf="@id/handle"
app:layout_constraintTop_toBottomOf="@id/numpad_handle"
app:layout_constraintStart_toStartOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
@ -112,7 +112,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3"
app:layout_constraintTop_toBottomOf="@id/handle"
app:layout_constraintTop_toBottomOf="@id/numpad_handle"
app:layout_constraintStart_toStartOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
@ -122,7 +122,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="4"
app:layout_constraintTop_toBottomOf="@id/handle"
app:layout_constraintTop_toBottomOf="@id/numpad_handle"
app:layout_constraintStart_toStartOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
@ -132,7 +132,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="5"
app:layout_constraintTop_toBottomOf="@id/handle"
app:layout_constraintTop_toBottomOf="@id/numpad_handle"
app:layout_constraintStart_toStartOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
@ -142,7 +142,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="6"
app:layout_constraintTop_toBottomOf="@id/handle"
app:layout_constraintTop_toBottomOf="@id/numpad_handle"
app:layout_constraintStart_toStartOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
@ -152,7 +152,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="7"
app:layout_constraintTop_toBottomOf="@id/handle"
app:layout_constraintTop_toBottomOf="@id/numpad_handle"
app:layout_constraintStart_toStartOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
@ -172,7 +172,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="9"
app:layout_constraintTop_toBottomOf="@id/handle"
app:layout_constraintTop_toBottomOf="@id/numpad_handle"
app:layout_constraintStart_toStartOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
@ -182,7 +182,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="*"
app:layout_constraintTop_toBottomOf="@id/handle"
app:layout_constraintTop_toBottomOf="@id/numpad_handle"
app:layout_constraintStart_toStartOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
@ -192,7 +192,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
app:layout_constraintTop_toBottomOf="@id/handle"
app:layout_constraintTop_toBottomOf="@id/numpad_handle"
app:layout_constraintStart_toStartOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
@ -202,7 +202,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#"
app:layout_constraintTop_toBottomOf="@id/handle"
app:layout_constraintTop_toBottomOf="@id/numpad_handle"
app:layout_constraintStart_toStartOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -22,7 +22,7 @@
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
android:id="@+id/handle"
android:id="@+id/call_stats_handle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="11dp"
@ -41,7 +41,7 @@
android:layout_marginTop="10dp"
android:layout_marginBottom="20dp"
android:background="@drawable/shape_squircle_gray_600_background"
app:layout_constraintTop_toBottomOf="@id/handle"
app:layout_constraintTop_toBottomOf="@id/call_stats_handle"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/video_stats"

View file

@ -52,35 +52,37 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="top"
app:constraint_referenced_ids="reply, resend" />
app:constraint_referenced_ids="action_reply, action_resend" />
<include
<ViewStub
android:id="@+id/outgoing_bubble"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="12dp"
android:layout="@layout/chat_bubble_outgoing"
android:visibility="@{model.outgoing ? View.VISIBLE : View.GONE, default=gone}"
bind:inflatedVisibility="@{model.outgoing ? View.VISIBLE : View.GONE, default=gone}"
app:layout_constraintTop_toBottomOf="@id/emojis"
app:layout_constraintBottom_toTopOf="@id/bottom_barrier"
app:layout_constraintHeight_max="@dimen/chat_bubble_max_height_long_press"
bind:model="@{model}"
layout="@layout/chat_bubble_outgoing"/>
bind:model="@{model}"/>
<include
<ViewStub
android:id="@+id/incoming_bubble"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="12dp"
android:layout="@layout/chat_bubble_incoming"
android:visibility="@{model.outgoing ? View.GONE : View.VISIBLE}"
bind:inflatedVisibility="@{model.outgoing ? View.GONE : View.VISIBLE}"
app:layout_constraintTop_toBottomOf="@id/emojis"
app:layout_constraintBottom_toBottomOf="@id/bottom_barrier"
app:layout_constraintHeight_max="@dimen/chat_bubble_max_height_long_press"
bind:model="@{model}"
layout="@layout/chat_bubble_incoming"/>
bind:model="@{model}"/>
<include
android:id="@+id/emojis"
@ -107,7 +109,7 @@
<androidx.appcompat.widget.AppCompatTextView
style="@style/context_menu_action_label_style"
android:id="@+id/resend"
android:id="@+id/action_resend"
android:onClick="@{resendClickListener}"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -116,13 +118,13 @@
android:layout_marginBottom="1dp"
android:drawableStart="@drawable/paper_plane_right"
android:visibility="@{model.isInError &amp;&amp; model.isOutgoing ? View.VISIBLE : View.GONE, default=gone}"
app:layout_constraintBottom_toTopOf="@id/reply"
app:layout_constraintBottom_toTopOf="@id/action_reply"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/context_menu_action_label_style"
android:id="@+id/reply"
android:id="@+id/action_reply"
android:onClick="@{replyClickListener}"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -131,13 +133,13 @@
android:background="@drawable/menu_item_background"
android:layout_marginBottom="1dp"
android:drawableStart="@drawable/reply"
app:layout_constraintBottom_toTopOf="@id/copy"
app:layout_constraintBottom_toTopOf="@id/action_copy"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/context_menu_action_label_style"
android:id="@+id/copy"
android:id="@+id/action_copy"
android:onClick="@{copyClickListener}"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -145,13 +147,13 @@
android:background="@drawable/menu_item_background"
android:layout_marginBottom="1dp"
android:drawableStart="@drawable/copy"
app:layout_constraintBottom_toTopOf="@id/forward"
app:layout_constraintBottom_toTopOf="@id/action_forward"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/context_menu_action_label_style"
android:id="@+id/forward"
android:id="@+id/action_forward"
android:onClick="@{forwardClickListener}"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -160,13 +162,13 @@
android:layout_marginBottom="1dp"
android:drawableStart="@drawable/forward"
android:visibility="@{hideForward ? View.GONE : View.VISIBLE}"
app:layout_constraintBottom_toTopOf="@id/delete"
app:layout_constraintBottom_toTopOf="@id/action_delete"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/context_menu_danger_action_label_style"
android:id="@+id/delete"
android:id="@+id/action_delete"
android:onClick="@{deleteClickListener}"
android:layout_width="0dp"
android:layout_height="wrap_content"

View file

@ -15,7 +15,7 @@
android:background="?attr/color_main2_000">
<View
android:id="@+id/separator"
android:id="@+id/attachments_separator"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/color_main2_300"
@ -30,12 +30,12 @@
app:justifyContent="flex_start"
entries="@{viewModel.attachments}"
layout="@{@layout/chat_bubble_content_grid_cell}"
app:layout_constraintTop_toBottomOf="@id/separator"
app:layout_constraintTop_toBottomOf="@id/attachments_separator"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<ImageView
android:id="@+id/close"
android:id="@+id/attachments_close"
android:onClick="@{() -> viewModel.closeFileAttachmentsList()}"
android:layout_width="@dimen/icon_size"
android:layout_height="@dimen/icon_size"
@ -45,7 +45,7 @@
android:contentDescription="@string/content_description_chat_remove_attachments"
app:tint="@color/icon_color_selector"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/separator" />
app:layout_constraintTop_toBottomOf="@id/attachments_separator" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -15,7 +15,7 @@
android:background="?attr/color_main2_000">
<View
android:id="@+id/separator"
android:id="@+id/participants_separator"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/color_main2_300"
@ -28,7 +28,7 @@
app:layout_constraintHeight_max="@dimen/chat_room_participants_list_max_height"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/separator">
app:layout_constraintTop_toBottomOf="@id/participants_separator">
<LinearLayout
android:layout_width="match_parent"
@ -41,7 +41,7 @@
</androidx.core.widget.NestedScrollView>
<ImageView
android:id="@+id/close"
android:id="@+id/participants_close"
android:onClick="@{() -> viewModel.closeParticipantsList()}"
android:layout_width="@dimen/icon_size"
android:layout_height="@dimen/icon_size"
@ -51,7 +51,7 @@
android:contentDescription="@string/content_description_chat_close_participants_list"
app:tint="@color/icon_color_selector"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/separator" />
app:layout_constraintTop_toBottomOf="@id/participants_separator" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -41,7 +41,7 @@
android:max="@{viewModel.voiceRecordingDuration}"
tools:progress="60"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/send_message"
app:layout_constraintEnd_toStartOf="@id/voice_recording_send_message"
app:layout_constraintStart_toEndOf="@id/cancel_voice_message"
app:layout_constraintTop_toTopOf="parent" />
@ -121,7 +121,7 @@
app:layout_constraintTop_toTopOf="@id/voice_record_progress"/>
<ImageView
android:id="@+id/send_message"
android:id="@+id/voice_recording_send_message"
android:layout_width="40dp"
android:layout_height="0dp"
android:layout_marginEnd="4dp"

View file

@ -15,7 +15,7 @@
android:background="?attr/color_main2_000">
<View
android:id="@+id/separator"
android:id="@+id/reply_separator"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/color_main2_300"

View file

@ -13,7 +13,7 @@
android:paddingBottom="10dp">
<ImageView
android:id="@+id/background"
android:id="@+id/secured_background"
android:layout_width="0dp"
android:layout_height="0dp"
android:contentDescription="@null"
@ -25,7 +25,7 @@
app:layout_constraintBottom_toBottomOf="parent"/>
<ImageView
android:id="@+id/icon"
android:id="@+id/secured_icon"
android:layout_width="@dimen/small_icon_size"
android:layout_height="0dp"
android:layout_marginEnd="5dp"
@ -34,13 +34,13 @@
android:contentDescription="@null"
android:src="@drawable/lock_simple_bold"
app:tint="@color/blue_info_500"
app:layout_constraintTop_toTopOf="@id/title"
app:layout_constraintBottom_toBottomOf="@id/title"
app:layout_constraintEnd_toStartOf="@id/title"/>
app:layout_constraintTop_toTopOf="@id/secured_title"
app:layout_constraintBottom_toBottomOf="@id/secured_title"
app:layout_constraintEnd_toStartOf="@id/secured_title"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_700"
android:id="@+id/title"
android:id="@+id/secured_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
@ -56,7 +56,7 @@
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/subtitle"
android:id="@+id/secured_subtitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingStart="5dp"
@ -69,7 +69,7 @@
app:layout_constraintWidth_max="300dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/title"/>
app:layout_constraintTop_toBottomOf="@id/secured_title"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -13,7 +13,7 @@
android:paddingBottom="10dp">
<ImageView
android:id="@+id/background"
android:id="@+id/disabled_background"
android:layout_width="0dp"
android:layout_height="0dp"
android:contentDescription="@null"
@ -25,7 +25,7 @@
app:layout_constraintBottom_toBottomOf="parent"/>
<ImageView
android:id="@+id/icon"
android:id="@+id/disabled_icon"
android:layout_width="@dimen/small_icon_size"
android:layout_height="0dp"
android:layout_marginEnd="5dp"
@ -34,13 +34,13 @@
android:contentDescription="@null"
android:src="@drawable/lock_simple_open_bold"
app:tint="@color/orange_warning_600"
app:layout_constraintTop_toTopOf="@id/title"
app:layout_constraintBottom_toBottomOf="@id/title"
app:layout_constraintEnd_toStartOf="@id/title"/>
app:layout_constraintTop_toTopOf="@id/disabled_title"
app:layout_constraintBottom_toBottomOf="@id/disabled_title"
app:layout_constraintEnd_toStartOf="@id/disabled_title"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_700"
android:id="@+id/title"
android:id="@+id/disabled_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
@ -56,7 +56,7 @@
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/subtitle"
android:id="@+id/disabled_subtitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingStart="5dp"
@ -69,7 +69,7 @@
app:layout_constraintWidth_max="300dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/title"/>
app:layout_constraintTop_toBottomOf="@id/disabled_title"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -42,11 +42,11 @@
app:layout_constraintTop_toTopOf="@id/dialog_background"
app:layout_constraintStart_toStartOf="@id/dialog_background"
app:layout_constraintEnd_toEndOf="@id/dialog_background"
app:layout_constraintBottom_toTopOf="@id/title"/>
app:layout_constraintBottom_toTopOf="@id/dialog_title"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_800"
android:id="@+id/title"
android:id="@+id/dialog_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"