ntfy-android/app/src/main/java/io/heckel/ntfy/app/Application.kt
2022-02-12 19:43:42 -05:00

22 lines
595 B
Kotlin

package io.heckel.ntfy.app
import android.app.Application
import android.content.Context
import io.heckel.ntfy.db.Database
import io.heckel.ntfy.db.Repository
import io.heckel.ntfy.util.Log
class Application : Application() {
private val database by lazy {
Log.init(this) // What a hack, but this is super early and used everywhere
Database.getInstance(this)
}
val repository by lazy {
val repository = Repository.getInstance(applicationContext)
if (repository.getRecordLogs()) {
Log.setRecord(true)
}
repository
}
}