Reorder reader menu overflow items

This commit is contained in:
AntsyLich 2024-10-15 03:51:11 +06:00
parent afa5002988
commit 788235feec
No known key found for this signature in database
2 changed files with 16 additions and 16 deletions

View file

@ -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(

View file

@ -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")