mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-16 14:07:28 +01:00
Add an "open in browser" button to reader menu (#1110)
* Add an "open in browser" button to reader menu Signed-off-by: Catting <5874051+mm12@users.noreply.github.com> * fixup! Add an "open in browser" button to reader menu Signed-off-by: Catting <5874051+mm12@users.noreply.github.com> --------- Signed-off-by: Catting <5874051+mm12@users.noreply.github.com>
This commit is contained in:
@@ -75,6 +75,7 @@ import eu.kanade.tachiyomi.ui.reader.viewer.ReaderProgressIndicator
|
||||
import eu.kanade.tachiyomi.ui.webview.WebViewActivity
|
||||
import eu.kanade.tachiyomi.util.system.hasDisplayCutout
|
||||
import eu.kanade.tachiyomi.util.system.isNightMode
|
||||
import eu.kanade.tachiyomi.util.system.openInBrowser
|
||||
import eu.kanade.tachiyomi.util.system.toShareIntent
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import eu.kanade.tachiyomi.util.view.setComposeContent
|
||||
@@ -389,6 +390,7 @@ class ReaderActivity : BaseActivity() {
|
||||
onClickTopAppBar = ::openMangaScreen,
|
||||
bookmarked = state.bookmarked,
|
||||
onToggleBookmarked = viewModel::toggleChapterBookmark,
|
||||
onOpenInBrowser = ::openChapterInBrowser.takeIf { isHttpSource },
|
||||
onOpenInWebView = ::openChapterInWebView.takeIf { isHttpSource },
|
||||
onShare = ::shareChapter.takeIf { isHttpSource },
|
||||
|
||||
@@ -563,6 +565,12 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user