mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-26 15:59:48 +00:00
wip
This commit is contained in:
@@ -49,6 +49,11 @@ suspend fun loadBadgeProducts(productIds: List<String>): List<BadgeProduct> {
|
||||
// does not have to be inferred from the id
|
||||
val details = queryBadgeProducts(client, productIds, BillingClient.ProductType.INAPP) +
|
||||
queryBadgeProducts(client, productIds, BillingClient.ProductType.SUBS)
|
||||
if (details.size < productIds.size) {
|
||||
// Play drops ids it cannot resolve without saying why, so the package it was asked for and the
|
||||
// store country are logged with them - a debug build's applicationIdSuffix is a common cause
|
||||
Log.w(TAG, "loadBadgeProducts: Play returned ${details.size} of ${productIds.size} - package ${androidAppContext.packageName}, country ${androidPlayStoreCountry.value ?: "none"}")
|
||||
}
|
||||
badgeProductDetails = details.associateBy { it.productId }
|
||||
return details.mapNotNull { it.badgeProduct() }
|
||||
}
|
||||
|
||||
+2
-1
@@ -163,7 +163,8 @@ private fun PeriodCard(level: BadgeLevel, period: BadgePeriod, selectedPeriod: B
|
||||
val percent = savingsPercent(level, period)
|
||||
if (percent != null) {
|
||||
Text(
|
||||
stringResource(MR.strings.badges_savings).format(percent),
|
||||
// the percent sign is in the argument, not the resource: adjustFormatting rejects %%
|
||||
stringResource(MR.strings.badges_savings).format("$percent%"),
|
||||
style = MaterialTheme.typography.caption,
|
||||
color = if (isSelected) MaterialTheme.colors.primary else MaterialTheme.colors.secondary,
|
||||
textAlign = TextAlign.Center
|
||||
|
||||
@@ -3212,7 +3212,7 @@
|
||||
<string name="badges_pay_once">Pay %1$s</string>
|
||||
<string name="badges_price_loading">Loading…</string>
|
||||
<string name="badges_price_unavailable">Not available</string>
|
||||
<string name="badges_savings">Save %1$d%%</string>
|
||||
<string name="badges_savings">Save %1$s</string>
|
||||
<string name="badges_level_supporter_tagline">Optional profile badge\nand 2GB files</string>
|
||||
<string name="badges_level_legend_tagline">Optional profile badge\nand 5GB files</string>
|
||||
<string name="badges_period_one_month">1 month</string>
|
||||
|
||||
Reference in New Issue
Block a user