Address some warnings

This commit is contained in:
Jobobby04 2023-12-24 12:01:28 -05:00
parent 209da5eb04
commit 14cfc38724
12 changed files with 29 additions and 24 deletions

View File

@ -2,6 +2,7 @@ package eu.kanade.presentation.browse.components
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ViewList
import androidx.compose.material.icons.automirrored.outlined.Help
import androidx.compose.material.icons.filled.ViewModule
import androidx.compose.material.icons.outlined.Help
import androidx.compose.material.icons.outlined.Public
@ -84,7 +85,7 @@ fun BrowseSourceToolbar(
add(
AppBar.Action(
title = stringResource(MR.strings.label_help),
icon = Icons.Outlined.Help,
icon = Icons.AutoMirrored.Outlined.Help,
onClick = onHelpClick,
),
)

View File

@ -12,8 +12,6 @@ import exh.md.network.MangaDexAuthInterceptor
import exh.md.utils.FollowStatus
import exh.md.utils.MdUtil
import kotlinx.collections.immutable.toImmutableList
import tachiyomi.core.util.lang.awaitSingle
import tachiyomi.core.util.lang.runAsObservable
import tachiyomi.core.util.lang.withIOContext
import tachiyomi.domain.manga.model.Manga
import tachiyomi.i18n.MR
@ -146,15 +144,12 @@ class MdList(id: Long) : BaseTracker(id, "MDList") {
override suspend fun search(query: String): List<TrackSearch> {
return withIOContext {
val mdex = mdex ?: throw MangaDexNotFoundException()
mdex.fetchSearchManga(1, query, FilterList())
.flatMap { page ->
runAsObservable {
page.mangas.map {
toTrackSearch(mdex.getMangaDetails(it))
}.distinct()
}
mdex.getSearchManga(1, query, FilterList())
.mangas
.map {
toTrackSearch(mdex.getMangaDetails(it))
}
.awaitSingle()
.distinct()
}
}

View File

@ -474,6 +474,7 @@ class EHentai(
this
}
@Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getLatestUpdates"))
override fun fetchLatestUpdates(page: Int): Observable<MangasPage> {
return super<HttpSource>.fetchLatestUpdates(page).checkValid()
}
@ -482,6 +483,7 @@ class EHentai(
return super<HttpSource>.getLatestUpdates(page).checkValid()
}
@Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getPopularManga"))
override fun fetchPopularManga(page: Int): Observable<MangasPage> {
return super<HttpSource>.fetchPopularManga(page).checkValid()
}
@ -491,6 +493,7 @@ class EHentai(
}
// Support direct URL importing
@Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getSearchManga"))
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> =
urlImportFetchSearchManga(context, query) {
super<HttpSource>.fetchSearchManga(page, query, filters).checkValid()

View File

@ -112,10 +112,10 @@ class MangaDex(delegate: HttpSource, val context: Context) :
MangaPlusHandler(network.client)
}
private val comikeyHandler by lazy {
ComikeyHandler(network.cloudflareClient, network.defaultUserAgentProvider())
ComikeyHandler(network.client, network.defaultUserAgentProvider())
}
private val bilibiliHandler by lazy {
BilibiliHandler(network.cloudflareClient)
BilibiliHandler(network.client)
}
private val azukHandler by lazy {
AzukiHandler(network.client, network.defaultUserAgentProvider())

View File

@ -51,8 +51,10 @@ class NHentai(delegate: HttpSource, val context: Context) :
}
// Support direct URL importing
@Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getSearchManga"))
override fun fetchSearchManga(page: Int, query: String, filters: FilterList) =
urlImportFetchSearchManga(context, query) {
@Suppress("DEPRECATION")
super<DelegatedHttpSource>.fetchSearchManga(page, query, filters)
}

View File

@ -33,6 +33,7 @@ class EightMuses(delegate: HttpSource, val context: Context) :
@Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getSearchManga"))
override fun fetchSearchManga(page: Int, query: String, filters: FilterList) =
urlImportFetchSearchManga(context, query) {
@Suppress("DEPRECATION")
super<DelegatedHttpSource>.fetchSearchManga(page, query, filters)
}

View File

@ -32,6 +32,7 @@ class HBrowse(delegate: HttpSource, val context: Context) :
@Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getSearchManga"))
override fun fetchSearchManga(page: Int, query: String, filters: FilterList) =
urlImportFetchSearchManga(context, query) {
@Suppress("DEPRECATION")
super<DelegatedHttpSource>.fetchSearchManga(page, query, filters)
}

View File

@ -50,6 +50,7 @@ class Pururin(delegate: HttpSource, val context: Context) :
}
return urlImportFetchSearchManga(context, newQuery) {
@Suppress("DEPRECATION")
super<DelegatedHttpSource>.fetchSearchManga(page, query, filters)
}
}

View File

@ -38,6 +38,7 @@ class Tsumino(delegate: HttpSource, val context: Context) :
@Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getSearchManga"))
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> =
urlImportFetchSearchManga(context, query) {
@Suppress("DEPRECATION")
super<DelegatedHttpSource>.fetchSearchManga(page, query, filters)
}

View File

@ -4,7 +4,7 @@ import android.view.LayoutInflater
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.ArrowForward
import androidx.compose.material.icons.automirrored.outlined.ArrowForward
import androidx.compose.material.icons.outlined.Deselect
import androidx.compose.material.icons.outlined.SelectAll
import androidx.compose.material3.Icon
@ -114,7 +114,7 @@ class PreMigrationScreen(val mangaIds: List<Long>) : Screen() {
text = { Text(text = stringResource(MR.strings.action_migrate)) },
icon = {
Icon(
imageVector = Icons.Outlined.ArrowForward,
imageVector = Icons.AutoMirrored.Outlined.ArrowForward,
contentDescription = stringResource(MR.strings.action_migrate),
)
},

View File

@ -106,8 +106,8 @@ class BatchAddScreen : Screen() {
val realProgress = progress / state.progressTotal
if (!realProgress.isNaN()) {
LinearProgressIndicator(
progress = realProgress,
Modifier
progress = { realProgress },
modifier = Modifier
.padding(top = 2.dp)
.weight(1f),
)

View File

@ -23,6 +23,7 @@ import eu.kanade.tachiyomi.source.online.UrlImportableSource
import eu.kanade.tachiyomi.ui.base.activity.BaseActivity
import eu.kanade.tachiyomi.ui.main.MainActivity
import eu.kanade.tachiyomi.ui.reader.ReaderActivity
import eu.kanade.tachiyomi.util.system.overridePendingTransitionCompat
import eu.kanade.tachiyomi.util.view.setComposeContent
import exh.GalleryAddEvent
import exh.GalleryAdder
@ -39,7 +40,6 @@ import tachiyomi.domain.manga.model.Manga
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.i18n.stringResource
class InterceptActivity : BaseActivity() {
private var statusJob: Job? = null
@ -47,7 +47,7 @@ class InterceptActivity : BaseActivity() {
private val status: MutableStateFlow<InterceptResult> = MutableStateFlow(InterceptResult.Idle)
override fun onCreate(savedInstanceState: Bundle?) {
overridePendingTransition(R.anim.shared_axis_x_push_enter, R.anim.shared_axis_x_push_exit)
overridePendingTransitionCompat(R.anim.shared_axis_x_push_enter, R.anim.shared_axis_x_push_exit)
super.onCreate(savedInstanceState)
setComposeContent {
@ -63,7 +63,7 @@ class InterceptActivity : BaseActivity() {
topBar = { scrollBehavior ->
AppBar(
title = stringResource(MR.strings.app_name),
navigateUp = ::onBackPressed,
navigateUp = ::finish,
scrollBehavior = scrollBehavior,
)
},
@ -109,7 +109,7 @@ class InterceptActivity : BaseActivity() {
.onEach {
when (it) {
is InterceptResult.Success -> {
onBackPressed()
finish()
startActivity(
if (it.chapter != null) {
ReaderActivity.newIntent(this, it.manga.id, it.chapter.id)
@ -126,8 +126,8 @@ class InterceptActivity : BaseActivity() {
.setTitle(MR.strings.chapter_error.getString(this))
.setMessage(stringResource(SYMR.strings.could_not_open_entry, it.reason))
.setPositiveButton(MR.strings.action_ok.getString(this), null)
.setOnCancelListener { onBackPressed() }
.setOnDismissListener { onBackPressed() }
.setOnCancelListener { finish() }
.setOnDismissListener { finish() }
.show()
}
else -> Unit
@ -143,7 +143,7 @@ class InterceptActivity : BaseActivity() {
override fun finish() {
super.finish()
overridePendingTransition(R.anim.shared_axis_x_pop_enter, R.anim.shared_axis_x_pop_exit)
overridePendingTransitionCompat(R.anim.shared_axis_x_pop_enter, R.anim.shared_axis_x_pop_exit)
}
private val galleryAdder = GalleryAdder()