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 / 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()
@ardakazanci
ardakazanci / KeyboardInsets.kt
Created July 27, 2025 12:05
Keyboard Animation Insets with Jetpack Compose
@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()
}
@ardakazanci
ardakazanci / StretchTabComponent.kt
Created July 19, 2025 06:32
Stretch Tab Jetpack Compose
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()
@ardakazanci
ardakazanci / RockPaperScissors.kt
Created July 7, 2025 16:31
RockPaperScissors Jetpack Compose
@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>
)
@ardakazanci
ardakazanci / BottomNavigationNavigation3.kt
Created June 4, 2025 08:30
BottomNavigation with Jetpack Navigation3
@Serializable
sealed interface AppScreenKey : NavKey
@Serializable
sealed interface RootScreenKey : AppScreenKey {
@Serializable object Home : RootScreenKey
@Serializable object Profile : RootScreenKey
@Serializable object Settings : RootScreenKey
}