This file contains hidden or 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
| /* | |
| * Copyright 2025 Kyriakos Georgiopoulos | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
This file contains hidden or 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 MainScreen() { | |
| Column( | |
| modifier = Modifier | |
| .fillMaxSize() | |
| .background(MaterialTheme.colorScheme.surface), | |
| verticalArrangement = Arrangement.Center, | |
| horizontalAlignment = Alignment.CenterHorizontally | |
| ) { | |
| AnimatedBorderCard( |
This file contains hidden or 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 BarDataM(val value: Float, val label: String) | |
| @Composable | |
| fun BarChartComponent( | |
| bars: List<BarDataM>, | |
| barWidth: Dp, | |
| spaceBetweenBars: Dp, | |
| animateChart: Boolean | |
| ) { | |
| var selectedBar by remember { mutableIntStateOf(-1) } |
This file contains hidden or 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 FlipActionScreen() { | |
| var flippedState by remember { mutableStateOf(false) } | |
| val rotationY by animateFloatAsState( | |
| targetValue = if (flippedState) 180f else 0f, | |
| animationSpec = spring( | |
| dampingRatio = Spring.DampingRatioHighBouncy, | |
| stiffness = Spring.StiffnessVeryLow | |
| ) | |
| ) |
This file contains hidden or 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
| package com.chootadev.composetryout | |
| import androidx.annotation.DrawableRes | |
| import androidx.compose.animation.core.animateFloatAsState | |
| import androidx.compose.animation.core.keyframes | |
| import androidx.compose.animation.core.tween | |
| import androidx.compose.foundation.Image | |
| import androidx.compose.foundation.background | |
| import androidx.compose.foundation.border | |
| import androidx.compose.foundation.clickable |
This file contains hidden or 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?) { | |
| WindowCompat.setDecorFitsSystemWindows(window, false) | |
| super.onCreate(savedInstanceState) | |
| setContent { | |
| P2RTheme { | |
| // A surface container using the 'background' color from the theme | |
| Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) { | |
| CompositionLocalProvider( | |
| LocalOverscrollConfiguration provides null // Disable overscroll otherwise it consumes the drag before we get the chance |
This file contains hidden or 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 MetaballEffect() { | |
| var targetAngle by remember { mutableStateOf(0f) } | |
| val animatedAngle by animateFloatAsState( | |
| targetValue = targetAngle, | |
| animationSpec = tween(durationMillis = 1000) | |
| ) | |
| var toggle by remember { mutableStateOf(false) } |
This file contains hidden or 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 InteractiveCanvas(maxWidth: Int, maxHeight: Int) { | |
| val random = remember { Random.Default } | |
| var touchPosition by remember { mutableStateOf(Offset.Unspecified) } | |
| val heartSize = 75F | |
| val heartPath = createHeartPath(heartSize) | |
| val heartOffsets = remember { mutableStateListOf<Offset>() } | |
| val heartColors = remember { mutableStateListOf<Color>() } | |
| if (heartOffsets.isEmpty()) { |
This file contains hidden or 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 DotParticle( | |
| var position: Offset, | |
| var velocity: Offset, | |
| val color: Color, | |
| var radius: Float = 5f | |
| ) { | |
| fun move() { | |
| position += velocity | |
| } | |
| } |
NewerOlder