add a helper function for appending Locked to strings
This commit is contained in:
parent
dfb515e103
commit
5b5a6b083f
1 changed files with 8 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue