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
This commit is contained in:
nicki 2021-10-23 23:53:39 +05:30 committed by GitHub
parent 7097363f26
commit 441358f1ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,7 +98,10 @@ class ExtensionHolder(view: View, val adapter: ExtensionAdapter) :
} }
) )
// SY --> // 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") @SuppressLint("SetTextI18n")
text = "$text+" text = "$text+"
} }