From 49cad8feec7096612a339fb7b97a7891d4dee0a7 Mon Sep 17 00:00:00 2001 From: Benoit Marty <benoit@matrix.org> Date: Fri, 11 Dec 2020 11:49:46 +0100 Subject: [PATCH 1/6] Rename files. --- .../features/home/room/detail/RoomDetailFragment.kt | 2 +- .../home/room/detail/composer/TextComposerView.kt | 12 ++++++------ ...merge_composer_layout.xml => composer_layout.xml} | 2 +- ...ml => composer_layout_constraint_set_compact.xml} | 0 ...l => composer_layout_constraint_set_expanded.xml} | 0 5 files changed, 8 insertions(+), 8 deletions(-) rename vector/src/main/res/layout/{merge_composer_layout.xml => composer_layout.xml} (98%) rename vector/src/main/res/layout/{constraint_set_composer_layout_compact.xml => composer_layout_constraint_set_compact.xml} (100%) rename vector/src/main/res/layout/{constraint_set_composer_layout_expanded.xml => composer_layout_constraint_set_expanded.xml} (100%) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt index 93b2b69ba5..a8cd8590c4 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt @@ -165,7 +165,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.schedulers.Schedulers import kotlinx.android.parcel.Parcelize import kotlinx.android.synthetic.main.fragment_room_detail.* -import kotlinx.android.synthetic.main.merge_composer_layout.view.* +import kotlinx.android.synthetic.main.composer_layout.view.* import kotlinx.android.synthetic.main.merge_overlay_waiting_view.* import org.billcarsonfr.jsonviewer.JSonViewerDialog import org.commonmark.parser.Parser diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/TextComposerView.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/TextComposerView.kt index af0e1a91f0..f232e9a65e 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/TextComposerView.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/TextComposerView.kt @@ -36,7 +36,7 @@ import androidx.transition.TransitionSet import butterknife.BindView import butterknife.ButterKnife import im.vector.app.R -import kotlinx.android.synthetic.main.merge_composer_layout.view.* +import kotlinx.android.synthetic.main.composer_layout.view.* import org.matrix.android.sdk.api.crypto.RoomEncryptionTrustLevel /** @@ -86,7 +86,7 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib get() = composerEditText.text init { - inflate(context, R.layout.merge_composer_layout, this) + inflate(context, R.layout.composer_layout, this) ButterKnife.bind(this) collapse(false) composerEditText.callback = object : ComposerEditText.Callback { @@ -110,20 +110,20 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib } fun collapse(animate: Boolean = true, transitionComplete: (() -> Unit)? = null) { - if (currentConstraintSetId == R.layout.constraint_set_composer_layout_compact) { + if (currentConstraintSetId == R.layout.composer_layout_constraint_set_compact) { // ignore we good return } - currentConstraintSetId = R.layout.constraint_set_composer_layout_compact + currentConstraintSetId = R.layout.composer_layout_constraint_set_compact applyNewConstraintSet(animate, transitionComplete) } fun expand(animate: Boolean = true, transitionComplete: (() -> Unit)? = null) { - if (currentConstraintSetId == R.layout.constraint_set_composer_layout_expanded) { + if (currentConstraintSetId == R.layout.composer_layout_constraint_set_expanded) { // ignore we good return } - currentConstraintSetId = R.layout.constraint_set_composer_layout_expanded + currentConstraintSetId = R.layout.composer_layout_constraint_set_expanded applyNewConstraintSet(animate, transitionComplete) } diff --git a/vector/src/main/res/layout/merge_composer_layout.xml b/vector/src/main/res/layout/composer_layout.xml similarity index 98% rename from vector/src/main/res/layout/merge_composer_layout.xml rename to vector/src/main/res/layout/composer_layout.xml index ea2bc1bf30..cb5dcbc42c 100644 --- a/vector/src/main/res/layout/merge_composer_layout.xml +++ b/vector/src/main/res/layout/composer_layout.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - tools:constraintSet="@layout/constraint_set_composer_layout_compact" + tools:constraintSet="@layout/composer_layout_constraint_set_compact" tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout"> <!-- ======================== diff --git a/vector/src/main/res/layout/constraint_set_composer_layout_compact.xml b/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml similarity index 100% rename from vector/src/main/res/layout/constraint_set_composer_layout_compact.xml rename to vector/src/main/res/layout/composer_layout_constraint_set_compact.xml diff --git a/vector/src/main/res/layout/constraint_set_composer_layout_expanded.xml b/vector/src/main/res/layout/composer_layout_constraint_set_expanded.xml similarity index 100% rename from vector/src/main/res/layout/constraint_set_composer_layout_expanded.xml rename to vector/src/main/res/layout/composer_layout_constraint_set_expanded.xml From d996c77c03ff478a9603360159711a075f6fa1e7 Mon Sep 17 00:00:00 2001 From: Benoit Marty <benoit@matrix.org> Date: Fri, 11 Dec 2020 12:09:08 +0100 Subject: [PATCH 2/6] Fix typo --- vector/src/main/res/layout/composer_layout.xml | 2 +- .../composer_layout_constraint_set_compact.xml | 2 +- .../composer_layout_constraint_set_expanded.xml | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/vector/src/main/res/layout/composer_layout.xml b/vector/src/main/res/layout/composer_layout.xml index cb5dcbc42c..a1d6675278 100644 --- a/vector/src/main/res/layout/composer_layout.xml +++ b/vector/src/main/res/layout/composer_layout.xml @@ -12,7 +12,7 @@ /!\ These 3 files must be modified to stay coherent! ======================== --> <View - android:id="@+id/related_message_backround" + android:id="@+id/related_message_background" android:layout_width="0dp" android:layout_height="0dp" android:background="?riotx_bottom_nav_background_color" diff --git a/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml b/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml index 6b9fbd4885..4c91ba6b38 100644 --- a/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml +++ b/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml @@ -10,7 +10,7 @@ app:layout_constraintStart_toStartOf="parent"> <View - android:id="@+id/related_message_backround" + android:id="@+id/related_message_background" android:layout_width="0dp" android:layout_height="0dp" android:background="?riotx_bottom_nav_background_color" diff --git a/vector/src/main/res/layout/composer_layout_constraint_set_expanded.xml b/vector/src/main/res/layout/composer_layout_constraint_set_expanded.xml index f52b072ece..4443fe9e6c 100644 --- a/vector/src/main/res/layout/composer_layout_constraint_set_expanded.xml +++ b/vector/src/main/res/layout/composer_layout_constraint_set_expanded.xml @@ -10,7 +10,7 @@ app:layout_constraintStart_toStartOf="parent"> <View - android:id="@+id/related_message_backround" + android:id="@+id/related_message_background" android:layout_width="match_parent" android:layout_height="0dp" android:background="?riotx_bottom_nav_background_color" @@ -22,18 +22,18 @@ android:layout_width="0dp" android:layout_height="1dp" android:background="?riotx_bottom_nav_background_border_color" - app:layout_constraintEnd_toEndOf="@id/related_message_backround" - app:layout_constraintStart_toStartOf="@+id/related_message_backround" - app:layout_constraintTop_toTopOf="@id/related_message_backround" /> + app:layout_constraintEnd_toEndOf="@id/related_message_background" + app:layout_constraintStart_toStartOf="@+id/related_message_background" + app:layout_constraintTop_toTopOf="@id/related_message_background" /> <View android:id="@+id/related_message_background_bottom_separator" android:layout_width="0dp" android:layout_height="1dp" android:background="?riotx_bottom_nav_background_border_color" - app:layout_constraintBottom_toBottomOf="@id/related_message_backround" - app:layout_constraintEnd_toEndOf="@id/related_message_backround" - app:layout_constraintStart_toStartOf="@+id/related_message_backround" /> + app:layout_constraintBottom_toBottomOf="@id/related_message_background" + app:layout_constraintEnd_toEndOf="@id/related_message_background" + app:layout_constraintStart_toStartOf="@+id/related_message_background" /> <ImageView android:id="@+id/composer_related_message_avatar_view" From 705b6176f11d5e4a47076d2d6f3125a2606bd38b Mon Sep 17 00:00:00 2001 From: Benoit Marty <benoit@matrix.org> Date: Fri, 11 Dec 2020 12:17:23 +0100 Subject: [PATCH 3/6] Fix Layout issue (visible only on RTL) (#2523) --- .../main/res/layout/composer_layout_constraint_set_compact.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml b/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml index 4c91ba6b38..e1eb0f01c3 100644 --- a/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml +++ b/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml @@ -113,7 +113,7 @@ android:layout_width="16dp" android:layout_height="16dp" app:layout_constraintBottom_toBottomOf="@id/attachmentButton" - app:layout_constraintEnd_toStartOf="@+id/attachmentButton" + app:layout_constraintEnd_toStartOf="@+id/composerEditText" app:layout_constraintStart_toEndOf="@+id/attachmentButton" app:layout_constraintTop_toTopOf="@id/attachmentButton" tools:src="@drawable/ic_shield_black" From 32fd3be73235cd6392ac911237f6b10bb6d5dc79 Mon Sep 17 00:00:00 2001 From: Benoit Marty <benoit@matrix.org> Date: Fri, 11 Dec 2020 12:41:35 +0100 Subject: [PATCH 4/6] Better alignment of button and animation, bigger touch area for send button --- vector/src/main/res/drawable/bg_send.xml | 6 +++++- .../composer_layout_constraint_set_compact.xml | 16 ++++++++-------- ...composer_layout_constraint_set_expanded.xml | 18 +++++++++--------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/vector/src/main/res/drawable/bg_send.xml b/vector/src/main/res/drawable/bg_send.xml index 4b357d7ab1..8ab95bf5c5 100644 --- a/vector/src/main/res/drawable/bg_send.xml +++ b/vector/src/main/res/drawable/bg_send.xml @@ -1,6 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> - <item> + <item + android:bottom="10dp" + android:left="10dp" + android:right="10dp" + android:top="10dp"> <shape android:shape="oval"> <solid android:color="@color/riotx_accent" /> </shape> diff --git a/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml b/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml index e1eb0f01c3..231e58c68a 100644 --- a/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml +++ b/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml @@ -102,20 +102,20 @@ android:layout_margin="12dp" android:background="?android:attr/selectableItemBackground" android:src="@drawable/ic_attachment" - app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintBottom_toBottomOf="@id/sendButton" app:layout_constraintEnd_toStartOf="@+id/composer_shield" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" + app:layout_constraintTop_toTopOf="@id/sendButton" tools:ignore="MissingPrefix" /> <ImageView android:id="@+id/composer_shield" android:layout_width="16dp" android:layout_height="16dp" - app:layout_constraintBottom_toBottomOf="@id/attachmentButton" + app:layout_constraintBottom_toBottomOf="@id/sendButton" app:layout_constraintEnd_toStartOf="@+id/composerEditText" app:layout_constraintStart_toEndOf="@+id/attachmentButton" - app:layout_constraintTop_toTopOf="@id/attachmentButton" + app:layout_constraintTop_toTopOf="@id/sendButton" tools:src="@drawable/ic_shield_black" tools:visibility="visible" /> @@ -145,11 +145,11 @@ <ImageButton android:id="@+id/sendButton" - android:layout_width="36dp" - android:layout_height="36dp" - android:layout_marginEnd="12dp" - android:layout_marginBottom="10dp" + android:layout_width="56dp" + android:layout_height="56dp" + android:layout_marginEnd="2dp" android:background="@drawable/bg_send" + android:scaleType="center" android:src="@drawable/ic_send" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/vector/src/main/res/layout/composer_layout_constraint_set_expanded.xml b/vector/src/main/res/layout/composer_layout_constraint_set_expanded.xml index 4443fe9e6c..379173faed 100644 --- a/vector/src/main/res/layout/composer_layout_constraint_set_expanded.xml +++ b/vector/src/main/res/layout/composer_layout_constraint_set_expanded.xml @@ -106,8 +106,9 @@ android:layout_height="48dp" android:background="?android:attr/selectableItemBackground" android:src="@drawable/ic_attachment" - app:layout_constraintStart_toStartOf="@id/composerEditText" - app:layout_constraintTop_toBottomOf="parent" + app:layout_constraintBottom_toBottomOf="@+id/sendButton" + app:layout_constraintEnd_toStartOf="parent" + app:layout_constraintTop_toTopOf="@+id/sendButton" tools:ignore="MissingPrefix" /> <ImageView @@ -115,10 +116,10 @@ android:layout_width="16dp" android:layout_height="16dp" android:layout_marginStart="8dp" - app:layout_constraintBottom_toBottomOf="@id/composer_emoji" + app:layout_constraintBottom_toBottomOf="@+id/sendButton" app:layout_constraintEnd_toStartOf="@+id/composerEditText" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="@id/composer_emoji" + app:layout_constraintTop_toTopOf="@+id/sendButton" tools:src="@drawable/ic_shield_black" /> <ImageButton @@ -147,13 +148,12 @@ <ImageButton android:id="@+id/sendButton" - android:layout_width="36dp" - android:layout_height="36dp" + android:layout_width="56dp" + android:layout_height="56dp" + android:layout_marginEnd="2dp" android:background="@drawable/bg_send" + android:scaleType="center" android:src="@drawable/ic_send" - android:layout_marginTop="10dp" - android:layout_marginBottom="10dp" - android:layout_marginEnd="12dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@id/composer_preview_barrier" From 8d30658fa52a939f1228d5a9f8eeb65ff3c5212f Mon Sep 17 00:00:00 2001 From: Benoit Marty <benoit@matrix.org> Date: Fri, 11 Dec 2020 12:46:44 +0100 Subject: [PATCH 5/6] Bigger touch area for the other buttons --- .../composer_layout_constraint_set_compact.xml | 13 ++++++------- .../composer_layout_constraint_set_expanded.xml | 12 ++++++------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml b/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml index 231e58c68a..2de3efc8ee 100644 --- a/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml +++ b/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml @@ -97,9 +97,9 @@ <ImageButton android:id="@+id/attachmentButton" - android:layout_width="32dp" - android:layout_height="32dp" - android:layout_margin="12dp" + android:layout_width="52dp" + android:layout_height="52dp" + android:layout_margin="1dp" android:background="?android:attr/selectableItemBackground" android:src="@drawable/ic_attachment" app:layout_constraintBottom_toBottomOf="@id/sendButton" @@ -121,10 +121,9 @@ <ImageButton android:id="@+id/composer_emoji" - android:layout_width="32dp" - android:layout_height="32dp" - android:layout_marginStart="10dp" - android:layout_marginEnd="10dp" + android:layout_width="52dp" + android:layout_height="52dp" + android:layout_margin="1dp" android:background="?android:attr/selectableItemBackground" android:src="@drawable/ic_insert_emoji" app:layout_constraintBottom_toBottomOf="@id/sendButton" diff --git a/vector/src/main/res/layout/composer_layout_constraint_set_expanded.xml b/vector/src/main/res/layout/composer_layout_constraint_set_expanded.xml index 379173faed..75dbdfd2a8 100644 --- a/vector/src/main/res/layout/composer_layout_constraint_set_expanded.xml +++ b/vector/src/main/res/layout/composer_layout_constraint_set_expanded.xml @@ -102,8 +102,9 @@ <ImageButton android:id="@+id/attachmentButton" - android:layout_width="48dp" - android:layout_height="48dp" + android:layout_width="52dp" + android:layout_height="52dp" + android:layout_margin="1dp" android:background="?android:attr/selectableItemBackground" android:src="@drawable/ic_attachment" app:layout_constraintBottom_toBottomOf="@+id/sendButton" @@ -124,10 +125,9 @@ <ImageButton android:id="@+id/composer_emoji" - android:layout_width="32dp" - android:layout_height="32dp" - android:layout_marginStart="10dp" - android:layout_marginEnd="10dp" + android:layout_width="52dp" + android:layout_height="52dp" + android:layout_margin="1dp" android:background="?android:attr/selectableItemBackground" android:src="@drawable/ic_insert_emoji" app:layout_constraintBottom_toBottomOf="@id/sendButton" From 9b0c2e420d1b9499c5dd99267e3138aae953eb29 Mon Sep 17 00:00:00 2001 From: Benoit Marty <benoit@matrix.org> Date: Fri, 11 Dec 2020 13:18:22 +0100 Subject: [PATCH 6/6] Reorder Views (no other change) --- .../src/main/res/layout/composer_layout.xml | 56 +++++++-------- ...composer_layout_constraint_set_compact.xml | 72 +++++++++---------- ...omposer_layout_constraint_set_expanded.xml | 46 ++++++------ 3 files changed, 87 insertions(+), 87 deletions(-) diff --git a/vector/src/main/res/layout/composer_layout.xml b/vector/src/main/res/layout/composer_layout.xml index a1d6675278..cb0b37d844 100644 --- a/vector/src/main/res/layout/composer_layout.xml +++ b/vector/src/main/res/layout/composer_layout.xml @@ -39,13 +39,6 @@ tools:ignore="MissingConstraints" tools:src="@tools:sample/avatars" /> - <ImageView - android:id="@+id/composer_shield" - android:layout_width="0dp" - android:layout_height="0dp" - tools:ignore="MissingConstraints" - tools:src="@drawable/ic_shield_black" /> - <TextView android:id="@+id/composer_related_message_sender" android:layout_width="0dp" @@ -83,23 +76,6 @@ android:tint="@color/riotx_notice" tools:ignore="MissingConstraints" /> - <ImageButton - android:id="@+id/composer_emoji" - android:layout_width="0dp" - android:layout_height="0dp" - android:background="?android:attr/selectableItemBackground" - android:src="@drawable/ic_insert_emoji" - tools:ignore="MissingConstraints" /> - - <ImageButton - android:id="@+id/attachmentButton" - android:layout_width="0dp" - android:layout_height="0dp" - android:background="?android:attr/selectableItemBackground" - android:contentDescription="@string/option_send_files" - android:src="@drawable/ic_attachment" - tools:ignore="MissingConstraints" /> - <androidx.constraintlayout.widget.Barrier android:id="@+id/composer_preview_barrier" android:layout_width="0dp" @@ -111,14 +87,21 @@ app:layout_constraintStart_toStartOf="parent" /> <ImageButton - android:id="@+id/sendButton" + android:id="@+id/attachmentButton" android:layout_width="0dp" android:layout_height="0dp" - android:background="@drawable/bg_send" - android:contentDescription="@string/send" - android:src="@drawable/ic_send" + android:background="?android:attr/selectableItemBackground" + android:contentDescription="@string/option_send_files" + android:src="@drawable/ic_attachment" tools:ignore="MissingConstraints" /> + <ImageView + android:id="@+id/composer_shield" + android:layout_width="0dp" + android:layout_height="0dp" + tools:ignore="MissingConstraints" + tools:src="@drawable/ic_shield_black" /> + <im.vector.app.features.home.room.detail.composer.ComposerEditText android:id="@+id/composerEditText" style="@style/ComposerEditTextStyle" @@ -129,4 +112,21 @@ tools:hint="@string/room_message_placeholder_not_encrypted" tools:ignore="MissingConstraints" /> + <ImageButton + android:id="@+id/composer_emoji" + android:layout_width="0dp" + android:layout_height="0dp" + android:background="?android:attr/selectableItemBackground" + android:src="@drawable/ic_insert_emoji" + tools:ignore="MissingConstraints" /> + + <ImageButton + android:id="@+id/sendButton" + android:layout_width="0dp" + android:layout_height="0dp" + android:background="@drawable/bg_send" + android:contentDescription="@string/send" + android:src="@drawable/ic_send" + tools:ignore="MissingConstraints" /> + </merge> diff --git a/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml b/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml index 2de3efc8ee..a4dfcf019c 100644 --- a/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml +++ b/vector/src/main/res/layout/composer_layout_constraint_set_compact.xml @@ -95,6 +95,16 @@ tools:ignore="MissingPrefix" tools:visibility="visible" /> + <androidx.constraintlayout.widget.Barrier + android:id="@+id/composer_preview_barrier" + android:layout_width="0dp" + android:layout_height="0dp" + app:barrierDirection="bottom" + app:barrierMargin="8dp" + app:constraint_referenced_ids="composer_related_message_preview,composer_related_message_action_image" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" /> + <ImageButton android:id="@+id/attachmentButton" android:layout_width="52dp" @@ -119,42 +129,6 @@ tools:src="@drawable/ic_shield_black" tools:visibility="visible" /> - <ImageButton - android:id="@+id/composer_emoji" - android:layout_width="52dp" - android:layout_height="52dp" - android:layout_margin="1dp" - android:background="?android:attr/selectableItemBackground" - android:src="@drawable/ic_insert_emoji" - app:layout_constraintBottom_toBottomOf="@id/sendButton" - app:layout_constraintEnd_toStartOf="@+id/sendButton" - app:layout_constraintStart_toEndOf="@id/composerEditText" - app:layout_constraintTop_toTopOf="@id/sendButton" - app:layout_goneMarginEnd="8dp" /> - - <androidx.constraintlayout.widget.Barrier - android:id="@+id/composer_preview_barrier" - android:layout_width="0dp" - android:layout_height="0dp" - app:barrierDirection="bottom" - app:barrierMargin="8dp" - app:constraint_referenced_ids="composer_related_message_preview,composer_related_message_action_image" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" /> - - <ImageButton - android:id="@+id/sendButton" - android:layout_width="56dp" - android:layout_height="56dp" - android:layout_marginEnd="2dp" - android:background="@drawable/bg_send" - android:scaleType="center" - android:src="@drawable/ic_send" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toEndOf="@id/composer_emoji" - tools:ignore="MissingPrefix" /> - <im.vector.app.features.home.room.detail.composer.ComposerEditText android:id="@+id/composerEditText" style="@style/ComposerEditTextStyle" @@ -169,4 +143,30 @@ app:layout_constraintTop_toTopOf="parent" tools:text="@tools:sample/lorem/random" /> + <ImageButton + android:id="@+id/composer_emoji" + android:layout_width="52dp" + android:layout_height="52dp" + android:layout_margin="1dp" + android:background="?android:attr/selectableItemBackground" + android:src="@drawable/ic_insert_emoji" + app:layout_constraintBottom_toBottomOf="@id/sendButton" + app:layout_constraintEnd_toStartOf="@+id/sendButton" + app:layout_constraintStart_toEndOf="@id/composerEditText" + app:layout_constraintTop_toTopOf="@id/sendButton" + app:layout_goneMarginEnd="8dp" /> + + <ImageButton + android:id="@+id/sendButton" + android:layout_width="56dp" + android:layout_height="56dp" + android:layout_marginEnd="2dp" + android:background="@drawable/bg_send" + android:scaleType="center" + android:src="@drawable/ic_send" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@id/composer_emoji" + tools:ignore="MissingPrefix" /> + </androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/vector/src/main/res/layout/composer_layout_constraint_set_expanded.xml b/vector/src/main/res/layout/composer_layout_constraint_set_expanded.xml index 75dbdfd2a8..8a76c0547e 100644 --- a/vector/src/main/res/layout/composer_layout_constraint_set_expanded.xml +++ b/vector/src/main/res/layout/composer_layout_constraint_set_expanded.xml @@ -100,6 +100,16 @@ app:tint="@color/riotx_notice" tools:ignore="MissingPrefix" /> + <androidx.constraintlayout.widget.Barrier + android:id="@+id/composer_preview_barrier" + android:layout_width="0dp" + android:layout_height="0dp" + app:barrierDirection="bottom" + app:barrierMargin="8dp" + app:constraint_referenced_ids="composer_related_message_preview,composer_related_message_action_image" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" /> + <ImageButton android:id="@+id/attachmentButton" android:layout_width="52dp" @@ -123,6 +133,19 @@ app:layout_constraintTop_toTopOf="@+id/sendButton" tools:src="@drawable/ic_shield_black" /> + <im.vector.app.features.home.room.detail.composer.ComposerEditText + android:id="@+id/composerEditText" + style="@style/ComposerEditTextStyle" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:nextFocusLeft="@id/composerEditText" + android:nextFocusUp="@id/composerEditText" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/composer_emoji" + app:layout_constraintStart_toEndOf="@+id/composer_shield" + app:layout_constraintTop_toBottomOf="@id/composer_preview_barrier" + tools:text="@tools:sample/lorem/random" /> + <ImageButton android:id="@+id/composer_emoji" android:layout_width="52dp" @@ -136,16 +159,6 @@ app:layout_constraintTop_toTopOf="@id/sendButton" app:layout_goneMarginEnd="8dp" /> - <androidx.constraintlayout.widget.Barrier - android:id="@+id/composer_preview_barrier" - android:layout_width="0dp" - android:layout_height="0dp" - app:barrierDirection="bottom" - app:barrierMargin="8dp" - app:constraint_referenced_ids="composer_related_message_preview,composer_related_message_action_image" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" /> - <ImageButton android:id="@+id/sendButton" android:layout_width="56dp" @@ -160,17 +173,4 @@ app:layout_constraintVertical_bias="1" tools:ignore="MissingPrefix" /> - <im.vector.app.features.home.room.detail.composer.ComposerEditText - android:id="@+id/composerEditText" - style="@style/ComposerEditTextStyle" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:nextFocusLeft="@id/composerEditText" - android:nextFocusUp="@id/composerEditText" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toStartOf="@+id/composer_emoji" - app:layout_constraintStart_toEndOf="@+id/composer_shield" - app:layout_constraintTop_toBottomOf="@id/composer_preview_barrier" - tools:text="@tools:sample/lorem/random" /> - </androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file