Fixed message layout performance

pull/147/head
M66B 6 years ago
parent b11e8beca9
commit 1dc019f511

@ -54,7 +54,7 @@
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:src="@drawable/baseline_person_24" android:src="@drawable/baseline_person_24"
app:layout_constraintBottom_toTopOf="@+id/barrier1" app:layout_constraintBottom_toBottomOf="@+id/tvFrom"
app:layout_constraintDimensionRatio="1:1" app:layout_constraintDimensionRatio="1:1"
app:layout_constraintStart_toEndOf="@id/paddingStart" app:layout_constraintStart_toEndOf="@id/paddingStart"
app:layout_constraintTop_toBottomOf="@id/paddingTop" /> app:layout_constraintTop_toBottomOf="@id/paddingTop" />
@ -66,10 +66,11 @@
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:ellipsize="end" android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1" android:maxLines="1"
android:minHeight="24dp"
android:text="From" android:text="From"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintBottom_toTopOf="@+id/barrier1"
app:layout_constraintEnd_toStartOf="@+id/tvSize" app:layout_constraintEnd_toStartOf="@+id/tvSize"
app:layout_constraintStart_toEndOf="@id/ivAvatar" app:layout_constraintStart_toEndOf="@id/ivAvatar"
app:layout_constraintTop_toBottomOf="@id/paddingTop" /> app:layout_constraintTop_toBottomOf="@id/paddingTop" />
@ -79,11 +80,12 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:gravity="center_vertical"
android:maxLines="1" android:maxLines="1"
android:text="123 KB" android:text="123 KB"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorUnread" android:textColor="?attr/colorUnread"
app:layout_constraintBottom_toTopOf="@+id/barrier1" app:layout_constraintBottom_toBottomOf="@+id/tvFrom"
app:layout_constraintEnd_toStartOf="@+id/tvTime" app:layout_constraintEnd_toStartOf="@+id/tvTime"
app:layout_constraintTop_toBottomOf="@id/paddingTop" /> app:layout_constraintTop_toBottomOf="@id/paddingTop" />
@ -92,20 +94,14 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:gravity="center_vertical"
android:maxLines="1" android:maxLines="1"
android:text="Time" android:text="Time"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintBottom_toTopOf="@+id/barrier1" app:layout_constraintBottom_toBottomOf="@+id/tvFrom"
app:layout_constraintEnd_toStartOf="@+id/ivFlagged" app:layout_constraintEnd_toStartOf="@+id/ivFlagged"
app:layout_constraintTop_toBottomOf="@id/paddingTop" /> app:layout_constraintTop_toBottomOf="@id/paddingTop" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="ivAvatar,tvFrom,tvSize,tvTime" />
<View <View
android:id="@+id/padding1" android:id="@+id/padding1"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -113,7 +109,7 @@
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_toTopOf="@id/barrier1" /> app:layout_constraintTop_toBottomOf="@id/tvFrom" />
<ImageView <ImageView
android:id="@+id/ivAnswered" android:id="@+id/ivAnswered"
@ -121,7 +117,7 @@
android:layout_height="21dp" android:layout_height="21dp"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:src="@drawable/baseline_reply_24" android:src="@drawable/baseline_reply_24"
app:layout_constraintBottom_toTopOf="@+id/barrier2" app:layout_constraintBottom_toBottomOf="@+id/tvSubject"
app:layout_constraintStart_toEndOf="@id/paddingStart" app:layout_constraintStart_toEndOf="@id/paddingStart"
app:layout_constraintTop_toBottomOf="@id/padding1" /> app:layout_constraintTop_toBottomOf="@id/padding1" />
@ -131,7 +127,7 @@
android:layout_height="21dp" android:layout_height="21dp"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:src="@drawable/baseline_attachment_24" android:src="@drawable/baseline_attachment_24"
app:layout_constraintBottom_toTopOf="@+id/barrier2" app:layout_constraintBottom_toBottomOf="@+id/tvSubject"
app:layout_constraintStart_toEndOf="@id/ivAnswered" app:layout_constraintStart_toEndOf="@id/ivAnswered"
app:layout_constraintTop_toBottomOf="@id/padding1" /> app:layout_constraintTop_toBottomOf="@id/padding1" />
@ -142,10 +138,11 @@
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:ellipsize="end" android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1" android:maxLines="1"
android:minHeight="21dp"
android:text="Subject" android:text="Subject"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintBottom_toTopOf="@+id/barrier2"
app:layout_constraintEnd_toStartOf="@+id/tvFolder" app:layout_constraintEnd_toStartOf="@+id/tvFolder"
app:layout_constraintStart_toEndOf="@id/ivAttachments" app:layout_constraintStart_toEndOf="@id/ivAttachments"
app:layout_constraintTop_toBottomOf="@id/padding1" /> app:layout_constraintTop_toBottomOf="@id/padding1" />
@ -156,14 +153,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:ellipsize="start" android:ellipsize="start"
android:gravity="end" android:gravity="end|center_vertical"
android:maxWidth="120dp" android:maxWidth="120dp"
android:singleLine="true" android:singleLine="true"
android:text="Folder" android:text="Folder"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintBottom_toTopOf="@+id/barrier2" app:layout_constraintBottom_toBottomOf="@id/tvSubject"
app:layout_constraintEnd_toStartOf="@+id/tvCount" app:layout_constraintEnd_toStartOf="@+id/tvCount"
app:layout_constraintStart_toEndOf="@+id/tvSubject" app:layout_constraintStart_toEndOf="@id/tvSubject"
app:layout_constraintTop_toBottomOf="@id/padding1" /> app:layout_constraintTop_toBottomOf="@id/padding1" />
<TextView <TextView
@ -171,10 +168,11 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="3dp" android:layout_marginEnd="3dp"
android:gravity="center_vertical"
android:maxLines="1" android:maxLines="1"
android:text="3" android:text="3"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintBottom_toTopOf="@+id/barrier2" app:layout_constraintBottom_toBottomOf="@id/tvSubject"
app:layout_constraintEnd_toStartOf="@+id/ivThread" app:layout_constraintEnd_toStartOf="@+id/ivThread"
app:layout_constraintTop_toBottomOf="@id/padding1" /> app:layout_constraintTop_toBottomOf="@id/padding1" />
@ -184,7 +182,7 @@
android:layout_height="15dp" android:layout_height="15dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:src="@drawable/baseline_message_24" android:src="@drawable/baseline_message_24"
app:layout_constraintBottom_toTopOf="@+id/barrier2" app:layout_constraintBottom_toBottomOf="@id/tvSubject"
app:layout_constraintEnd_toStartOf="@+id/ivFlagged" app:layout_constraintEnd_toStartOf="@+id/ivFlagged"
app:layout_constraintTop_toBottomOf="@id/padding1" /> app:layout_constraintTop_toBottomOf="@id/padding1" />
@ -197,17 +195,10 @@
android:paddingBottom="6dp" android:paddingBottom="6dp"
android:src="@drawable/baseline_star_24" android:src="@drawable/baseline_star_24"
android:visibility="visible" android:visibility="visible"
app:layout_constraintBottom_toTopOf="@+id/barrier2" app:layout_constraintBottom_toBottomOf="@id/tvSubject"
app:layout_constraintEnd_toEndOf="@id/paddingEnd" app:layout_constraintEnd_toEndOf="@id/paddingEnd"
app:layout_constraintTop_toBottomOf="@id/paddingTop" /> app:layout_constraintTop_toBottomOf="@id/paddingTop" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="ivAnswered,ivAttachments,tvSubject,tvFolder,tvCount,ivThread,ivFlagged" />
<TextView <TextView
android:id="@+id/tvPreview" android:id="@+id/tvPreview"
android:layout_width="0dp" android:layout_width="0dp"
@ -222,7 +213,7 @@
android:textStyle="italic" android:textStyle="italic"
app:layout_constraintEnd_toStartOf="@+id/paddingEnd" app:layout_constraintEnd_toStartOf="@+id/paddingEnd"
app:layout_constraintStart_toEndOf="@id/paddingStart" app:layout_constraintStart_toEndOf="@id/paddingStart"
app:layout_constraintTop_toBottomOf="@id/barrier2" /> app:layout_constraintTop_toBottomOf="@id/tvSubject" />
<TextView <TextView
android:id="@+id/tvError" android:id="@+id/tvError"

@ -52,7 +52,7 @@
android:layout_height="48dp" android:layout_height="48dp"
android:padding="6dp" android:padding="6dp"
android:src="@drawable/baseline_person_24" android:src="@drawable/baseline_person_24"
app:layout_constraintBottom_toTopOf="@+id/barrier3" app:layout_constraintBottom_toBottomOf="@+id/tvFolder"
app:layout_constraintDimensionRatio="1:1" app:layout_constraintDimensionRatio="1:1"
app:layout_constraintStart_toEndOf="@id/paddingStart" app:layout_constraintStart_toEndOf="@id/paddingStart"
app:layout_constraintTop_toBottomOf="@id/paddingTop" /> app:layout_constraintTop_toBottomOf="@id/paddingTop" />
@ -63,9 +63,10 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:gravity="center_vertical"
android:minHeight="24dp"
android:text="From" android:text="From"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintBottom_toTopOf="@+id/barrier1"
app:layout_constraintEnd_toStartOf="@+id/tvSize" app:layout_constraintEnd_toStartOf="@+id/tvSize"
app:layout_constraintStart_toEndOf="@id/ivAvatar" app:layout_constraintStart_toEndOf="@id/ivAvatar"
app:layout_constraintTop_toBottomOf="@id/paddingTop" /> app:layout_constraintTop_toBottomOf="@id/paddingTop" />
@ -75,11 +76,12 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:gravity="center_vertical"
android:maxLines="1" android:maxLines="1"
android:text="123 KB" android:text="123 KB"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorUnread" android:textColor="?attr/colorUnread"
app:layout_constraintBottom_toTopOf="@+id/barrier1" app:layout_constraintBottom_toBottomOf="@+id/tvFrom"
app:layout_constraintEnd_toStartOf="@+id/tvTime" app:layout_constraintEnd_toStartOf="@+id/tvTime"
app:layout_constraintTop_toBottomOf="@id/paddingTop" /> app:layout_constraintTop_toBottomOf="@id/paddingTop" />
@ -88,27 +90,21 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:gravity="center_vertical"
android:maxLines="1" android:maxLines="1"
android:text="Time" android:text="Time"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintBottom_toTopOf="@+id/barrier1" app:layout_constraintBottom_toBottomOf="@+id/tvFrom"
app:layout_constraintEnd_toStartOf="@+id/ivFlagged" app:layout_constraintEnd_toStartOf="@+id/ivFlagged"
app:layout_constraintTop_toBottomOf="@id/paddingTop" /> app:layout_constraintTop_toBottomOf="@id/paddingTop" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="tvFrom,tvSize,tvTime" />
<View <View
android:id="@+id/padding1" android:id="@+id/padding1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="6dp" android:layout_height="6dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/barrier1" /> app:layout_constraintTop_toBottomOf="@id/tvFrom" />
<TextView <TextView
android:id="@+id/tvSubject" android:id="@+id/tvSubject"
@ -116,9 +112,10 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:gravity="center_vertical"
android:minHeight="24dp"
android:text="Subject" android:text="Subject"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintBottom_toTopOf="@+id/barrier2"
app:layout_constraintEnd_toStartOf="@+id/ivFlagged" app:layout_constraintEnd_toStartOf="@+id/ivFlagged"
app:layout_constraintStart_toEndOf="@id/ivAvatar" app:layout_constraintStart_toEndOf="@id/ivAvatar"
app:layout_constraintTop_toBottomOf="@id/padding1" /> app:layout_constraintTop_toBottomOf="@id/padding1" />
@ -130,24 +127,17 @@
android:padding="6dp" android:padding="6dp"
android:src="@drawable/baseline_star_24" android:src="@drawable/baseline_star_24"
android:visibility="visible" android:visibility="visible"
app:layout_constraintBottom_toTopOf="@+id/barrier3" app:layout_constraintBottom_toBottomOf="@+id/tvFolder"
app:layout_constraintEnd_toEndOf="@id/paddingEnd" app:layout_constraintEnd_toEndOf="@id/paddingEnd"
app:layout_constraintTop_toBottomOf="@id/paddingTop" /> app:layout_constraintTop_toBottomOf="@id/paddingTop" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="tvSubject" />
<View <View
android:id="@+id/padding2" android:id="@+id/padding2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="6dp" android:layout_height="6dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/barrier2" /> app:layout_constraintTop_toBottomOf="@id/tvSubject" />
<ImageView <ImageView
android:id="@+id/ivAnswered" android:id="@+id/ivAnswered"
@ -155,7 +145,7 @@
android:layout_height="21dp" android:layout_height="21dp"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:src="@drawable/baseline_reply_24" android:src="@drawable/baseline_reply_24"
app:layout_constraintBottom_toTopOf="@+id/barrier3" app:layout_constraintBottom_toBottomOf="@+id/tvFolder"
app:layout_constraintStart_toEndOf="@id/ivAvatar" app:layout_constraintStart_toEndOf="@id/ivAvatar"
app:layout_constraintTop_toBottomOf="@id/padding2" /> app:layout_constraintTop_toBottomOf="@id/padding2" />
@ -165,7 +155,7 @@
android:layout_height="21dp" android:layout_height="21dp"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:src="@drawable/baseline_attachment_24" android:src="@drawable/baseline_attachment_24"
app:layout_constraintBottom_toTopOf="@+id/barrier3" app:layout_constraintBottom_toBottomOf="@+id/tvFolder"
app:layout_constraintStart_toEndOf="@id/ivAnswered" app:layout_constraintStart_toEndOf="@id/ivAnswered"
app:layout_constraintTop_toBottomOf="@id/padding2" /> app:layout_constraintTop_toBottomOf="@id/padding2" />
@ -175,10 +165,10 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:gravity="end" android:gravity="end|center_vertical"
android:minHeight="21dp"
android:text="folder" android:text="folder"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintBottom_toTopOf="@+id/barrier3"
app:layout_constraintEnd_toStartOf="@+id/tvCount" app:layout_constraintEnd_toStartOf="@+id/tvCount"
app:layout_constraintStart_toEndOf="@id/ivAttachments" app:layout_constraintStart_toEndOf="@id/ivAttachments"
app:layout_constraintTop_toBottomOf="@id/padding2" /> app:layout_constraintTop_toBottomOf="@id/padding2" />
@ -188,10 +178,11 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="3dp" android:layout_marginEnd="3dp"
android:gravity="center_vertical"
android:maxLines="1" android:maxLines="1"
android:text="3" android:text="3"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintBottom_toTopOf="@+id/barrier3" app:layout_constraintBottom_toBottomOf="@+id/tvFolder"
app:layout_constraintEnd_toStartOf="@+id/ivThread" app:layout_constraintEnd_toStartOf="@+id/ivThread"
app:layout_constraintTop_toBottomOf="@id/padding2" /> app:layout_constraintTop_toBottomOf="@id/padding2" />
@ -201,17 +192,10 @@
android:layout_height="15dp" android:layout_height="15dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:src="@drawable/baseline_message_24" android:src="@drawable/baseline_message_24"
app:layout_constraintBottom_toTopOf="@+id/barrier3" app:layout_constraintBottom_toBottomOf="@+id/tvFolder"
app:layout_constraintEnd_toStartOf="@+id/ivFlagged" app:layout_constraintEnd_toStartOf="@+id/ivFlagged"
app:layout_constraintTop_toBottomOf="@id/padding2" /> app:layout_constraintTop_toBottomOf="@id/padding2" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="ivAvatar,ivAnswered,ivAttachments,tvFolder,tvCount,ivThread,ivFlagged" />
<TextView <TextView
android:id="@+id/tvPreview" android:id="@+id/tvPreview"
android:layout_width="0dp" android:layout_width="0dp"
@ -227,7 +211,7 @@
android:textStyle="italic" android:textStyle="italic"
app:layout_constraintEnd_toStartOf="@+id/paddingEnd" app:layout_constraintEnd_toStartOf="@+id/paddingEnd"
app:layout_constraintStart_toEndOf="@id/paddingStart" app:layout_constraintStart_toEndOf="@id/paddingStart"
app:layout_constraintTop_toBottomOf="@id/barrier3" /> app:layout_constraintTop_toBottomOf="@id/tvFolder" />
<TextView <TextView
android:id="@+id/tvError" android:id="@+id/tvError"

Loading…
Cancel
Save