Reorder reader menu overflow items
(cherry picked from commit 788235feeca241228eac0561339dd07b5ea0b77d) # Conflicts: # app/src/main/java/eu/kanade/presentation/reader/appbars/ReaderAppBars.kt # app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
This commit is contained in:
parent
62afbf8ff3
commit
95ae5211a7
@ -46,6 +46,7 @@ fun BottomReaderBar(
|
||||
doublePages: Boolean,
|
||||
onClickChapterList: () -> Unit,
|
||||
onClickWebView: (() -> Unit)?,
|
||||
onClickBrowser: (() -> Unit)?,
|
||||
onClickShare: (() -> Unit)?,
|
||||
onClickPageLayout: () -> Unit,
|
||||
onClickShiftPage: () -> Unit,
|
||||
@ -78,6 +79,15 @@ fun BottomReaderBar(
|
||||
}
|
||||
}
|
||||
|
||||
if (ReaderBottomButton.Browser.isIn(enabledButtons) && onClickBrowser != null) {
|
||||
IconButton(onClick = onClickBrowser) {
|
||||
Icon(
|
||||
imageVector = Icons.Outlined.Public,
|
||||
contentDescription = stringResource(MR.strings.action_open_in_browser),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (ReaderBottomButton.Share.isIn(enabledButtons) && onClickShare != null) {
|
||||
IconButton(onClick = onClickShare) {
|
||||
Icon(
|
||||
|
@ -74,6 +74,7 @@ fun ReaderAppBars(
|
||||
// bookmarked: Boolean,
|
||||
// onToggleBookmarked: () -> Unit,
|
||||
onOpenInWebView: (() -> Unit)?,
|
||||
onOpenInBrowser: (() -> Unit)?,
|
||||
onShare: (() -> Unit)?,
|
||||
|
||||
viewer: Viewer?,
|
||||
@ -308,6 +309,7 @@ fun ReaderAppBars(
|
||||
doublePages = doublePages,
|
||||
onClickChapterList = onClickChapterList,
|
||||
onClickWebView = onOpenInWebView,
|
||||
onClickBrowser = onOpenInBrowser,
|
||||
onClickShare = onShare,
|
||||
onClickPageLayout = onClickPageLayout,
|
||||
onClickShiftPage = onClickShiftPage,
|
||||
|
@ -467,6 +467,7 @@ class ReaderActivity : BaseActivity() {
|
||||
// bookmarked = state.bookmarked,
|
||||
// onToggleBookmarked = viewModel::toggleChapterBookmark,
|
||||
onOpenInWebView = ::openChapterInWebView.takeIf { isHttpSource },
|
||||
onOpenInBrowser = ::openChapterInBrowser.takeIf { isHttpSource },
|
||||
onShare = ::shareChapter.takeIf { isHttpSource },
|
||||
|
||||
viewer = state.viewer,
|
||||
@ -912,6 +913,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")
|
||||
|
@ -7,6 +7,7 @@ import tachiyomi.i18n.sy.SYMR
|
||||
enum class ReaderBottomButton(val value: String, val stringRes: StringResource) {
|
||||
ViewChapters("vc", MR.strings.action_view_chapters),
|
||||
WebView("wb", MR.strings.action_open_in_web_view),
|
||||
Browser("br", MR.strings.action_open_in_browser),
|
||||
Share("sh", MR.strings.action_share),
|
||||
ReadingMode("rm", MR.strings.viewer),
|
||||
Rotation("rot", MR.strings.rotation_type),
|
||||
|
Loading…
x
Reference in New Issue
Block a user