small changes (#4789)

This commit is contained in:
RISHAV GUPTA 2022-02-07 19:33:26 +05:30 committed by GitHub
parent 769b295647
commit 9c27f8510d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View file

@ -45,7 +45,7 @@ class CustomSelectorViewModel(var context: Context,var imageFileLoader: ImageFil
override fun onFailed(throwable: Throwable) {
result.postValue(Result(CallbackStatus.SUCCESS, arrayListOf()))
}
},scope)
})
}
/**

View file

@ -33,7 +33,7 @@ class ImageFileLoader(val context: Context) : CoroutineScope{
/**
* Load Device Images under coroutine.
*/
fun loadDeviceImages(listener: ImageLoaderListener, scope: CoroutineScope) {
fun loadDeviceImages(listener: ImageLoaderListener) {
launch(Dispatchers.Main) {
withContext(Dispatchers.IO) {
getImages(listener)
@ -82,7 +82,7 @@ class ImageFileLoader(val context: Context) : CoroutineScope{
if (file != null && file.exists()) {
if (id != null && name != null && path != null && bucketId != null && bucketName != null) {
if (name != null && path != null && bucketName != null) {
val uri = ContentUris.withAppendedId(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, id)
val image = Image(id, name, uri, path, bucketId, bucketName)
images.add(image)

View file

@ -75,7 +75,7 @@ class ImageFileLoaderTest {
*/
@Test
fun testLoadDeviceImages() {
imageFileLoader.loadDeviceImages(imageLoaderListener, coroutineScope)
imageFileLoader.loadDeviceImages(imageLoaderListener)
}
/**