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, onClickTopAppBar: () -> Unit,
bookmarked: Boolean, bookmarked: Boolean,
onToggleBookmarked: () -> Unit, onToggleBookmarked: () -> Unit,
onOpenInBrowser: (() -> Unit)?,
onOpenInWebView: (() -> Unit)?, onOpenInWebView: (() -> Unit)?,
onOpenInBrowser: (() -> Unit)?,
onShare: (() -> Unit)?, onShare: (() -> Unit)?,
viewer: Viewer?, viewer: Viewer?,
@ -120,14 +120,6 @@ fun ReaderAppBars(
onClick = onToggleBookmarked, onClick = onToggleBookmarked,
), ),
) )
onOpenInBrowser?.let {
add(
AppBar.OverflowAction(
title = stringResource(MR.strings.action_open_in_browser),
onClick = it,
),
)
}
onOpenInWebView?.let { onOpenInWebView?.let {
add( add(
AppBar.OverflowAction( 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 { onShare?.let {
add( add(
AppBar.OverflowAction( AppBar.OverflowAction(

View file

@ -390,8 +390,8 @@ class ReaderActivity : BaseActivity() {
onClickTopAppBar = ::openMangaScreen, onClickTopAppBar = ::openMangaScreen,
bookmarked = state.bookmarked, bookmarked = state.bookmarked,
onToggleBookmarked = viewModel::toggleChapterBookmark, onToggleBookmarked = viewModel::toggleChapterBookmark,
onOpenInBrowser = ::openChapterInBrowser.takeIf { isHttpSource },
onOpenInWebView = ::openChapterInWebView.takeIf { isHttpSource }, onOpenInWebView = ::openChapterInWebView.takeIf { isHttpSource },
onOpenInBrowser = ::openChapterInBrowser.takeIf { isHttpSource },
onShare = ::shareChapter.takeIf { isHttpSource }, onShare = ::shareChapter.takeIf { isHttpSource },
viewer = state.viewer, viewer = state.viewer,
@ -565,12 +565,6 @@ class ReaderActivity : BaseActivity() {
} }
} }
private fun openChapterInBrowser() {
assistUrl?.let {
openInBrowser(it.toUri(), forceDefaultBrowser = false)
}
}
private fun openChapterInWebView() { private fun openChapterInWebView() {
val manga = viewModel.manga ?: return val manga = viewModel.manga ?: return
val source = viewModel.getSource() ?: 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() { private fun shareChapter() {
assistUrl?.let { assistUrl?.let {
val intent = it.toUri().toShareIntent(this, type = "text/plain") val intent = it.toUri().toShareIntent(this, type = "text/plain")