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 Modifier.parallaxHeader( | |
listState: LazyListState, | |
headerHeightDp: Dp, | |
maxStretchFactor: Float = 3.0f, | |
pullMultiplier: Float = 1.5f, | |
onHeightChanged: (Dp) -> Unit | |
): Modifier { | |
val density = LocalDensity.current | |
val coroutineScope = rememberCoroutineScope() |
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 KeyboardWindowInsets(modifier: Modifier = Modifier) { | |
val coroutineScope = rememberCoroutineScope() | |
val verticalOffset = remember { Animatable(0f) } | |
var email by remember { mutableStateOf("") } | |
var sliderValue by remember { mutableFloatStateOf(1f) } | |
val isValidEmail = remember(email) { | |
Patterns.EMAIL_ADDRESS.matcher(email).matches() | |
} |
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 TabPosition(val left: Float, val right: Float) | |
@Composable | |
fun StretchTabComponent() { | |
val tabs = listOf("SALE", "RENT") | |
var selectedIndex by remember { mutableIntStateOf(0) } | |
val tabPositions = remember { mutableStateListOf<TabPosition>() } | |
val startX = remember { Animatable(0f) } | |
val endX = remember { Animatable(0f) } | |
val scope = rememberCoroutineScope() |
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
@Stable | |
data class Particle( | |
val id: Int, // stable key | |
val type: MutableState<RPS>, | |
val x: MutableState<Float>, | |
val y: MutableState<Float>, | |
val dx: MutableState<Float>, | |
val dy: MutableState<Float> | |
) |
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)) |
NewerOlder