mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-24 02:39:55 +01:00
Add base and subclassed upgrade sheets.
This commit is contained in:
committed by
Greyson Parrelli
parent
7abe76f76a
commit
7cc425fa7b
@@ -46,7 +46,8 @@ import org.whispersystems.signalservice.internal.push.SubscriptionsConfiguration
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
class MessageBackupsFlowViewModel(
|
||||
initialTierSelection: MessageBackupTier?
|
||||
initialTierSelection: MessageBackupTier?,
|
||||
startScreen: MessageBackupsStage = if (SignalStore.backup.backupTier == null) MessageBackupsStage.EDUCATION else MessageBackupsStage.TYPE_SELECTION
|
||||
) : ViewModel() {
|
||||
|
||||
companion object {
|
||||
@@ -57,7 +58,7 @@ class MessageBackupsFlowViewModel(
|
||||
MessageBackupsFlowState(
|
||||
availableBackupTypes = emptyList(),
|
||||
selectedMessageBackupTier = initialTierSelection ?: SignalStore.backup.backupTier,
|
||||
startScreen = if (SignalStore.backup.backupTier == null) MessageBackupsStage.EDUCATION else MessageBackupsStage.TYPE_SELECTION
|
||||
startScreen = startScreen
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.Immutable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
@@ -226,7 +227,8 @@ fun MessageBackupsTypeBlock(
|
||||
isSelected: Boolean,
|
||||
onSelected: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
enabled: Boolean = true
|
||||
enabled: Boolean = true,
|
||||
iconColors: MessageBackupsTypeIconColors = MessageBackupsTypeIconColors.default()
|
||||
) {
|
||||
val borderColor = if (isSelected) {
|
||||
MaterialTheme.colorScheme.primary
|
||||
@@ -264,9 +266,9 @@ fun MessageBackupsTypeBlock(
|
||||
)
|
||||
|
||||
val featureIconTint = if (isSelected) {
|
||||
MaterialTheme.colorScheme.primary
|
||||
iconColors.iconColorSelected
|
||||
} else {
|
||||
MaterialTheme.colorScheme.onSurfaceVariant
|
||||
iconColors.iconColorNormal
|
||||
}
|
||||
|
||||
Column(
|
||||
@@ -362,3 +364,22 @@ fun testBackupTypes(): List<MessageBackupsType> {
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Feature row iconography coloring
|
||||
*/
|
||||
@Immutable
|
||||
data class MessageBackupsTypeIconColors(
|
||||
val iconColorNormal: Color,
|
||||
val iconColorSelected: Color
|
||||
) {
|
||||
companion object {
|
||||
@Composable
|
||||
fun default(): MessageBackupsTypeIconColors {
|
||||
return MessageBackupsTypeIconColors(
|
||||
iconColorNormal = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
iconColorSelected = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user