fix: settings to show/hide progress-banner were not working
This commit is contained in:
parent
a8116577a0
commit
eb4d5fcbf0
1 changed files with 13 additions and 3 deletions
|
|
@ -50,6 +50,7 @@ import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
||||||
import com.google.firebase.analytics.ktx.analytics
|
import com.google.firebase.analytics.ktx.analytics
|
||||||
import com.google.firebase.ktx.Firebase
|
import com.google.firebase.ktx.Firebase
|
||||||
import eu.kanade.domain.base.BasePreferences
|
import eu.kanade.domain.base.BasePreferences
|
||||||
|
import eu.kanade.domain.sync.SyncPreferences
|
||||||
import eu.kanade.presentation.components.AppStateBanners
|
import eu.kanade.presentation.components.AppStateBanners
|
||||||
import eu.kanade.presentation.components.DownloadedOnlyBannerBackgroundColor
|
import eu.kanade.presentation.components.DownloadedOnlyBannerBackgroundColor
|
||||||
import eu.kanade.presentation.components.IncognitoModeBannerBackgroundColor
|
import eu.kanade.presentation.components.IncognitoModeBannerBackgroundColor
|
||||||
|
|
@ -109,6 +110,7 @@ import tachiyomi.core.common.preference.PreferenceStore
|
||||||
import tachiyomi.core.common.util.lang.launchIO
|
import tachiyomi.core.common.util.lang.launchIO
|
||||||
import tachiyomi.core.common.util.system.logcat
|
import tachiyomi.core.common.util.system.logcat
|
||||||
import tachiyomi.domain.UnsortedPreferences
|
import tachiyomi.domain.UnsortedPreferences
|
||||||
|
import tachiyomi.domain.backup.service.BackupPreferences
|
||||||
import tachiyomi.domain.library.service.LibraryPreferences
|
import tachiyomi.domain.library.service.LibraryPreferences
|
||||||
import tachiyomi.domain.release.interactor.GetApplicationRelease
|
import tachiyomi.domain.release.interactor.GetApplicationRelease
|
||||||
import tachiyomi.presentation.core.components.material.Scaffold
|
import tachiyomi.presentation.core.components.material.Scaffold
|
||||||
|
|
@ -129,6 +131,8 @@ class MainActivity : BaseActivity() {
|
||||||
// SY <--
|
// SY <--
|
||||||
|
|
||||||
// KMK -->
|
// KMK -->
|
||||||
|
private val backupPreferences: BackupPreferences by injectLazy()
|
||||||
|
private val syncPreferences: SyncPreferences by injectLazy()
|
||||||
private val backupRestoreStatus: BackupRestoreStatus by injectLazy()
|
private val backupRestoreStatus: BackupRestoreStatus by injectLazy()
|
||||||
private val syncStatus: SyncStatus by injectLazy()
|
private val syncStatus: SyncStatus by injectLazy()
|
||||||
private val libraryUpdateStatus: LibraryUpdateStatus by injectLazy()
|
private val libraryUpdateStatus: LibraryUpdateStatus by injectLazy()
|
||||||
|
|
@ -202,9 +206,15 @@ class MainActivity : BaseActivity() {
|
||||||
val downloadOnly by preferences.downloadedOnly().collectAsState()
|
val downloadOnly by preferences.downloadedOnly().collectAsState()
|
||||||
val indexing by downloadCache.isInitializing.collectAsState()
|
val indexing by downloadCache.isInitializing.collectAsState()
|
||||||
// KMK -->
|
// KMK -->
|
||||||
val restoring by backupRestoreStatus.isRunning.collectAsState()
|
val restoringState by backupRestoreStatus.isRunning.collectAsState()
|
||||||
val syncing by syncStatus.isRunning.collectAsState()
|
val syncingState by syncStatus.isRunning.collectAsState()
|
||||||
val updating by libraryUpdateStatus.isRunning.collectAsState()
|
val updatingState by libraryUpdateStatus.isRunning.collectAsState()
|
||||||
|
val restoringProgressBanner by backupPreferences.showRestoringProgressBanner().collectAsState()
|
||||||
|
val syncingProgressBanner by syncPreferences.showSyncingProgressBanner().collectAsState()
|
||||||
|
val updatingProgressBanner by libraryPreferences.showUpdatingProgressBanner().collectAsState()
|
||||||
|
val restoring = restoringState && restoringProgressBanner
|
||||||
|
val syncing = syncingState && syncingProgressBanner
|
||||||
|
val updating = updatingState && updatingProgressBanner
|
||||||
val restoringProgress by backupRestoreStatus.progress.collectAsState()
|
val restoringProgress by backupRestoreStatus.progress.collectAsState()
|
||||||
val syncingProgress by syncStatus.progress.collectAsState()
|
val syncingProgress by syncStatus.progress.collectAsState()
|
||||||
val updatingProgress by libraryUpdateStatus.progress.collectAsState()
|
val updatingProgress by libraryUpdateStatus.progress.collectAsState()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue