Mehdi Haghgoo
05/27/2021, 8:18 AMtaponidhi
05/27/2021, 9:05 AMZach Klippenstein (he/him) [MOD]
05/27/2021, 3:09 PMMehdi Haghgoo
05/27/2021, 7:47 PM// A surface container using the 'background' color from the theme
Surface(color = MaterialTheme.colors.background) {
var clicked by remember{mutableStateOf(false)}
val offset = animateDpAsState(targetValue = if (clicked) 30.dp else 0.dp)
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
modifier = Modifier.fillMaxSize()
){
Box(
Modifier
.clip(RoundedCornerShape(topStart = offset.value))
.clickable {
clicked = !clicked
}
.size(200.dp)
.background(Color.Yellow)
.border(1.dp, Color.Red)
) {
Text(buildAnnotatedString {
AnnotatedString("Hello Compose", spanStyle = SpanStyle(color = Color.Black, fontSize = 50.sp))
})
}
AnimatedVisibility(clicked) {
Box(Modifier.background(Color.Green)){
Text("Welcome to Jetpack Compose")
}
}
}
}
}
}
Zach Klippenstein (he/him) [MOD]
05/27/2021, 8:50 PMborder
modifier as well i think