* Create main.yml * Run ktlintFormat * Don't error on translation lint issues * Fix lint error about POST_NOTIFICATIONS permission * Increase memory limit to speedup the build * Only build debug * refactor: rename `main.yml` to `build.yaml` * lint: error on `ExtraTranslation` --------- Co-authored-by: Jarne Demeulemeester <jarnedemeulemeester@gmail.com>
30 lines
962 B
Kotlin
30 lines
962 B
Kotlin
package dev.jdtech.jellyfin
|
|
|
|
import android.app.Application
|
|
import androidx.appcompat.app.AppCompatDelegate
|
|
import com.google.android.material.color.DynamicColors
|
|
import dagger.hilt.android.HiltAndroidApp
|
|
import javax.inject.Inject
|
|
import timber.log.Timber
|
|
|
|
@HiltAndroidApp
|
|
class BaseApplication : Application() {
|
|
@Inject
|
|
lateinit var appPreferences: AppPreferences
|
|
|
|
override fun onCreate() {
|
|
super.onCreate()
|
|
|
|
if (BuildConfig.DEBUG) {
|
|
Timber.plant(Timber.DebugTree())
|
|
}
|
|
|
|
when (appPreferences.theme) {
|
|
"system" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
|
|
"light" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
|
|
"dark" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
|
|
}
|
|
|
|
if (appPreferences.dynamicColors) DynamicColors.applyToActivitiesIfAvailable(this)
|
|
}
|
|
}
|