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 FloatingHeartsAnimation() { | |
var showHearts by remember { mutableStateOf(false) } | |
val heartList = remember { mutableStateListOf<Int>() } | |
var sliderValue by remember { mutableFloatStateOf(0.5f) } | |
val scale = remember { Animatable(1f) } | |
val scope = rememberCoroutineScope() | |
val config = HeartConfig( | |
radiusMultiplier = lerp(0.5f, 2f, sliderValue), |
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 Stepper( | |
modifier: Modifier = Modifier, | |
initialValue: Int = 16, | |
onValueChange: (Int) -> Unit = {} | |
) { | |
var value by remember { mutableIntStateOf(initialValue) } | |
var dragOffset by remember { mutableFloatStateOf(0f) } | |
var isDragging by remember { mutableStateOf(false) } | |
val thresholdPx = with(LocalDensity.current) { |
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 CheckBoxSwitcherComponent() { | |
var isChecked by remember { mutableStateOf(false) } | |
var cornerRadius by remember { mutableStateOf(16f) } | |
var shadowElevation by remember { mutableStateOf(12f) } | |
var scaleFactor by remember { mutableStateOf(0.93f) } | |
var iconSize by remember { mutableStateOf(24f) } | |
val sliderColors = SliderDefaults.colors( | |
thumbColor = Color(0xFF4CAF50), |
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
#!/bin/bash | |
LOG_FILE="build_times.log" | |
START_TIME=$(date +%s) | |
echo "Starting Gradle Build..." | |
./gradlew assembleDebug | |
END_TIME=$(date +%s) | |
BUILD_TIME=$((END_TIME - START_TIME)) |
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
@SuppressLint("WrongConstant") | |
@Composable | |
fun FallingVerticalText(modifier: Modifier = Modifier) { | |
val text = "「春は、曙。」" | |
val textSize = 64.sp | |
val infiniteTransition = rememberInfiniteTransition() | |
val offsets = text.mapIndexed { index, _ -> | |
infiniteTransition.animateFloat( |
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 SegmentedArcProgressIndicator( | |
progress: Float, | |
strokeWidth: Float = 48f, | |
maxAngle: Float = 160f, | |
gapAngle: Float = 15f, | |
backgroundColor: Color = Color(0xffCBE0E8), | |
progressColor: Brush = Brush.linearGradient(listOf(Color(0xff83B2D1), Color(0xff106AA7))) | |
) { | |
val animatedProgress by animateFloatAsState( |
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
enum class CellType { | |
Space, Wall | |
} | |
data class MazeTile(val x: Int, val y: Int, var type: CellType = CellType.Wall) | |
@RequiresApi(Build.VERSION_CODES.VANILLA_ICE_CREAM) | |
class Maze(private val width: Int, private val height: Int) { | |
val maze: Array<Array<MazeTile>> = Array(height) { y -> | |
Array(width) { x -> MazeTile(x, y) } |
NewerOlder