Files
Fogwave/app/src/main/java/cc/skysparkle/fogwave/FogwaveApp.kt
T
kalarina fa2fda44d1 Release 1.0.12
- Load preferences and all station logos off the main thread
- Keep equalizer updates and player animations from recomposing whole screens
- Build the Android Auto browse tree once and serve it from memory
- Create only the audio and metadata renderers, ship only the app's languages
- Store interface icons as lossless WebP, drop unused code and dependencies
2026-11-03 12:42:31 +02:00

31 lines
1.1 KiB
Kotlin

package cc.skysparkle.fogwave
import android.app.Application
import android.content.Context
import cc.skysparkle.fogwave.data.repository.RadioRepository
import cc.skysparkle.fogwave.player.AudioEffectsEngine
import coil.ImageLoader
import coil.ImageLoaderFactory
import coil.memory.MemoryCache
class FogwaveApp : Application(), ImageLoaderFactory {
override fun onCreate() {
super.onCreate()
// Opening the preference files starts loading them on a background thread right away, so the
// first screen and the playback service usually find them loaded instead of waiting on the disk.
getSharedPreferences(RadioRepository.PREFS_NAME, Context.MODE_PRIVATE)
getSharedPreferences(AudioEffectsEngine.PREFS_NAME, Context.MODE_PRIVATE)
}
override fun newImageLoader(): ImageLoader {
return ImageLoader.Builder(this)
.memoryCache {
MemoryCache.Builder(this)
.maxSizePercent(0.20)
.build()
}
.crossfade(true)
.build()
}
}