This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Stable | |
interface CircularCarouselState { | |
val angle: Float | |
val minorAxisFactor: Float | |
suspend fun stop() | |
suspend fun snapTo(angle: Float) | |
suspend fun decayTo(angle: Float, velocity: Float) | |
fun setMinorAxisFactor(factor: Float) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : ComponentActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContent { | |
PlaygroundTheme { | |
Surface( | |
modifier = Modifier.fillMaxSize(), | |
color = MaterialTheme.colorScheme.background, | |
) { | |
Box { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Stable | |
interface AnimatedDrawerState { | |
var density: Float | |
val drawerWidth: Dp | |
val drawerTranslationX: Float | |
val drawerElevation: Float | |
val backgroundTranslationX: Float | |
val backgroundAlpha: Float |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun MorphingFab(modifier: Modifier = Modifier) { | |
val users = remember { mutableStateListOf<User>() } | |
// 1 | |
var showDialog by remember { mutableStateOf(false) } | |
// 2 | |
SharedTransitionLayout( | |
modifier = Modifier | |
.fillMaxSize(), | |
) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun MorphingFab(modifier: Modifier = Modifier) { | |
val users = remember { mutableStateListOf<User>() } | |
Box(modifier = modifier) { | |
UserList( | |
users = users, | |
modifier = Modifier.fillMaxSize(), | |
) | |
InputBox( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1 | |
@Composable | |
fun InputBox( | |
onAddUser: (User) -> Unit, | |
onCancel: () -> Unit, | |
modifier: Modifier = Modifier, | |
) { | |
// 2 | |
Card( | |
modifier = modifier, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class User( | |
val name: String, | |
val email: String, | |
) | |
@OptIn(ExperimentalSharedTransitionApi::class) | |
@Composable | |
fun MorphingFab(modifier: Modifier = Modifier) { | |
val users = remember { mutableStateListOf<User>() } | |
var showDialog by remember { mutableStateOf(false) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FloatingActionButton( | |
modifier = Modifier | |
.align(Alignment.BottomEnd) | |
.padding(all = 16.dp), | |
onClick = { | |
// TODO | |
} | |
) { | |
Icon( | |
imageVector = Icons.Default.Add, |
NewerOlder