|
@@ -72,6 +72,7 @@ import eu.kanade.tachiyomi.ui.manga.ChapterItem
|
|
|
import eu.kanade.tachiyomi.ui.manga.MangaScreenState
|
|
|
import eu.kanade.tachiyomi.ui.manga.chapterDecimalFormat
|
|
|
import eu.kanade.tachiyomi.util.lang.toRelativeString
|
|
|
+import eu.kanade.tachiyomi.util.system.copyToClipboard
|
|
|
import tachiyomi.domain.chapter.model.Chapter
|
|
|
import tachiyomi.domain.manga.model.Manga
|
|
|
import java.text.DateFormat
|
|
@@ -91,7 +92,10 @@ fun MangaScreen(
|
|
|
onWebViewClicked: (() -> Unit)?,
|
|
|
onWebViewLongClicked: (() -> Unit)?,
|
|
|
onTrackingClicked: (() -> Unit)?,
|
|
|
- onTagClicked: (String) -> Unit,
|
|
|
+
|
|
|
+ // For tags menu
|
|
|
+ onTagSearch: (String) -> Unit,
|
|
|
+
|
|
|
onFilterButtonClicked: () -> Unit,
|
|
|
onRefresh: () -> Unit,
|
|
|
onContinueReading: () -> Unit,
|
|
@@ -117,6 +121,13 @@ fun MangaScreen(
|
|
|
onAllChapterSelected: (Boolean) -> Unit,
|
|
|
onInvertSelection: () -> Unit,
|
|
|
) {
|
|
|
+ val context = LocalContext.current
|
|
|
+ val onCopyTagToClipboard: (tag: String) -> Unit = {
|
|
|
+ if (it.isNotEmpty()) {
|
|
|
+ context.copyToClipboard(it, it)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (!isTabletUi) {
|
|
|
MangaScreenSmallImpl(
|
|
|
state = state,
|
|
@@ -130,7 +141,8 @@ fun MangaScreen(
|
|
|
onWebViewClicked = onWebViewClicked,
|
|
|
onWebViewLongClicked = onWebViewLongClicked,
|
|
|
onTrackingClicked = onTrackingClicked,
|
|
|
- onTagClicked = onTagClicked,
|
|
|
+ onTagSearch = onTagSearch,
|
|
|
+ onCopyTagToClipboard = onCopyTagToClipboard,
|
|
|
onFilterClicked = onFilterButtonClicked,
|
|
|
onRefresh = onRefresh,
|
|
|
onContinueReading = onContinueReading,
|
|
@@ -161,7 +173,8 @@ fun MangaScreen(
|
|
|
onWebViewClicked = onWebViewClicked,
|
|
|
onWebViewLongClicked = onWebViewLongClicked,
|
|
|
onTrackingClicked = onTrackingClicked,
|
|
|
- onTagClicked = onTagClicked,
|
|
|
+ onTagSearch = onTagSearch,
|
|
|
+ onCopyTagToClipboard = onCopyTagToClipboard,
|
|
|
onFilterButtonClicked = onFilterButtonClicked,
|
|
|
onRefresh = onRefresh,
|
|
|
onContinueReading = onContinueReading,
|
|
@@ -195,7 +208,11 @@ private fun MangaScreenSmallImpl(
|
|
|
onWebViewClicked: (() -> Unit)?,
|
|
|
onWebViewLongClicked: (() -> Unit)?,
|
|
|
onTrackingClicked: (() -> Unit)?,
|
|
|
- onTagClicked: (String) -> Unit,
|
|
|
+
|
|
|
+ // For tags menu
|
|
|
+ onTagSearch: (String) -> Unit,
|
|
|
+ onCopyTagToClipboard: (tag: String) -> Unit,
|
|
|
+
|
|
|
onFilterClicked: () -> Unit,
|
|
|
onRefresh: () -> Unit,
|
|
|
onContinueReading: () -> Unit,
|
|
@@ -363,7 +380,8 @@ private fun MangaScreenSmallImpl(
|
|
|
defaultExpandState = state.isFromSource,
|
|
|
description = state.manga.description,
|
|
|
tagsProvider = { state.manga.genre },
|
|
|
- onTagClicked = onTagClicked,
|
|
|
+ onTagSearch = onTagSearch,
|
|
|
+ onCopyTagToClipboard = onCopyTagToClipboard,
|
|
|
)
|
|
|
}
|
|
|
|
|
@@ -406,7 +424,11 @@ fun MangaScreenLargeImpl(
|
|
|
onWebViewClicked: (() -> Unit)?,
|
|
|
onWebViewLongClicked: (() -> Unit)?,
|
|
|
onTrackingClicked: (() -> Unit)?,
|
|
|
- onTagClicked: (String) -> Unit,
|
|
|
+
|
|
|
+ // For tags menu
|
|
|
+ onTagSearch: (String) -> Unit,
|
|
|
+ onCopyTagToClipboard: (tag: String) -> Unit,
|
|
|
+
|
|
|
onFilterButtonClicked: () -> Unit,
|
|
|
onRefresh: () -> Unit,
|
|
|
onContinueReading: () -> Unit,
|
|
@@ -555,7 +577,8 @@ fun MangaScreenLargeImpl(
|
|
|
defaultExpandState = true,
|
|
|
description = state.manga.description,
|
|
|
tagsProvider = { state.manga.genre },
|
|
|
- onTagClicked = onTagClicked,
|
|
|
+ onTagSearch = onTagSearch,
|
|
|
+ onCopyTagToClipboard = onCopyTagToClipboard,
|
|
|
)
|
|
|
}
|
|
|
},
|