Fix bad rendering of file item if the filename is long

This commit is contained in:
Benoit Marty 2019-09-25 15:25:26 +02:00
parent 643a2baabf
commit 1b66d1f746
1 changed files with 44 additions and 42 deletions

View File

@ -2,30 +2,21 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/messageFileLayout" android:id="@+id/messageFileLayout"
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:paddingTop="8dp"
android:layout_marginEnd="32dp" android:paddingBottom="8dp">
android:layout_marginRight="32dp"
android:layout_marginBottom="8dp"
android:duplicateParentState="true"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView <ImageView
android:id="@+id/messageFilee2eIcon" android:id="@+id/messageFilee2eIcon"
android:layout_width="14dp" android:layout_width="14dp"
android:layout_height="14dp" android:layout_height="14dp"
android:src="@drawable/e2e_verified" android:src="@drawable/e2e_verified"
android:visibility="gone" /> android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />
<!-- the media type --> <!-- the media type -->
<ImageView <ImageView
@ -34,21 +25,32 @@
android:layout_height="@dimen/chat_avatar_size" android:layout_height="@dimen/chat_avatar_size"
android:layout_marginStart="4dp" android:layout_marginStart="4dp"
android:layout_marginLeft="4dp" android:layout_marginLeft="4dp"
android:src="@drawable/filetype_image" /> app:layout_constraintStart_toEndOf="@+id/messageFilee2eIcon"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/filetype_image" />
<!-- the media --> <!-- the media -->
<TextView <TextView
android:id="@+id/messageFilenameView" android:id="@+id/messageFilenameView"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="@dimen/chat_avatar_size" android:layout_height="wrap_content"
android:layout_marginStart="4dp" android:layout_marginStart="4dp"
android:layout_marginLeft="4dp" android:layout_marginLeft="4dp"
android:layout_weight="1" android:layout_marginEnd="32dp"
android:autoLink="none" android:autoLink="none"
android:gravity="center_vertical" android:gravity="center_vertical"
android:minHeight="@dimen/chat_avatar_size"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/messageFileImageView"
app:layout_constraintTop_toTopOf="parent"
tools:text="A filename here" /> tools:text="A filename here" />
</LinearLayout> <androidx.constraintlayout.widget.Barrier
android:id="@+id/horizontalBarrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="messageFileImageView,messageFilenameView" />
<include <include
android:id="@+id/messageFileUploadProgressLayout" android:id="@+id/messageFileUploadProgressLayout"
@ -58,10 +60,10 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginEnd="32dp" android:layout_marginEnd="32dp"
android:layout_marginRight="32dp" android:layout_marginRight="32dp"
android:layout_marginBottom="8dp"
android:visibility="gone" android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/messageFileLayout" app:layout_constraintTop_toBottomOf="@+id/horizontalBarrier"
tools:visibility="visible" /> tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>