From 287489d7d07881cdfcb0494c4c9d6163d63d2fce Mon Sep 17 00:00:00 2001 From: zbue <108109611+zbue@users.noreply.github.com> Date: Sun, 15 Jan 2023 06:00:04 +0800 Subject: [PATCH] Show chapter scanlator on reader transition (#8910) Closes #7131 --- .../ui/reader/viewer/ReaderTransitionView.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderTransitionView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderTransitionView.kt index 06bf08927..c7a49cc8e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderTransitionView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderTransitionView.kt @@ -63,11 +63,19 @@ class ReaderTransitionView @JvmOverloads constructor(context: Context, attrs: At binding.upperText.text = buildSpannedString { bold { append(context.getString(R.string.transition_previous)) } append("\n${prevChapter.name}") + if (!prevChapter.scanlator.isNullOrBlank()) { + append(DOT_SEPERATOR) + append("${prevChapter.scanlator}") + } if (isPrevDownloaded) addDLImageSpan() } binding.lowerText.text = buildSpannedString { bold { append(context.getString(R.string.transition_current)) } append("\n${transition.from.chapter.name}") + if (!transition.from.chapter.scanlator.isNullOrBlank()) { + append(DOT_SEPERATOR) + append("${transition.from.chapter.scanlator}") + } if (isCurrentDownloaded) addDLImageSpan() } } else { @@ -100,11 +108,19 @@ class ReaderTransitionView @JvmOverloads constructor(context: Context, attrs: At binding.upperText.text = buildSpannedString { bold { append(context.getString(R.string.transition_finished)) } append("\n${transition.from.chapter.name}") + if (!transition.from.chapter.scanlator.isNullOrBlank()) { + append(DOT_SEPERATOR) + append("${transition.from.chapter.scanlator}") + } if (isCurrentDownloaded) addDLImageSpan() } binding.lowerText.text = buildSpannedString { bold { append(context.getString(R.string.transition_next)) } append("\n${nextChapter.name}") + if (!nextChapter.scanlator.isNullOrBlank()) { + append(DOT_SEPERATOR) + append("${nextChapter.scanlator}") + } if (isNextDownloaded) addDLImageSpan() } } else { @@ -149,3 +165,5 @@ class ReaderTransitionView @JvmOverloads constructor(context: Context, attrs: At binding.warning.isVisible = true } } + +private const val DOT_SEPERATOR = " • "