add a helper function for appending Locked to strings

This commit is contained in:
tibbi 2022-11-12 18:24:51 +01:00
parent dfb515e103
commit 5b5a6b083f

View file

@ -469,6 +469,14 @@ fun Context.getCustomizeColorsString(): String {
return getString(textId)
}
fun Context.addLockedLabelIfNeeded(stringId: Int): String {
return if (isOrWasThankYouInstalled()) {
getString(stringId)
} else {
"${getString(stringId)} (${getString(R.string.feature_locked)})"
}
}
fun Context.isPackageInstalled(pkgName: String): Boolean {
return try {
packageManager.getPackageInfo(pkgName, 0)