Add label to privately installed extensions (mihonapp/mihon#2349)

Just adds the same word as the install option ("Private" in English)
next to the extension version and 18+ label.

(cherry picked from commit 549d74a2c9aef0eb41ea18378cd29d4ab9eee2b4)
This commit is contained in:
MajorTanya 2025-08-05 21:07:21 +02:00 committed by Cuong-Tran
parent e6c760cbcb
commit 4679aaee23

View file

@ -379,10 +379,12 @@ private fun ExtensionItemContent(
horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.extraSmall),
) {
ProvideTextStyle(value = MaterialTheme.typography.bodySmall) {
var hasAlreadyShownAnElement by remember { mutableStateOf(false) }
// KMK -->
extension.lang?.let {
if (it.isNotEmpty()) {
// KMK <--
hasAlreadyShownAnElement = true
Text(
text = /* KMK --> */FlagEmoji.getEmojiLangFlag(it) + " " + /* KMK <-- */
LocaleHelper.getSourceDisplayName(it, LocalContext.current),
@ -391,6 +393,8 @@ private fun ExtensionItemContent(
}
if (extension.versionName.isNotEmpty()) {
if (hasAlreadyShownAnElement) DotSeparatorNoSpaceText()
hasAlreadyShownAnElement = true
Text(
text = extension.versionName,
)
@ -410,6 +414,8 @@ private fun ExtensionItemContent(
else -> null
}
if (warning != null) {
if (hasAlreadyShownAnElement) DotSeparatorNoSpaceText()
hasAlreadyShownAnElement = true
Text(
text = stringResource(warning).uppercase(),
color = MaterialTheme.colorScheme.error,
@ -417,6 +423,12 @@ private fun ExtensionItemContent(
overflow = TextOverflow.Ellipsis,
)
}
if (extension is Extension.Installed && !extension.isShared) {
if (hasAlreadyShownAnElement) DotSeparatorNoSpaceText()
Text(
text = stringResource(MR.strings.ext_installer_private),
)
}
if (!installStep.isCompleted()) {
DotSeparatorNoSpaceText()