diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/AttachmentPreviews.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/AttachmentPreviews.kt index 82d7eeb8..5b8a5e9d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/AttachmentPreviews.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/AttachmentPreviews.kt @@ -25,11 +25,15 @@ fun View.setupDocumentPreview( filename.text = title } - try { - val size = context.getFileSizeFromUri(uri) - file_size.beVisible() - file_size.text = size.formatSize() - } catch (e: Exception) { + if (attachment) { + try { + val size = context.getFileSizeFromUri(uri) + file_size.beVisible() + file_size.text = size.formatSize() + } catch (e: Exception) { + file_size.beGone() + } + } else { file_size.beGone() } diff --git a/app/src/main/res/layout/item_attachment_document.xml b/app/src/main/res/layout/item_attachment_document.xml index 603454b4..ba70eef4 100644 --- a/app/src/main/res/layout/item_attachment_document.xml +++ b/app/src/main/res/layout/item_attachment_document.xml @@ -29,6 +29,7 @@ @@ -48,6 +49,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="@dimen/normal_text_size" + android:visibility="gone" tools:text="2.18 KB" />