- Remove unnecessary `GlobalScope`. - Rename `Component` to `Graph`, `DaggerComponentOwner` to `DependencyInjectionGraphOwner`. - Rename component builders to factories, where necessary.
32 lines
1.2 KiB
Kotlin
32 lines
1.2 KiB
Kotlin
/*
|
|
* Copyright 2022-2024 New Vector Ltd.
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
* Please see LICENSE files in the repository root for full details.
|
|
*/
|
|
|
|
package io.element.android.x
|
|
|
|
import android.app.Application
|
|
import androidx.startup.AppInitializer
|
|
import dev.zacsweers.metro.createGraphFactory
|
|
import io.element.android.features.cachecleaner.api.CacheCleanerInitializer
|
|
import io.element.android.libraries.di.DependencyInjectionGraphOwner
|
|
import io.element.android.x.di.AppGraph
|
|
import io.element.android.x.info.logApplicationInfo
|
|
import io.element.android.x.initializer.CrashInitializer
|
|
import io.element.android.x.initializer.PlatformInitializer
|
|
|
|
class ElementXApplication : Application(), DependencyInjectionGraphOwner {
|
|
override val graph: AppGraph = createGraphFactory<AppGraph.Factory>().create(this)
|
|
|
|
override fun onCreate() {
|
|
super.onCreate()
|
|
AppInitializer.getInstance(this).apply {
|
|
initializeComponent(CrashInitializer::class.java)
|
|
initializeComponent(PlatformInitializer::class.java)
|
|
initializeComponent(CacheCleanerInitializer::class.java)
|
|
}
|
|
logApplicationInfo(this)
|
|
}
|
|
}
|