<How can I maintain the size when offset modifier ...
# stackoverflow
r
How can I maintain the size when offset modifier is applied to a Box? My intention is to create an animation in which the black box moves horizontally. To do this, if I press the second button I increase the offset (x coordinate) and if I press the first button I return to the initial state. @Composable fun Screen() { val offsetX = remember { Animatable(0f) } val coroutineScope = rememberCoroutineScope() Column( Modifier .fillMaxSize() .padding(start = 16.dp, end = 16.dp, bottom = 16.dp), horizontalAlignment...