Skip to content

Commit

Permalink
Reorder reader menu overflow items
Browse files Browse the repository at this point in the history
  • Loading branch information
AntsyLich committed Oct 14, 2024
1 parent afa5002 commit 788235f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ fun ReaderAppBars(
onClickTopAppBar: () -> Unit,
bookmarked: Boolean,
onToggleBookmarked: () -> Unit,
onOpenInBrowser: (() -> Unit)?,
onOpenInWebView: (() -> Unit)?,
onOpenInBrowser: (() -> Unit)?,
onShare: (() -> Unit)?,

viewer: Viewer?,
Expand Down Expand Up @@ -120,18 +120,18 @@ fun ReaderAppBars(
onClick = onToggleBookmarked,
),
)
onOpenInBrowser?.let {
onOpenInWebView?.let {
add(
AppBar.OverflowAction(
title = stringResource(MR.strings.action_open_in_browser),
title = stringResource(MR.strings.action_open_in_web_view),
onClick = it,
),
)
}
onOpenInWebView?.let {
onOpenInBrowser?.let {
add(
AppBar.OverflowAction(
title = stringResource(MR.strings.action_open_in_web_view),
title = stringResource(MR.strings.action_open_in_browser),
onClick = it,
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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")
Expand Down

0 comments on commit 788235f

Please sign in to comment.