This commit is contained in:
spaced4ndy
2026-08-03 17:27:10 +04:00
parent e6efb83f13
commit 204ab43a2e
5 changed files with 13 additions and 17 deletions
@@ -11,7 +11,6 @@ import SimpleXChat
struct BadgesSupportSimplexView: View {
@EnvironmentObject var theme: AppTheme
@Environment(\.colorScheme) var colorScheme: ColorScheme
// set true when presented as a sheet root (from the chat-list banner) that path doesn't
// reserve nav-bar space like a NavigationLink push does, so the title lands too close to the top
var showsAsSheet: Bool = false
@@ -76,7 +75,6 @@ struct BadgesSupportSimplexView: View {
}
NavigationLink(isActive: $whyBuiltActive) {
WhySimpleX(onboarding: false, titleColor: theme.colors.primary, createProfileNavLinkActive: .constant(false))
.modifier(ThemedBackground())
} label: {
EmptyView()
}
@@ -20,6 +20,7 @@ import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.unit.dp
import dev.icerock.moko.resources.compose.painterResource
import dev.icerock.moko.resources.compose.stringResource
import chat.simplex.common.BuildConfigCommon
import chat.simplex.common.platform.*
import chat.simplex.common.ui.theme.*
@@ -72,7 +73,7 @@ fun SupportSimpleXBanner(onTap: () -> Unit, onDismiss: () -> Unit) {
) {
Column(verticalArrangement = Arrangement.spacedBy(4.dp)) {
Text(
generalGetString(MR.strings.badges_banner_title),
stringResource(MR.strings.badges_banner_title),
style = MaterialTheme.typography.body1,
fontWeight = FontWeight.SemiBold,
color = MaterialTheme.colors.primary,
@@ -80,7 +81,7 @@ fun SupportSimpleXBanner(onTap: () -> Unit, onDismiss: () -> Unit) {
overflow = TextOverflow.Ellipsis
)
Text(
generalGetString(MR.strings.badges_banner_subtitle),
stringResource(MR.strings.badges_banner_subtitle),
style = MaterialTheme.typography.body2,
color = MaterialTheme.colors.onBackground,
maxLines = 2,
@@ -92,7 +93,7 @@ fun SupportSimpleXBanner(onTap: () -> Unit, onDismiss: () -> Unit) {
// Same X pattern as OneHandUICard: circle-clipped clickable region with inner padding for hit area.
Icon(
painterResource(MR.images.ic_close),
contentDescription = generalGetString(MR.strings.icon_descr_close_button),
contentDescription = stringResource(MR.strings.icon_descr_close_button),
tint = if (isDark) MaterialTheme.colors.onBackground else MaterialTheme.colors.secondary,
modifier = Modifier
.align(Alignment.TopEnd)
@@ -114,8 +115,7 @@ fun SupportSimpleXBanner(onTap: () -> Unit, onDismiss: () -> Unit) {
heroWidth = heroWidth,
heroVisibleHeight = heroVisibleHeight,
cardHeight = cardHeight,
trailingPadding = heroTrailingPadding,
modifier = Modifier
trailingPadding = heroTrailingPadding
)
}) { measurables, constraints ->
val cardPlaceable = measurables[0].measure(constraints)
@@ -128,7 +128,7 @@ fun SupportSimpleXBanner(onTap: () -> Unit, onDismiss: () -> Unit) {
}
@Composable
private fun HeroThumbnail(heroWidth: Dp, heroVisibleHeight: Dp, cardHeight: Dp, trailingPadding: Dp, modifier: Modifier) {
private fun HeroThumbnail(heroWidth: Dp, heroVisibleHeight: Dp, cardHeight: Dp, trailingPadding: Dp) {
if (BuildConfigCommon.SIMPLEX_ASSETS) {
// draws at natural aspect, top-aligned in a shorter slot; ContentScale.Crop cuts the overflow at card bottom
Image(
@@ -136,7 +136,7 @@ private fun HeroThumbnail(heroWidth: Dp, heroVisibleHeight: Dp, cardHeight: Dp,
contentDescription = null,
contentScale = ContentScale.Crop,
alignment = Alignment.TopCenter,
modifier = modifier.padding(end = trailingPadding).size(width = heroWidth, height = heroVisibleHeight)
modifier = Modifier.padding(end = trailingPadding).size(width = heroWidth, height = heroVisibleHeight)
)
} else {
val badgeSize = 48.dp
@@ -144,7 +144,7 @@ private fun HeroThumbnail(heroWidth: Dp, heroVisibleHeight: Dp, cardHeight: Dp,
painterResource(MR.images.badge_supporter),
contentDescription = null,
contentScale = ContentScale.Fit,
modifier = modifier
modifier = Modifier
.padding(end = trailingPadding + 12.dp, top = (cardHeight - badgeSize) / 2, bottom = (cardHeight - badgeSize) / 2)
.size(badgeSize)
)
@@ -28,7 +28,6 @@ import androidx.compose.ui.unit.*
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.layout.layout
import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.unit.IntSize
import chat.simplex.common.AppLock
@@ -943,7 +943,7 @@ private val versionDescriptions: List<VersionDescription> = listOf(
features = listOf(
VersionFeature.FeatureView(
icon = null,
titleId = MR.strings.whats_new_supporter_badge_short,
titleId = MR.strings.v7_1_supporter_badge_title,
view = { SupporterBadgeWhatsNew() }
)
)
@@ -955,12 +955,12 @@ private fun SupporterBadgeWhatsNew() {
Row(horizontalArrangement = Arrangement.spacedBy(12.dp), verticalAlignment = Alignment.Top) {
Column(Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(6.dp)) {
Text(
stringResource(MR.strings.whats_new_supporter_badge_title),
stringResource(MR.strings.v7_1_supporter_badge_title),
style = MaterialTheme.typography.h3,
fontWeight = FontWeight.Bold
)
Text(
stringResource(MR.strings.whats_new_supporter_badge_body),
stringResource(MR.strings.v7_1_supporter_badge_body),
style = MaterialTheme.typography.body1,
maxLines = 10
)
@@ -3228,7 +3228,6 @@
<string name="badges_banner_subtitle">Get badge + files up to 5GB</string>
<string name="badges_banner_dismiss_message">You can support SimpleX later in Settings.</string>
<string name="supporter_perks">Supporter perks</string>
<string name="whats_new_supporter_badge_title">Supporter badge ❤️</string>
<string name="whats_new_supporter_badge_body">Help keep the network running — send files up to 2 GB.</string>
<string name="whats_new_supporter_badge_short">Supporter badge</string>
<string name="v7_1_supporter_badge_title">Supporter badge ❤️</string>
<string name="v7_1_supporter_badge_body">Help keep the network running — send files up to 2 GB.</string>
</resources>