forked from melod1n/fast-messenger
96b4fc8539
- Add minute/second abbreviations and kotlin.time-based relative time formatter - Introduce FastPreview and update previews to use AppTheme with dark/dynamic colors - Refactor attachments preview grid & waveform to use ImmutableList and reduce recompositions - Tweak message bubble reply styling and swipe-to-reply animation/haptics - Add Compose Stability Analyzer plugin and enable it in debug builds - Cache shared images by sha256 and improve share intent/chooser text - Minor UX polish (e.g., “No views”) and immutability annotations
39 lines
1.1 KiB
Kotlin
39 lines
1.1 KiB
Kotlin
package dev.meloda.fast.common
|
|
|
|
import android.app.Application
|
|
import androidx.preference.PreferenceManager
|
|
import coil.ImageLoader
|
|
import coil.ImageLoaderFactory
|
|
import com.skydoves.compose.stability.runtime.ComposeStabilityAnalyzer
|
|
import dev.meloda.fast.auth.BuildConfig
|
|
import dev.meloda.fast.common.di.applicationModule
|
|
import dev.meloda.fast.datastore.AppSettings
|
|
import org.koin.android.ext.android.get
|
|
import org.koin.android.ext.koin.androidContext
|
|
import org.koin.android.ext.koin.androidLogger
|
|
import org.koin.core.context.GlobalContext.startKoin
|
|
|
|
class AppGlobal : Application(), ImageLoaderFactory {
|
|
|
|
override fun onCreate() {
|
|
super.onCreate()
|
|
|
|
val preferences = PreferenceManager.getDefaultSharedPreferences(this)
|
|
AppSettings.init(preferences)
|
|
|
|
initKoin()
|
|
|
|
ComposeStabilityAnalyzer.setEnabled(BuildConfig.DEBUG)
|
|
}
|
|
|
|
private fun initKoin() {
|
|
startKoin {
|
|
androidLogger()
|
|
androidContext(this@AppGlobal)
|
|
modules(applicationModule)
|
|
}
|
|
}
|
|
|
|
override fun newImageLoader(): ImageLoader = get()
|
|
}
|