Update MainActivity.kt
This commit is contained in:
@@ -137,9 +137,9 @@ fun FileListerScreen(modifier: Modifier = Modifier) {
|
||||
}) { Text(text = "Render Latest") }
|
||||
}
|
||||
|
||||
picture?.let { it1 ->
|
||||
picture?.let { p ->
|
||||
Canvas(modifier = Modifier.fillMaxWidth().weight(1f).drawWithCache {
|
||||
onDrawWithContent{ drawIntoCanvas { it.nativeCanvas.drawPicture(picture!!) } }
|
||||
onDrawWithContent{ drawIntoCanvas { it.nativeCanvas.drawPicture(p) } }
|
||||
}) {}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ private fun listFilesFromDcim(): String {
|
||||
val d = File("/storage/emulated/0/DCIM/CA_IMAGES/")
|
||||
if (!d.exists() || !d.isDirectory) return "Directory not found or is not a directory: ${d.absolutePath}"
|
||||
return d.listFiles()?.let {
|
||||
it.ifEmpty { null }?.joinToString("\n") { it.name }
|
||||
it.ifEmpty { null }?.sortedBy { it.lastModified() }?.joinToString("\n") { it.name }
|
||||
?: "No files found in ${d.absolutePath}"
|
||||
} ?: "Failed to list files in ${d.absolutePath}. listFiles() returned null."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user