Skip to content

Instantly share code, notes, and snippets.

View ardakazanci's full-sized avatar
:bowtie:
E=mc^2

Arda K. ardakazanci

:bowtie:
E=mc^2
View GitHub Profile
@ardakazanci
ardakazanci / MeasureBuildTime.sh
Created February 10, 2025 15:38
Daily Measure Build Time
#!/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))
@ardakazanci
ardakazanci / VerticalText.kt
Last active March 7, 2025 06:48
Vertical Text Jetpack Compose
@SuppressLint("WrongConstant")
@Composable
fun FallingVerticalText(modifier: Modifier = Modifier) {
val text = "「春は、曙。」"
val textSize = 64.sp
val infiniteTransition = rememberInfiniteTransition()
val offsets = text.mapIndexed { index, _ ->
infiniteTransition.animateFloat(
@ardakazanci
ardakazanci / SegmentedProgress.kt
Created February 1, 2025 05:04
Segmented Progress with Jetpack Compose
@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(
@ardakazanci
ardakazanci / SliceMenu.kt
Created November 30, 2024 07:44
Slice Menu in Jetpack Compose
@Composable
fun SliceMenu(modifier: Modifier = Modifier, onSliceClick: (Int) -> Unit) {
val slices = 6
val colors = listOf(
Brush.linearGradient(listOf(Color(0xFFFF1744), Color(0xFFFFC400))),
Brush.linearGradient(listOf(Color(0xFF1A237E), Color(0xFF2962FF))),
Brush.linearGradient(listOf(Color(0xFF00C853), Color(0xFF64DD17))),
Brush.linearGradient(listOf(Color(0xFFFF6D00), Color(0xFFFFAB00))),
Brush.linearGradient(listOf(Color(0xFFD500F9), Color(0xFF6200EA))),
Brush.linearGradient(listOf(Color(0xFF00BFA5), Color(0xFF00E5FF)))
@ardakazanci
ardakazanci / Maze.kt
Created November 22, 2024 17:31
Maze Generator Jetpack Compose
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) }
@ardakazanci
ardakazanci / ThoughtBubbleOverlay.kt
Created July 30, 2024 17:07
Thought Bubble in Jetpack Compose
@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(
@ardakazanci
ardakazanci / TextTweern.kt
Created July 20, 2024 08:15
Text Tween Animation
val colors = listOf(
Color(0xFFF3C623),
Color(0xFFF2AAAA),
Color(0xFFF37121),
Color(0xFFF2AAAA),
Color(0xFF8FC0A9),
Color(0xFF84A9AC),
Color(0xFFD54062),
Color(0xFF8FC0A9)
)
@ardakazanci
ardakazanci / ShaderBrush.kt
Created July 14, 2024 06:56
Jetpack Compose in ShaderBrush
@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
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
@ardakazanci
ardakazanci / AnimatedTextSwitcher.kt
Created June 11, 2024 17:02
Animated Text in Jetpack Compose
@Composable
fun AnimatedTextSwitcher() {
var isYellowBoxVisibility by remember { mutableStateOf(true) }
LaunchedEffect(Unit) {
while (true) {
delay(3000)
isYellowBoxVisibility = !isYellowBoxVisibility
}
}