mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
shading colors
This commit is contained in:
+12
-5
@@ -398,22 +398,29 @@ fun UserPicker(
|
||||
}
|
||||
}
|
||||
}
|
||||
val resultingColor = if (isInDarkTheme()) Color.Black.copy(0.64f) else DrawerDefaults.scrimColor
|
||||
val animatedColor = remember {
|
||||
Animatable(
|
||||
if (newChat.isVisible()) Color.Transparent else resultingColor,
|
||||
Color.VectorConverter(resultingColor.colorSpace)
|
||||
)
|
||||
}
|
||||
|
||||
AnimatedVisibility(
|
||||
visible = newChat.isVisible(),
|
||||
enter = if (appPlatform.isAndroid) {
|
||||
slideInVertically(
|
||||
initialOffsetY = { it },
|
||||
animationSpec = tween(durationMillis = 300)
|
||||
) + fadeIn(animationSpec = tween(durationMillis = 300))
|
||||
animationSpec = userPickerAnimSpec()
|
||||
) + fadeIn(animationSpec = userPickerAnimSpec())
|
||||
} else {
|
||||
fadeIn()
|
||||
},
|
||||
exit = if (appPlatform.isAndroid) {
|
||||
slideOutVertically(
|
||||
targetOffsetY = { it },
|
||||
animationSpec = tween(durationMillis = 300)
|
||||
) + fadeOut(animationSpec = tween(durationMillis = 300))
|
||||
animationSpec = userPickerAnimSpec()
|
||||
) + fadeOut(animationSpec = userPickerAnimSpec())
|
||||
} else {
|
||||
fadeOut()
|
||||
}
|
||||
@@ -421,7 +428,7 @@ fun UserPicker(
|
||||
Box(
|
||||
Modifier
|
||||
.fillMaxSize()
|
||||
.then(if (appPlatform.isAndroid && newChat.isVisible()) Modifier.background(color = MaterialTheme.colors.onSurface.copy(alpha = if (isInDarkTheme()) 0.16f else 0.32f)) else Modifier)
|
||||
.drawBehind { drawRect(animatedColor.value) }
|
||||
.clickable(interactionSource = remember { MutableInteractionSource() }, indication = null, onClick = { userPickerState.value = AnimatedViewState.HIDING }),
|
||||
contentAlignment = if (appPlatform.isAndroid) Alignment.BottomStart else Alignment.TopStart
|
||||
) {
|
||||
|
||||
+2
@@ -7,3 +7,5 @@ fun <T> chatListAnimationSpec() = tween<T>(durationMillis = 250, easing = FastOu
|
||||
fun <T> newChatSheetAnimSpec() = tween<T>(256, 0, LinearEasing)
|
||||
|
||||
fun <T> audioProgressBarAnimationSpec() = tween<T>(durationMillis = 30, easing = LinearEasing)
|
||||
|
||||
fun <T> userPickerAnimSpec() = tween<T>(256, 0, FastOutSlowInEasing)
|
||||
|
||||
Reference in New Issue
Block a user