Don't fetch file size in thread list

This commit is contained in:
Naveen
2022-11-16 15:54:25 +05:30
parent 2d36794a17
commit c5034a64d5
2 changed files with 11 additions and 5 deletions

View File

@@ -25,11 +25,15 @@ fun View.setupDocumentPreview(
filename.text = title filename.text = title
} }
try { if (attachment) {
val size = context.getFileSizeFromUri(uri) try {
file_size.beVisible() val size = context.getFileSizeFromUri(uri)
file_size.text = size.formatSize() file_size.beVisible()
} catch (e: Exception) { file_size.text = size.formatSize()
} catch (e: Exception) {
file_size.beGone()
}
} else {
file_size.beGone() file_size.beGone()
} }

View File

@@ -29,6 +29,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="@dimen/medium_margin" android:layout_marginStart="@dimen/medium_margin"
android:orientation="vertical"> android:orientation="vertical">
@@ -48,6 +49,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/normal_text_size" android:textSize="@dimen/normal_text_size"
android:visibility="gone"
tools:text="2.18 KB" /> tools:text="2.18 KB" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>