feat(brand): primaryMessage constant + rotator holds flagship slogan 3x longer
This commit is contained in:
parent
7923835861
commit
6d74c6acec
|
|
@ -2,8 +2,12 @@ package app.closer.ui.brand
|
||||||
|
|
||||||
/** Public-facing privacy copy that is accurate for every app state and account generation. */
|
/** Public-facing privacy copy that is accurate for every app state and account generation. */
|
||||||
object CloserBrandCopy {
|
object CloserBrandCopy {
|
||||||
|
/** The flagship privacy promise — shown first and held longer than the others in the rotator. */
|
||||||
|
const val primaryMessage =
|
||||||
|
"Your private moments stay private. Your information is securely encrypted, never read, and never sold. Only you and your paired partner have the key."
|
||||||
|
|
||||||
val privacyMessages: List<String> = listOf(
|
val privacyMessages: List<String> = listOf(
|
||||||
"Your private moments stay private. Your information is securely encrypted, never read, and never sold. Only you and your paired partner have the key.",
|
primaryMessage,
|
||||||
"Your relationship is yours, not ours.",
|
"Your relationship is yours, not ours.",
|
||||||
"Answer honestly. Reveal intentionally.",
|
"Answer honestly. Reveal intentionally.",
|
||||||
"For conversations that belong to the two of you.",
|
"For conversations that belong to the two of you.",
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,10 @@ fun BrandMessageRotator(
|
||||||
messages: List<String> = CloserBrandCopy.privacyMessages,
|
messages: List<String> = CloserBrandCopy.privacyMessages,
|
||||||
color: Color = MaterialTheme.colorScheme.onSurfaceVariant,
|
color: Color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
style: TextStyle = MaterialTheme.typography.bodyMedium,
|
style: TextStyle = MaterialTheme.typography.bodyMedium,
|
||||||
intervalMillis: Long = 4_500L
|
intervalMillis: Long = 4_500L,
|
||||||
|
/** This message lingers [primaryHoldMultiplier]× longer than the rest (the flagship slogan). */
|
||||||
|
primaryMessage: String? = CloserBrandCopy.primaryMessage,
|
||||||
|
primaryHoldMultiplier: Int = 3
|
||||||
) {
|
) {
|
||||||
if (messages.isEmpty()) return
|
if (messages.isEmpty()) return
|
||||||
|
|
||||||
|
|
@ -47,10 +50,16 @@ fun BrandMessageRotator(
|
||||||
}
|
}
|
||||||
var index by remember(messages) { mutableIntStateOf(0) }
|
var index by remember(messages) { mutableIntStateOf(0) }
|
||||||
|
|
||||||
LaunchedEffect(messages, intervalMillis, reduceMotion) {
|
LaunchedEffect(messages, intervalMillis, reduceMotion, primaryMessage, primaryHoldMultiplier) {
|
||||||
if (!reduceMotion && messages.size > 1) {
|
if (!reduceMotion && messages.size > 1) {
|
||||||
while (true) {
|
while (true) {
|
||||||
delay(intervalMillis)
|
// Hold the flagship slogan on screen longer than the rest.
|
||||||
|
val hold = if (messages[index] == primaryMessage) {
|
||||||
|
intervalMillis * primaryHoldMultiplier
|
||||||
|
} else {
|
||||||
|
intervalMillis
|
||||||
|
}
|
||||||
|
delay(hold)
|
||||||
index = (index + 1) % messages.size
|
index = (index + 1) % messages.size
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue