Skip to content
Snippets Groups Projects
Commit 578b2aef authored by Alexander Lussier-Cullen's avatar Alexander Lussier-Cullen Committed by Sébastien Blin
Browse files

ConversationMediaGalleryAdapter: add generic file info

GitLab: #1653
Change-Id: I53754f4dc9ad0113db3fb1bc7339f31cec9eb0d8
parent 8d15c570
No related branches found
No related tags found
No related merge requests found
......@@ -216,6 +216,12 @@ class ConversationMediaGalleryAdapter(
player.seekTo(1)
}
private fun configureFile(viewHolder: ConversationMediaViewHolder, file: DataTransfer) {
val fileBinding = viewHolder.file ?: return
fileBinding.name.text = file.body
fileBinding.size.text = Formatter.formatFileSize(fileBinding.root.context, file.totalSize)
}
private fun configureForFileInfo(viewHolder: ConversationMediaViewHolder, file: DataTransfer, position: Int) {
Log.w(TAG, "configureForFileInfo $position")
val path = deviceRuntimeService.getConversationPath(file)
......@@ -224,11 +230,10 @@ class ConversationMediaGalleryAdapter(
file.isPicture -> configureImage(viewHolder.image!!, path, file.body!!)
file.isAudio -> configureAudio(viewHolder, path)
file.isVideo -> configureVideo(viewHolder, path)
else -> configureFile(viewHolder, file)
}
} else {
val fileBinding = viewHolder.file ?: return
fileBinding.name.text = file.body
fileBinding.size.text = Formatter.formatFileSize(fileBinding.root.context, file.totalSize)
configureFile(viewHolder, file)
Log.w(TAG, "configureForFileInfo not complete")
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment