Skip to content

Instantly share code, notes, and snippets.

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

Arda Kazancı ardakazanci

:bowtie:
E=mc^2
View GitHub Profile
@ardakazanci
ardakazanci / stepper.kt
Created September 18, 2026 17:02
Stepper with jetpack compose
@Composable
fun SpringStepper(
value: Int,
onValueChange: (Int) -> Unit,
modifier: Modifier = Modifier,
valueRange: IntRange = Int.MIN_VALUE..Int.MAX_VALUE,
) {
require(!valueRange.isEmpty()) { "valueRange must not be empty" }
require(value in valueRange) { "value must be inside valueRange" }
@ardakazanci
ardakazanci / ComposeStylesDifficultyDemo.kt
Created September 16, 2026 18:20
Compose Styles Demo
@file:OptIn(androidx.compose.foundation.style.ExperimentalFoundationStyleApi::class)
package com.example.composestyles
import android.os.SystemClock
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.AnimationVector3D
import androidx.compose.animation.core.Easing
import androidx.compose.animation.core.TwoWayConverter
import androidx.compose.animation.core.spring
@ardakazanci
ardakazanci / FuzzyShader.md
Created September 5, 2026 09:39
Jetpack Compose Fuzzy a tactile heart shaped by fur, touch, and a little breeze.

Fuzzy Heart OpenGL ES 2.0 Shaders

This file is a standalone Markdown copy of the current shader code in FurRenderer.kt. The shaders target OpenGL ES 2.0 and use the ribbon fiber mesh generated by HeartGeometry.

1. Fur vertex shader

precision highp float;
attribute vec3 aRoot;
@ardakazanci
ardakazanci / AirPongCourtShader.agsl
Created August 4, 2026 15:12
Cinematic neon court shader for Android RuntimeShader, featuring parallax depth, animated portals, plasma lighting, scanlines, and chromatic aberration.
uniform float2 resolution;
uniform float time;
uniform float sideIndex;
uniform float ballY;
uniform float linked;
uniform float2 cameraOffset;
uniform float cameraZoom;
uniform float aberration;
uniform float ballLocalX;
uniform float depthIntensity;
@ardakazanci
ardakazanci / GummyCompose.kt
Created July 12, 2026 10:51
Jetpack Compose Gummy Effect
private data class GummyFlavor(
val name: String,
val color: Color,
)
private val gummyFlavors = listOf(
GummyFlavor("Raspberry", Color(0xFFFF315F)),
GummyFlavor("Tangerine", Color(0xFFFF8A24)),
GummyFlavor("Grape", Color(0xFF9B5CFF)),
)
@ardakazanci
ardakazanci / scoped.kt
Created June 8, 2026 16:33
Jetpack Compose Scoped ViewModel Example
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
ScopedViewModelTheme {
Scaffold(modifier = Modifier.fillMaxSize()) { contentPadding ->
ScopedViewModelDemo(
modifier = Modifier.padding(contentPadding)
)
@ardakazanci
ardakazanci / MeshGradient.kt
Created May 9, 2026 07:24
Mesh Gradient Jetpack Compose API
private const val Tau = 6.2831855f
private const val MeshRows = 3
private const val MeshColumns = 3
private val FieldBaseColor = Color(0xFFFF3E6B)
private val ControlPanelColor = Color(0x99350716)
private val ControlBorderColor = Color.White.copy(alpha = 0.3f)
private val RibbonPalette = listOf(
Color(0xFFFF1F5B),
Color(0xFFFF5F78),
@ardakazanci
ardakazanci / ContentView.swift
Created March 7, 2026 05:45 — forked from dkun7944/ContentView.swift
AirDrop iOS 17 Swift.Shader Animation
//
// ContentView.swift
// Airdrop Demo
//
// Created by Daniel Kuntz on 7/30/23.
//
import SwiftUI
struct ContentView: View {
@ardakazanci
ardakazanci / rippleglass.kt
Last active March 25, 2026 15:00
LiquidGlassAGSLShader
private const val LiquidGlassShaderSource = """
const float PI = 3.1415926;
const float FORCE = 0.08;
const float THICKNESS = 0.075;
const float FEATHERING = 0.1;
const float ABERRATION_OFFSET = 0.006;
const float FLASH_INTENSITY = 3.0;
const float REFRACTION_STRENGTH = 0.03;
@ardakazanci
ardakazanci / Parallax.kt
Created August 7, 2025 18:29
Jetpack Compose Parallax Concept
@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()