From 27ba25f28563ac92dab72b093b9c52a1ea34c022 Mon Sep 17 00:00:00 2001 From: Vrajendra Date: Tue, 26 Mar 2024 11:35:04 +0530 Subject: [PATCH] - Code optimization --- .../mediadirectory/LassiMediaPickerActivity.kt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lassi/src/main/java/com/lassi/presentation/mediadirectory/LassiMediaPickerActivity.kt b/lassi/src/main/java/com/lassi/presentation/mediadirectory/LassiMediaPickerActivity.kt index 2d97fb2..f099920 100644 --- a/lassi/src/main/java/com/lassi/presentation/mediadirectory/LassiMediaPickerActivity.kt +++ b/lassi/src/main/java/com/lassi/presentation/mediadirectory/LassiMediaPickerActivity.kt @@ -69,14 +69,13 @@ class LassiMediaPickerActivity : lifecycleScope.launch { val resultList: ArrayList = withContext(Dispatchers.IO) { uris.map { uri -> - val miMedia = MiMedia() - miMedia.name = getFileName(uri) - miMedia.doesUri = false - miMedia.fileSize = getFileSize(uri) - miMedia.path = - getFilePathFromUri(this@LassiMediaPickerActivity, uri, true) - Log.d("TAG", "!@# SLOWER MEDIA ITEM: ${miMedia.name}") - miMedia + MiMedia().apply { + name = getFileName(uri) + doesUri = false + fileSize = getFileSize(uri) + path = getFilePathFromUri(this@LassiMediaPickerActivity, uri, true) + Log.d("TAG", "!@# SLOWER MEDIA ITEM: $name") + } } as ArrayList }