Made download simple
Bug fixed
This commit is contained in:
14
app/src/main/java/xyz/quaver/pupil/util/file.kt
Normal file
14
app/src/main/java/xyz/quaver/pupil/util/file.kt
Normal file
@@ -0,0 +1,14 @@
|
||||
package xyz.quaver.pupil.util
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Environment
|
||||
import java.io.File
|
||||
|
||||
fun getCachedGallery(context: Context, galleryID: Int): File {
|
||||
return File(Environment.getExternalStorageDirectory(), "Pupil/$galleryID").let {
|
||||
when {
|
||||
it.exists() -> it
|
||||
else -> File(context.cacheDir, "imageCache/$galleryID")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user