remove attachments at pressing X

This commit is contained in:
tibbi 2020-04-13 10:55:23 +02:00
parent 5fb6d81586
commit 2166a5bbe2
1 changed files with 7 additions and 0 deletions

View File

@ -330,6 +330,13 @@ class ThreadActivity : SimpleActivity() {
thread_attachments_holder.beVisible()
val attachmentView = layoutInflater.inflate(R.layout.item_attachment, null).apply {
thread_attachments_wrapper.addView(this)
thread_remove_attachment.setOnClickListener {
thread_attachments_wrapper.removeView(this)
attachmentUris.remove(uri)
if (attachmentUris.isEmpty()) {
thread_attachments_holder.beGone()
}
}
}
val roundedCornersRadius = resources.getDimension(R.dimen.medium_margin).toInt()