Fix binary with KDB Database

This commit is contained in:
J-Jamet
2021-02-09 21:27:57 +01:00
parent 4e7c7ba8ce
commit 6f17c5dcac
3 changed files with 11 additions and 6 deletions

View File

@@ -354,10 +354,6 @@ class EntryEditActivity : LockingActivity(),
when (entryAttachmentState.downloadState) {
AttachmentState.START -> {
entryEditFragment?.apply {
// When only one attachment is allowed
if (!mAllowMultipleAttachments) {
clearAttachments()
}
putAttachment(entryAttachmentState)
// Scroll to the attachment position
getAttachmentViewPosition(entryAttachmentState) {
@@ -470,6 +466,11 @@ class EntryEditActivity : LockingActivity(),
private fun startUploadAttachment(attachmentToUploadUri: Uri?, attachment: Attachment?) {
if (attachmentToUploadUri != null && attachment != null) {
// When only one attachment is allowed
if (!mAllowMultipleAttachments) {
entryEditFragment?.clearAttachments()
}
// TODO if (!mAllowMultipleAttachments && !fileUploading)
// Start uploading in service
mAttachmentFileBinderManager?.startUploadAttachment(attachmentToUploadUri, attachment)
// Add in temp list

View File

@@ -120,7 +120,9 @@ abstract class AnimatedItemsAdapter<Item, T: RecyclerView.ViewHolder>(val contex
}
fun clear() {
itemsList.clear()
notifyDataSetChanged()
if (itemsList.size > 0) {
itemsList.clear()
notifyDataSetChanged()
}
}
}

View File

@@ -90,6 +90,8 @@ class EntryAttachmentsItemsAdapter(context: Context)
}
}
}
} else {
visibility = View.GONE
}
this.setOnClickListener {
ImageViewerActivity.getInstance(context, entryAttachmentState.attachment)