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
#!/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 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 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 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) } |
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 MainScreen() { | |
var thoughtText by remember { mutableStateOf("Funny holiday movie for the family? 🍕❤️") } | |
var yOffset by remember { mutableFloatStateOf(0f) } | |
Column( | |
horizontalAlignment = Alignment.CenterHorizontally, | |
modifier = Modifier | |
) { | |
ThoughtBubbleOverlay( |
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
val colors = listOf( | |
Color(0xFFF3C623), | |
Color(0xFFF2AAAA), | |
Color(0xFFF37121), | |
Color(0xFFF2AAAA), | |
Color(0xFF8FC0A9), | |
Color(0xFF84A9AC), | |
Color(0xFFD54062), | |
Color(0xFF8FC0A9) | |
) |
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 Modifier.starBackgroundAnimated(): Modifier { | |
val image = ImageBitmap.imageResource(R.drawable.bg_image) | |
val transition = rememberInfiniteTransition(label = "") | |
val offset by transition.animateFloat( | |
initialValue = 0f, | |
targetValue = image.width.toFloat(), | |
animationSpec = infiniteRepeatable( | |
animation = tween(durationMillis = 10000, easing = LinearEasing), | |
repeatMode = RepeatMode.Reverse |
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
import androidx.compose.animation.core.tween | |
import androidx.compose.foundation.ExperimentalFoundationApi | |
import androidx.compose.foundation.gestures.AnchoredDraggableState | |
import androidx.compose.foundation.gestures.DraggableAnchors | |
import androidx.compose.foundation.gestures.Orientation | |
import androidx.compose.foundation.gestures.anchoredDraggable | |
import androidx.compose.foundation.gestures.animateTo | |
import androidx.compose.foundation.layout.Arrangement | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.Column |
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 AnimatedTextSwitcher() { | |
var isYellowBoxVisibility by remember { mutableStateOf(true) } | |
LaunchedEffect(Unit) { | |
while (true) { | |
delay(3000) | |
isYellowBoxVisibility = !isYellowBoxVisibility | |
} | |
} |
NewerOlder