From 441358f1ae3519262a5e73662962d7d66e3a709d Mon Sep 17 00:00:00 2001 From: nicki <72807749+curche@users.noreply.github.com> Date: Sat, 23 Oct 2021 23:53:39 +0530 Subject: [PATCH] Fix "+" appearing on `ConfigurableSources` in Browse > Extensions (#434) * align text towards right end aligns the text (`Settings/Settings+` etc) to the end of the Text rather than letting it be centred * append "+" only for two states "+" needs to be added only if the following conditions are met: - Extension is Installed and is a ConfigurableSource (regardless of it having an Update or not) - Extension is in InstallStep.Idle state * linting * Revert "align text towards right end" This reverts commit 5e4511d0beaff038e9dc31189095e1b6d853c020. Since it was rejected and doesn't help much * better if checking strategy because installStep.idle holds true for all extensions, even uninstalled ones, that leads to not having to check Ext.installed anyways for the combined OR to return `false` Checking for extension.Installed check first leads to getting `false` faster --- .../kanade/tachiyomi/ui/browse/extension/ExtensionHolder.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionHolder.kt index 4436c9379..1e1c8cb16 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionHolder.kt @@ -98,7 +98,10 @@ class ExtensionHolder(view: View, val adapter: ExtensionAdapter) : } ) // SY --> - if (extension is Extension.Installed && extension.sources.any { it is ConfigurableSource }) { + if (extension is Extension.Installed && + installStep == InstallStep.Idle && + extension.sources.any { it is ConfigurableSource } + ) { @SuppressLint("SetTextI18n") text = "$text+" }