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,53 +2,55 @@
<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:id="@+id/messageFileLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingBottom="8dp">
<LinearLayout <ImageView
android:id="@+id/messageFileLayout" android:id="@+id/messageFilee2eIcon"
android:layout_width="14dp"
android:layout_height="14dp"
android:src="@drawable/e2e_verified"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />
<!-- the media type -->
<ImageView
android:id="@+id/messageFileImageView"
android:layout_width="@dimen/chat_avatar_size"
android:layout_height="@dimen/chat_avatar_size"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
app:layout_constraintStart_toEndOf="@+id/messageFilee2eIcon"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/filetype_image" />
<!-- the media -->
<TextView
android:id="@+id/messageFilenameView"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:layout_marginEnd="32dp" android:layout_marginEnd="32dp"
android:layout_marginRight="32dp" android:autoLink="none"
android:layout_marginBottom="8dp" android:gravity="center_vertical"
android:duplicateParentState="true" android:minHeight="@dimen/chat_avatar_size"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0" app:layout_constraintStart_toEndOf="@+id/messageFileImageView"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toTopOf="parent"> tools:text="A filename here" />
<ImageView <androidx.constraintlayout.widget.Barrier
android:id="@+id/messageFilee2eIcon" android:id="@+id/horizontalBarrier"
android:layout_width="14dp" android:layout_width="wrap_content"
android:layout_height="14dp" android:layout_height="wrap_content"
android:src="@drawable/e2e_verified" app:barrierDirection="bottom"
android:visibility="gone" /> app:constraint_referenced_ids="messageFileImageView,messageFilenameView" />
<!-- the media type -->
<ImageView
android:id="@+id/messageFileImageView"
android:layout_width="@dimen/chat_avatar_size"
android:layout_height="@dimen/chat_avatar_size"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:src="@drawable/filetype_image" />
<!-- the media -->
<TextView
android:id="@+id/messageFilenameView"
android:layout_width="0dp"
android:layout_height="@dimen/chat_avatar_size"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:layout_weight="1"
android:autoLink="none"
android:gravity="center_vertical"
tools:text="A filename here" />
</LinearLayout>
<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>