From df5d167763ba1a563a56151d46fea5ae1524fbf9 Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Tue, 21 Jan 2025 08:34:00 +0100 Subject: [PATCH] Filter properly tags --- app/src/main/java/foundation/e/apps/data/enums/Source.kt | 9 ++++++--- .../apps/ui/applicationlist/ApplicationListRVAdapter.kt | 7 ++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/foundation/e/apps/data/enums/Source.kt b/app/src/main/java/foundation/e/apps/data/enums/Source.kt index bb10fcdbe..becfc2b34 100644 --- a/app/src/main/java/foundation/e/apps/data/enums/Source.kt +++ b/app/src/main/java/foundation/e/apps/data/enums/Source.kt @@ -24,9 +24,12 @@ enum class Source { PWA; override fun toString(): String { - return name.lowercase() - .split("_") - .joinToString(" ") { it.replaceFirstChar(Char::uppercase) } + return when (this) { + PLAY_STORE -> "" + else -> name.lowercase() + .split("_") + .joinToString(" ") { it.replaceFirstChar(Char::uppercase) } + } } companion object { diff --git a/app/src/main/java/foundation/e/apps/ui/applicationlist/ApplicationListRVAdapter.kt b/app/src/main/java/foundation/e/apps/ui/applicationlist/ApplicationListRVAdapter.kt index d8855538c..656591845 100644 --- a/app/src/main/java/foundation/e/apps/ui/applicationlist/ApplicationListRVAdapter.kt +++ b/app/src/main/java/foundation/e/apps/ui/applicationlist/ApplicationListRVAdapter.kt @@ -239,7 +239,12 @@ class ApplicationListRVAdapter( } private fun ApplicationListItemBinding.updateSourceTag(searchApp: Application) { - sourceTag.text = searchApp.source.toString() + sourceTag.visibility = View.INVISIBLE + val tag = searchApp.source.toString() + if (tag.isNotBlank()) { + sourceTag.text = tag + sourceTag.visibility = View.VISIBLE + } } private fun handleAppItemClick( -- GitLab