From 4107d3dba08e6e835308e7f93420bd8f421c9dc1 Mon Sep 17 00:00:00 2001 From: nonproto <2092019+nonproto@users.noreply.github.com> Date: Tue, 6 Feb 2024 14:10:53 -0500 Subject: [PATCH] fix separator for realz --- .../eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt | 3 ++- .../kanade/tachiyomi/ui/reader/chapter/ReaderChapterItem.kt | 3 ++- .../java/org/nekomanga/presentation/components/ChapterRow.kt | 5 +++-- .../presentation/screens/mangadetails/InformationBlock.kt | 5 +++-- .../src/main/kotlin/org/nekomanga/constants/Constants.kt | 2 ++ 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt index 42c51e9512..8aafd3a20c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt @@ -14,6 +14,7 @@ import eu.kanade.tachiyomi.ui.manga.MangaDetailsAdapter import eu.kanade.tachiyomi.util.chapter.ChapterUtil import eu.kanade.tachiyomi.util.system.dpToPx import org.nekomanga.R +import org.nekomanga.constants.Constants import org.nekomanga.databinding.ChaptersItemBinding class ChapterHolder( @@ -99,7 +100,7 @@ class ChapterHolder( showBookmark = false, hideStatus = isLocked, ) - binding.chapterScanlator.text = statuses.joinToString(" ? ") + binding.chapterScanlator.text = statuses.joinToString(Constants.SEPARATOR) val status = when { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/chapter/ReaderChapterItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/chapter/ReaderChapterItem.kt index d62fe2190f..8037816997 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/chapter/ReaderChapterItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/chapter/ReaderChapterItem.kt @@ -14,6 +14,7 @@ import eu.kanade.tachiyomi.util.chapter.ChapterUtil import java.text.DecimalFormat import java.text.DecimalFormatSymbols import org.nekomanga.R +import org.nekomanga.constants.Constants import org.nekomanga.databinding.ReaderChapterItemBinding import org.nekomanga.domain.details.MangaDetailsPreferences import uy.kohesive.injekt.injectLazy @@ -109,7 +110,7 @@ class ReaderChapterItem(val chapter: Chapter, val manga: Manga, val isCurrent: B binding.chapterTitle.typeface = typeface binding.chapterSubtitle.typeface = typeface binding.chapterLanguage.typeface = typeface - binding.chapterSubtitle.text = statuses.joinToString(" ? ") + binding.chapterSubtitle.text = statuses.joinToString(Constants.SEPARATOR) } override fun unbindView(item: ReaderChapterItem) { diff --git a/app/src/main/java/org/nekomanga/presentation/components/ChapterRow.kt b/app/src/main/java/org/nekomanga/presentation/components/ChapterRow.kt index 0556c63d44..69675dbb79 100644 --- a/app/src/main/java/org/nekomanga/presentation/components/ChapterRow.kt +++ b/app/src/main/java/org/nekomanga/presentation/components/ChapterRow.kt @@ -65,6 +65,7 @@ import kotlinx.collections.immutable.toImmutableList import kotlinx.collections.immutable.toPersistentList import kotlinx.coroutines.launch import org.nekomanga.R +import org.nekomanga.constants.Constants import org.nekomanga.core.util.launchDelayed import org.nekomanga.logging.TimberKt import org.nekomanga.presentation.components.dropdown.SimpleDropDownItem @@ -402,7 +403,7 @@ private fun ChapterInfo( } } Text( - text = statuses.joinToString(" ? "), + text = statuses.joinToString(Constants.SEPARATOR), style = MaterialTheme.typography.bodyMedium.copy( color = secondaryTextColor, @@ -413,7 +414,7 @@ private fun ChapterInfo( overflow = TextOverflow.Ellipsis, ) - statuses.joinToString(" ? ") + statuses.joinToString(Constants.SEPARATOR) } } Box( diff --git a/app/src/main/java/org/nekomanga/presentation/screens/mangadetails/InformationBlock.kt b/app/src/main/java/org/nekomanga/presentation/screens/mangadetails/InformationBlock.kt index 3eb901a83e..ee970554d7 100644 --- a/app/src/main/java/org/nekomanga/presentation/screens/mangadetails/InformationBlock.kt +++ b/app/src/main/java/org/nekomanga/presentation/screens/mangadetails/InformationBlock.kt @@ -40,6 +40,7 @@ import jp.wasabeef.gap.Gap import kotlin.math.roundToInt import kotlinx.collections.immutable.toPersistentList import org.nekomanga.R +import org.nekomanga.constants.Constants import org.nekomanga.domain.manga.Stats import org.nekomanga.presentation.components.NekoColors import org.nekomanga.presentation.components.NoRippleText @@ -96,7 +97,7 @@ fun InformationBlock( true -> authorProvider().trim() false -> { listOfNotNull(authorProvider().trim(), artistProvider().trim()) - .joinToString(" ? ") + .joinToString(Constants.SEPARATOR) } } @@ -110,7 +111,7 @@ fun InformationBlock( style = MaterialTheme.typography.bodyLarge, color = mediumAlpha, ) - val creators = creator.split(" ? ").map { it.trim() } + val creators = creator.split(Constants.SEPARATOR).map { it.trim() } SimpleDropdownMenu( expanded = creatorExpanded, onDismiss = { creatorExpanded = false }, diff --git a/constants/src/main/kotlin/org/nekomanga/constants/Constants.kt b/constants/src/main/kotlin/org/nekomanga/constants/Constants.kt index a8099b1dfe..92c8eee9db 100644 --- a/constants/src/main/kotlin/org/nekomanga/constants/Constants.kt +++ b/constants/src/main/kotlin/org/nekomanga/constants/Constants.kt @@ -2,4 +2,6 @@ package org.nekomanga.constants object Constants { const val USER_AGENT = "Mozilla/5.0 (Windows NT 6.3; WOW64)" + + const val SEPARATOR = " ยท " }