Skip to content

Instantly share code, notes, and snippets.

Avatar
😷

Adrian AdrianoCelentano

😷
View GitHub Profile
View todo.kt
package com.example.androidvsios
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
View GameOfLife.kt
package com.adriano.gameoflife
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
@AdrianoCelentano
AdrianoCelentano / DashPathEffect.kt
Created Jan 7, 2021
TrimPath Animation with DashPathEffect
View DashPathEffect.kt
@Composable
fun NewDocAnimation() {
val borderLinesProgress = animatedFloat(0f)
onActive {
borderLinesProgress.animateTo(
targetValue = 1f,
anim = TweenSpec(
durationMillis = 300,
easing = LinearEasing
),
View HalfCircles.kt
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Path
View WaveClock.kt
@Composable
fun WaveClock() {
var radiusNoise = remember { Random.nextFloat() * 10 }
var xNoise = remember { Random.nextFloat() * 10 }
var yNoise = remember { Random.nextFloat() * 10 }
var angNoise = remember { Random.nextFloat() * 10 }
var strokeColor = 0f
var increaseColor = true
@AdrianoCelentano
AdrianoCelentano / Tornado.kt
Last active Oct 27, 2020
Jetpack Compose Tornado
View Tornado.kt
import androidx.annotation.FloatRange
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.*
import androidx.compose.ui.graphics.drawscope.DrawScope
@AdrianoCelentano
AdrianoCelentano / SinusWave.kt
Last active Oct 27, 2020
SinusWave with Jetpack Compose
View SinusWave.kt
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Path
import androidx.compose.ui.graphics.StrokeJoin
import androidx.compose.ui.graphics.drawscope.DrawScope
@AdrianoCelentano
AdrianoCelentano / CircularSlider.kt
Last active Jun 2, 2021
Circular Slider with Jetpack Compose
View CircularSlider.kt
import androidx.compose.foundation.Canvas
import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.gesture.DragObserver
import androidx.compose.ui.gesture.dragGestureFilter
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.drawscope.DrawScope
View SimpleSlider.kt
import androidx.compose.foundation.Canvas
import androidx.compose.material.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.Stable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Rect
import androidx.compose.ui.gesture.DragObserver
View ColorCheckChip.kt
import androidx.compose.animation.animate
import androidx.compose.animation.core.AnimationSpec
import androidx.compose.animation.core.TweenSpec
import androidx.compose.foundation.*
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.preferredSize
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Card
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Close