mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-15 04:50:08 +00:00
wip
This commit is contained in:
+1
-1
@@ -120,7 +120,7 @@ private fun PeriodCard(period: BadgePeriod, selectedPeriod: BadgePeriod, modifie
|
||||
@Composable
|
||||
private fun PayButton(level: BadgeLevel, selectedPeriod: BadgePeriod) {
|
||||
OnboardingActionButton(
|
||||
modifier = if (appPlatform.isAndroid) Modifier.padding(horizontal = DEFAULT_ONBOARDING_HORIZONTAL_PADDING).fillMaxWidth() else Modifier,
|
||||
modifier = if (appPlatform.isAndroid) Modifier.padding(horizontal = DEFAULT_ONBOARDING_HORIZONTAL_PADDING).fillMaxWidth() else Modifier.widthIn(min = 300.dp),
|
||||
labelId = if (selectedPeriod == BadgePeriod.Subscribe) level.payMonthlyLabel else level.payOnceLabel,
|
||||
onboarding = null,
|
||||
onclick = {
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ fun BadgesSupportSimplexView() {
|
||||
@Composable
|
||||
private fun ChooseLevelButton() {
|
||||
OnboardingActionButton(
|
||||
modifier = if (appPlatform.isAndroid) Modifier.padding(horizontal = DEFAULT_ONBOARDING_HORIZONTAL_PADDING).fillMaxWidth() else Modifier,
|
||||
modifier = if (appPlatform.isAndroid) Modifier.padding(horizontal = DEFAULT_ONBOARDING_HORIZONTAL_PADDING).fillMaxWidth() else Modifier.widthIn(min = 300.dp),
|
||||
labelId = MR.strings.badges_choose_your_level,
|
||||
onboarding = null,
|
||||
onclick = {
|
||||
|
||||
+1
-1
@@ -156,7 +156,7 @@ private fun LevelCard(level: BadgeLevel, selectedLevel: BadgeLevel, modifier: Mo
|
||||
@Composable
|
||||
private fun ContinueButton(selectedLevel: BadgeLevel) {
|
||||
OnboardingActionButton(
|
||||
modifier = if (appPlatform.isAndroid) Modifier.padding(horizontal = DEFAULT_ONBOARDING_HORIZONTAL_PADDING).fillMaxWidth() else Modifier,
|
||||
modifier = if (appPlatform.isAndroid) Modifier.padding(horizontal = DEFAULT_ONBOARDING_HORIZONTAL_PADDING).fillMaxWidth() else Modifier.widthIn(min = 300.dp),
|
||||
labelId = MR.strings.badges_continue,
|
||||
onboarding = null,
|
||||
onclick = {
|
||||
|
||||
+12
-5
@@ -14,6 +14,7 @@ import androidx.compose.ui.graphics.Brush
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.layout.onSizeChanged
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.IntSize
|
||||
import androidx.compose.ui.unit.dp
|
||||
@@ -31,15 +32,17 @@ import chat.simplex.res.MR
|
||||
@Composable
|
||||
fun SupportSimpleXBanner(onTap: () -> Unit, onDismiss: () -> Unit) {
|
||||
val cardCornerRadius = 16.dp
|
||||
val cardHeight = 72.dp
|
||||
// grows with system font but never shrinks below the default so small-font users see the same
|
||||
// banner as today; hero image stays fixed so its above-card overhang shrinks at very large fonts
|
||||
val cardHeight = (72.dp * fontSizeSqrtMultiplier).coerceAtLeast(72.dp)
|
||||
// matches OneHandUICard's segment icon leading so the text aligns with it in the list
|
||||
val cardLeadingPadding = 16.dp
|
||||
val cardTrailingPadding = 8.dp
|
||||
val heroWidth = 110.dp
|
||||
// shorter than the natural drawn height so ContentScale.Crop slices the phone body at card bottom
|
||||
val heroVisibleHeight = 108.dp
|
||||
// matches the OneHandUICard-style X: outer end pad 4 + circle click area 32 = 36 reserved on right
|
||||
val heroTrailingPadding = 36.dp
|
||||
// hero right edge sits at the dismiss X's icon left edge (X: outer 4pt + inner-pad 8 + half of 16pt icon)
|
||||
val heroTrailingPadding = 28.dp
|
||||
val textToHeroGap = 6.dp
|
||||
|
||||
val isDark = isInDarkTheme()
|
||||
@@ -64,12 +67,16 @@ fun SupportSimpleXBanner(onTap: () -> Unit, onDismiss: () -> Unit) {
|
||||
generalGetString(MR.strings.badges_banner_title),
|
||||
style = MaterialTheme.typography.body1,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
color = MaterialTheme.colors.primary
|
||||
color = MaterialTheme.colors.primary,
|
||||
maxLines = 2,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
Text(
|
||||
generalGetString(MR.strings.badges_banner_subtitle),
|
||||
style = MaterialTheme.typography.body2,
|
||||
color = MaterialTheme.colors.onBackground
|
||||
color = MaterialTheme.colors.onBackground,
|
||||
maxLines = 2,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
+9
-7
@@ -1037,13 +1037,15 @@ private fun BoxScope.ChatList(searchText: MutableState<TextFieldValue>, listStat
|
||||
} else {
|
||||
NavigationBarBackground(oneHandUI.value, true)
|
||||
}
|
||||
if (!oneHandUICardShown.value) {
|
||||
LaunchedEffect(chats.size) {
|
||||
if (chats.size >= 3) {
|
||||
appPrefs.oneHandUICardShown.set(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
// TEMP-DISABLED-FOR-BADGES-QA: auto-hide of ToggleChatListCard at 3+ chats blocks visual QA of
|
||||
// the SupportSimpleXBanner alongside it. Restore before merging.
|
||||
// if (!oneHandUICardShown.value) {
|
||||
// LaunchedEffect(chats.size) {
|
||||
// if (chats.size >= 3) {
|
||||
// appPrefs.oneHandUICardShown.set(true)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
LaunchedEffect(activeFilter.value) {
|
||||
searchText.value = TextFieldValue("")
|
||||
|
||||
+5
-3
@@ -46,9 +46,11 @@ fun HowItWorks(user: User?, onboardingStage: SharedPreference<OnboardingStage>?
|
||||
OnboardingActionButton(user, onboardingStage, onclick = { ModalManager.fullscreen.closeModal() })
|
||||
TextButtonBelowOnboardingButton("", null)
|
||||
}
|
||||
} else if (appPlatform.isAndroid) {
|
||||
// no button below → add nav-bar-inset spacer so text doesn't run under system gesture bar
|
||||
Spacer(Modifier.navigationBarsPadding())
|
||||
} else {
|
||||
// No button below — add breathing room at the bottom on both platforms.
|
||||
// Android also gets nav-bar inset so content doesn't run under the gesture bar.
|
||||
Spacer(Modifier.height(DEFAULT_PADDING))
|
||||
if (appPlatform.isAndroid) Spacer(Modifier.navigationBarsPadding())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user