feat(Media): Toggleable Comments (#521)

* Smooth theme transitions
This commit is contained in:
Sadwhy 2024-11-17 12:21:44 +06:00 committed by GitHub
parent 56e557738c
commit d1e2ca8b5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 85 additions and 40 deletions

View file

@ -105,6 +105,14 @@ class App : MultiDexApplication() {
LogcatLogger.install(AndroidLogcatLogger(LogPriority.VERBOSE))
}
if (PrefManager.getVal<Int>(PrefName.CommentsEnabled) == 0) {
if (BuildConfig.FLAVOR.contains("fdroid")) {
PrefManager.setVal(PrefName.CommentsEnabled, 2)
} else {
PrefManager.setVal(PrefName.CommentsEnabled, 1)
}
}
CoroutineScope(Dispatchers.IO).launch {
animeExtensionManager = Injekt.get()
animeExtensionManager.findAvailableExtensions()
@ -128,7 +136,9 @@ class App : MultiDexApplication() {
downloadAddonManager = Injekt.get()
torrentAddonManager.init()
downloadAddonManager.init()
CommentsAPI.fetchAuthToken(this@App)
if (PrefManager.getVal<Int>(PrefName.CommentsEnabled) == 1) {
CommentsAPI.fetchAuthToken(this@App)
}
val useAlarmManager = PrefManager.getVal<Boolean>(PrefName.UseAlarmManager)
val scheduler = TaskScheduler.create(this@App, useAlarmManager)