From b0df7cbc68996d5a1efa7b815db9258cc60b791c Mon Sep 17 00:00:00 2001 From: FooIbar <118464521+FooIbar@users.noreply.github.com> Date: Sat, 4 Feb 2023 22:08:08 +0800 Subject: [PATCH] Revert "Resolve #756" This reverts commit 01d8dabef4d52fe0978dc9d16cc2c8e4d0e01bc5. --- .../java/com/hippo/ehviewer/client/EhUtils.kt | 16 ---------------- .../ehviewer/ui/scene/GalleryDetailScene.kt | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/app/src/main/java/com/hippo/ehviewer/client/EhUtils.kt b/app/src/main/java/com/hippo/ehviewer/client/EhUtils.kt index 879e703c9..2a079bb12 100644 --- a/app/src/main/java/com/hippo/ehviewer/client/EhUtils.kt +++ b/app/src/main/java/com/hippo/ehviewer/client/EhUtils.kt @@ -80,22 +80,6 @@ object EhUtils { return CATEGORY_VALUES.getOrDefault(type, CATEGORY_VALUES[UNKNOWN])!![0] } - fun getCategoryColorNullable(category: Int): Int? { - return when (category) { - EhConfig.DOUJINSHI -> BG_COLOR_DOUJINSHI - EhConfig.MANGA -> BG_COLOR_MANGA - EhConfig.ARTIST_CG -> BG_COLOR_ARTIST_CG - EhConfig.GAME_CG -> BG_COLOR_GAME_CG - EhConfig.WESTERN -> BG_COLOR_WESTERN - EhConfig.NON_H -> BG_COLOR_NON_H - EhConfig.IMAGE_SET -> BG_COLOR_IMAGE_SET - EhConfig.COSPLAY -> BG_COLOR_COSPLAY - EhConfig.ASIAN_PORN -> BG_COLOR_ASIAN_PORN - EhConfig.MISC -> BG_COLOR_MISC - else -> null - }?.toInt() - } - fun getCategoryColor(category: Int): Int { return when (category) { EhConfig.DOUJINSHI -> BG_COLOR_DOUJINSHI diff --git a/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.kt b/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.kt index 2b0112c5b..37c2ee5a3 100755 --- a/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.kt +++ b/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.kt @@ -573,7 +573,7 @@ class GalleryDetailScene : CollapsingToolbarScene(), View.OnClickListener, Downl uploader.text = gd.uploader uploader.alpha = if (gd.disowned) .5f else 1f category.text = EhUtils.getCategory(gd.category) - EhUtils.getCategoryColorNullable(gd.category)?.let { category.setTextColor(it) } + category.setTextColor(EhUtils.getCategoryColor(gd.category)) } updateDownloadText() binding.content.header.run {