Initial commit
This commit is contained in:
26
app/src/main/kotlin/it/vfsfitvnm/vimusic/MainApplication.kt
Normal file
26
app/src/main/kotlin/it/vfsfitvnm/vimusic/MainApplication.kt
Normal file
@@ -0,0 +1,26 @@
|
||||
package it.vfsfitvnm.vimusic
|
||||
|
||||
import android.app.Application
|
||||
import coil.ImageLoader
|
||||
import coil.ImageLoaderFactory
|
||||
import coil.disk.DiskCache
|
||||
|
||||
|
||||
class MainApplication : Application(), ImageLoaderFactory {
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
DatabaseInitializer()
|
||||
}
|
||||
|
||||
override fun newImageLoader(): ImageLoader {
|
||||
return ImageLoader.Builder(this)
|
||||
.crossfade(true)
|
||||
.diskCache(
|
||||
DiskCache.Builder()
|
||||
.directory(filesDir.resolve("coil"))
|
||||
.maxSizeBytes(1024 * 1024 * 1024)
|
||||
.build()
|
||||
)
|
||||
.build()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user