From 788235feeca241228eac0561339dd07b5ea0b77d Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Tue, 15 Oct 2024 03:51:11 +0600 Subject: [PATCH] Reorder reader menu overflow items --- .../reader/appbars/ReaderAppBars.kt | 18 +++++++++--------- .../tachiyomi/ui/reader/ReaderActivity.kt | 14 +++++++------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/reader/appbars/ReaderAppBars.kt b/app/src/main/java/eu/kanade/presentation/reader/appbars/ReaderAppBars.kt index 124f3a6c3..9370ee567 100644 --- a/app/src/main/java/eu/kanade/presentation/reader/appbars/ReaderAppBars.kt +++ b/app/src/main/java/eu/kanade/presentation/reader/appbars/ReaderAppBars.kt @@ -45,8 +45,8 @@ fun ReaderAppBars( onClickTopAppBar: () -> Unit, bookmarked: Boolean, onToggleBookmarked: () -> Unit, - onOpenInBrowser: (() -> Unit)?, onOpenInWebView: (() -> Unit)?, + onOpenInBrowser: (() -> Unit)?, onShare: (() -> Unit)?, viewer: Viewer?, @@ -120,14 +120,6 @@ fun ReaderAppBars( onClick = onToggleBookmarked, ), ) - onOpenInBrowser?.let { - add( - AppBar.OverflowAction( - title = stringResource(MR.strings.action_open_in_browser), - onClick = it, - ), - ) - } onOpenInWebView?.let { add( AppBar.OverflowAction( @@ -136,6 +128,14 @@ fun ReaderAppBars( ), ) } + onOpenInBrowser?.let { + add( + AppBar.OverflowAction( + title = stringResource(MR.strings.action_open_in_browser), + onClick = it, + ), + ) + } onShare?.let { add( AppBar.OverflowAction( diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index 7f0b3ab35..b9a89751c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -390,8 +390,8 @@ class ReaderActivity : BaseActivity() { onClickTopAppBar = ::openMangaScreen, bookmarked = state.bookmarked, onToggleBookmarked = viewModel::toggleChapterBookmark, - onOpenInBrowser = ::openChapterInBrowser.takeIf { isHttpSource }, onOpenInWebView = ::openChapterInWebView.takeIf { isHttpSource }, + onOpenInBrowser = ::openChapterInBrowser.takeIf { isHttpSource }, onShare = ::shareChapter.takeIf { isHttpSource }, viewer = state.viewer, @@ -565,12 +565,6 @@ class ReaderActivity : BaseActivity() { } } - private fun openChapterInBrowser() { - assistUrl?.let { - openInBrowser(it.toUri(), forceDefaultBrowser = false) - } - } - private fun openChapterInWebView() { val manga = viewModel.manga ?: return val source = viewModel.getSource() ?: return @@ -580,6 +574,12 @@ class ReaderActivity : BaseActivity() { } } + private fun openChapterInBrowser() { + assistUrl?.let { + openInBrowser(it.toUri(), forceDefaultBrowser = false) + } + } + private fun shareChapter() { assistUrl?.let { val intent = it.toUri().toShareIntent(this, type = "text/plain")