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.Icons
import androidx.compose.material.icons.automirrored.filled.ViewList 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.filled.ViewModule
import androidx.compose.material.icons.outlined.Help import androidx.compose.material.icons.outlined.Help
import androidx.compose.material.icons.outlined.Public import androidx.compose.material.icons.outlined.Public
@ -84,7 +85,7 @@ fun BrowseSourceToolbar(
add( add(
AppBar.Action( AppBar.Action(
title = stringResource(MR.strings.label_help), title = stringResource(MR.strings.label_help),
icon = Icons.Outlined.Help, icon = Icons.AutoMirrored.Outlined.Help,
onClick = onHelpClick, onClick = onHelpClick,
), ),
) )

View File

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

View File

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

View File

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

View File

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

View File

@ -50,6 +50,7 @@ class Pururin(delegate: HttpSource, val context: Context) :
} }
return urlImportFetchSearchManga(context, newQuery) { return urlImportFetchSearchManga(context, newQuery) {
@Suppress("DEPRECATION")
super<DelegatedHttpSource>.fetchSearchManga(page, query, filters) 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")) @Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getSearchManga"))
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> = override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> =
urlImportFetchSearchManga(context, query) { urlImportFetchSearchManga(context, query) {
@Suppress("DEPRECATION")
super<DelegatedHttpSource>.fetchSearchManga(page, query, filters) 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.Box
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material.icons.Icons 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.Deselect
import androidx.compose.material.icons.outlined.SelectAll import androidx.compose.material.icons.outlined.SelectAll
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
@ -114,7 +114,7 @@ class PreMigrationScreen(val mangaIds: List<Long>) : Screen() {
text = { Text(text = stringResource(MR.strings.action_migrate)) }, text = { Text(text = stringResource(MR.strings.action_migrate)) },
icon = { icon = {
Icon( Icon(
imageVector = Icons.Outlined.ArrowForward, imageVector = Icons.AutoMirrored.Outlined.ArrowForward,
contentDescription = stringResource(MR.strings.action_migrate), contentDescription = stringResource(MR.strings.action_migrate),
) )
}, },

View File

@ -106,8 +106,8 @@ class BatchAddScreen : Screen() {
val realProgress = progress / state.progressTotal val realProgress = progress / state.progressTotal
if (!realProgress.isNaN()) { if (!realProgress.isNaN()) {
LinearProgressIndicator( LinearProgressIndicator(
progress = realProgress, progress = { realProgress },
Modifier modifier = Modifier
.padding(top = 2.dp) .padding(top = 2.dp)
.weight(1f), .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.base.activity.BaseActivity
import eu.kanade.tachiyomi.ui.main.MainActivity import eu.kanade.tachiyomi.ui.main.MainActivity
import eu.kanade.tachiyomi.ui.reader.ReaderActivity import eu.kanade.tachiyomi.ui.reader.ReaderActivity
import eu.kanade.tachiyomi.util.system.overridePendingTransitionCompat
import eu.kanade.tachiyomi.util.view.setComposeContent import eu.kanade.tachiyomi.util.view.setComposeContent
import exh.GalleryAddEvent import exh.GalleryAddEvent
import exh.GalleryAdder import exh.GalleryAdder
@ -39,7 +40,6 @@ import tachiyomi.domain.manga.model.Manga
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.i18n.stringResource
class InterceptActivity : BaseActivity() { class InterceptActivity : BaseActivity() {
private var statusJob: Job? = null private var statusJob: Job? = null
@ -47,7 +47,7 @@ class InterceptActivity : BaseActivity() {
private val status: MutableStateFlow<InterceptResult> = MutableStateFlow(InterceptResult.Idle) private val status: MutableStateFlow<InterceptResult> = MutableStateFlow(InterceptResult.Idle)
override fun onCreate(savedInstanceState: Bundle?) { 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) super.onCreate(savedInstanceState)
setComposeContent { setComposeContent {
@ -63,7 +63,7 @@ class InterceptActivity : BaseActivity() {
topBar = { scrollBehavior -> topBar = { scrollBehavior ->
AppBar( AppBar(
title = stringResource(MR.strings.app_name), title = stringResource(MR.strings.app_name),
navigateUp = ::onBackPressed, navigateUp = ::finish,
scrollBehavior = scrollBehavior, scrollBehavior = scrollBehavior,
) )
}, },
@ -109,7 +109,7 @@ class InterceptActivity : BaseActivity() {
.onEach { .onEach {
when (it) { when (it) {
is InterceptResult.Success -> { is InterceptResult.Success -> {
onBackPressed() finish()
startActivity( startActivity(
if (it.chapter != null) { if (it.chapter != null) {
ReaderActivity.newIntent(this, it.manga.id, it.chapter.id) ReaderActivity.newIntent(this, it.manga.id, it.chapter.id)
@ -126,8 +126,8 @@ class InterceptActivity : BaseActivity() {
.setTitle(MR.strings.chapter_error.getString(this)) .setTitle(MR.strings.chapter_error.getString(this))
.setMessage(stringResource(SYMR.strings.could_not_open_entry, it.reason)) .setMessage(stringResource(SYMR.strings.could_not_open_entry, it.reason))
.setPositiveButton(MR.strings.action_ok.getString(this), null) .setPositiveButton(MR.strings.action_ok.getString(this), null)
.setOnCancelListener { onBackPressed() } .setOnCancelListener { finish() }
.setOnDismissListener { onBackPressed() } .setOnDismissListener { finish() }
.show() .show()
} }
else -> Unit else -> Unit
@ -143,7 +143,7 @@ class InterceptActivity : BaseActivity() {
override fun finish() { override fun finish() {
super.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() private val galleryAdder = GalleryAdder()