mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Merged the two conditions into a single condition. (#5055)
This commit is contained in:
parent
db30f07f64
commit
eade6ca3a9
1 changed files with 17 additions and 20 deletions
|
|
@ -89,28 +89,25 @@ class ImageFileLoader(val context: Context) : CoroutineScope{
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (file != null && file.exists() && name != null && path != null && bucketName != null) {
|
||||||
|
val uri = ContentUris.withAppendedId(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, id)
|
||||||
|
|
||||||
if (file != null && file.exists()) {
|
val calendar = Calendar.getInstance()
|
||||||
if (name != null && path != null && bucketName != null) {
|
calendar.timeInMillis = date * 1000L
|
||||||
val uri = ContentUris.withAppendedId(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, id)
|
val date: Date = calendar.time
|
||||||
|
val dateFormat = DateFormat.getMediumDateFormat(context)
|
||||||
|
val formattedDate = dateFormat.format(date)
|
||||||
|
|
||||||
val calendar = Calendar.getInstance()
|
val image = Image(
|
||||||
calendar.timeInMillis = date * 1000L
|
id,
|
||||||
val date: Date = calendar.time
|
name,
|
||||||
val dateFormat = DateFormat.getMediumDateFormat(context)
|
uri,
|
||||||
val formattedDate = dateFormat.format(date)
|
path,
|
||||||
|
bucketId,
|
||||||
val image = Image(
|
bucketName,
|
||||||
id,
|
date = (formattedDate)
|
||||||
name,
|
)
|
||||||
uri,
|
images.add(image)
|
||||||
path,
|
|
||||||
bucketId,
|
|
||||||
bucketName,
|
|
||||||
date = (formattedDate)
|
|
||||||
)
|
|
||||||
images.add(image)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} while (cursor.moveToNext())
|
} while (cursor.moveToNext())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue