Reduce build warnings
This commit is contained in:
@@ -2,6 +2,7 @@ package exh.favorites
|
||||
|
||||
import android.content.Context
|
||||
import android.net.wifi.WifiManager
|
||||
import android.os.Build
|
||||
import android.os.PowerManager
|
||||
import eu.kanade.domain.manga.interactor.UpdateManga
|
||||
import eu.kanade.tachiyomi.network.POST
|
||||
@@ -136,10 +137,18 @@ class FavoritesSyncHelper(val context: Context) {
|
||||
}
|
||||
ignore { wifiLock?.release() }
|
||||
wifiLock = ignore {
|
||||
context.wifiManager.createWifiLock(
|
||||
WifiManager.WIFI_MODE_FULL_HIGH_PERF,
|
||||
"teh:ExhFavoritesSyncWifi",
|
||||
)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
context.wifiManager.createWifiLock(
|
||||
WifiManager.WIFI_MODE_FULL_LOW_LATENCY,
|
||||
"teh:ExhFavoritesSyncWifi",
|
||||
)
|
||||
} else {
|
||||
@Suppress("DEPRECATION")
|
||||
context.wifiManager.createWifiLock(
|
||||
WifiManager.WIFI_MODE_FULL_HIGH_PERF,
|
||||
"teh:ExhFavoritesSyncWifi",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Do not update galleries while syncing favorites
|
||||
|
||||
@@ -32,7 +32,6 @@ class MangaDexSimilarScreen(val mangaId: Long, val sourceId: Long) : Screen() {
|
||||
}
|
||||
|
||||
val screenModel = rememberScreenModel { MangaDexSimilarScreenModel(mangaId, sourceId) }
|
||||
val state by screenModel.state.collectAsState()
|
||||
val navigator = LocalNavigator.currentOrThrow
|
||||
|
||||
val onMangaClick: (Manga) -> Unit = {
|
||||
|
||||
@@ -31,7 +31,6 @@ class RecommendsScreen(val mangaId: Long, val sourceId: Long) : Screen() {
|
||||
}
|
||||
|
||||
val screenModel = rememberScreenModel { RecommendsScreenModel(mangaId, sourceId) }
|
||||
val state by screenModel.state.collectAsState()
|
||||
val navigator = LocalNavigator.currentOrThrow
|
||||
|
||||
val onMangaClick: (Manga) -> Unit = { manga ->
|
||||
|
||||
@@ -50,7 +50,7 @@ class MetadataViewScreen(private val mangaId: Long, private val sourceId: Long)
|
||||
)
|
||||
},
|
||||
) { paddingValues ->
|
||||
when (val state = state) {
|
||||
when (@Suppress("NAME_SHADOWING") val state = state) {
|
||||
MetadataViewState.Loading -> LoadingScreen()
|
||||
MetadataViewState.MetadataNotFound -> EmptyScreen(MR.strings.no_results_found)
|
||||
MetadataViewState.SourceNotFound -> EmptyScreen(MR.strings.source_empty_screen)
|
||||
|
||||
Reference in New Issue
Block a user