Skip to content

Instantly share code, notes, and snippets.

View osisupermoses's full-sized avatar
🥲
Mostly pushing to private repos.

Abiodun Osifowokan osisupermoses

🥲
Mostly pushing to private repos.
View GitHub Profile
@Kyriakos-Georgiopoulos
Kyriakos-Georgiopoulos / SpotlightOverlay.kt
Last active February 12, 2026 15:36
SpotlightOverlay
/*
* Copyright 2025 Kyriakos Georgiopoulos
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ardakazanci
ardakazanci / navigation3.kt
Created May 21, 2025 16:57
Navigation3 ViewModel Playground Gist with Jetpack Compose
@Serializable
sealed interface ScreenKey : NavKey {
@Serializable object List : ScreenKey
@Serializable data class Detail(val itemId: String) : ScreenKey
}
class DetailViewModel : ViewModel() {
var clickCount by mutableStateOf(0)
fun onClicked() { clickCount++ }
@Composable
fun MainScreen() {
Column(
modifier = Modifier
.fillMaxSize()
.background(MaterialTheme.colorScheme.surface),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
AnimatedBorderCard(
@ardakazanci
ardakazanci / Bar.kt
Created April 24, 2024 15:49
Bar with JetpackCompose
data class BarDataM(val value: Float, val label: String)
@Composable
fun BarChartComponent(
bars: List<BarDataM>,
barWidth: Dp,
spaceBetweenBars: Dp,
animateChart: Boolean
) {
var selectedBar by remember { mutableIntStateOf(-1) }
@ardakazanci
ardakazanci / FlipCard.kt
Created April 21, 2024 10:27
Flip Card with Jetpack Compose
@Composable
fun FlipActionScreen() {
var flippedState by remember { mutableStateOf(false) }
val rotationY by animateFloatAsState(
targetValue = if (flippedState) 180f else 0f,
animationSpec = spring(
dampingRatio = Spring.DampingRatioHighBouncy,
stiffness = Spring.StiffnessVeryLow
)
)
@ChathuraHettiarachchi
ChathuraHettiarachchi / MotionLayoutTry.kt
Last active April 22, 2025 16:58
This is a sample implementation of AirBnB search bar transition on Android usin Jetpack Compose MotionLayout, MotionScene with DSL. You need to replace the images on `destinations` to work this. FInd the video link https://twitter.com/i/status/1778640663086829622
package com.chootadev.composetryout
import androidx.annotation.DrawableRes
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.keyframes
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
@KlassenKonstantin
KlassenKonstantin / Pull2Refresh.kt
Created March 26, 2024 11:23
Fitbit style Pull 2 Refresh
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
WindowCompat.setDecorFitsSystemWindows(window, false)
super.onCreate(savedInstanceState)
setContent {
P2RTheme {
// A surface container using the 'background' color from the theme
Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) {
CompositionLocalProvider(
LocalOverscrollConfiguration provides null // Disable overscroll otherwise it consumes the drag before we get the chance
@ardakazanci
ardakazanci / MetaballEffect.kt
Created February 20, 2024 17:06
Jetpack Compose MetaBall Effect
@Composable
fun MetaballEffect() {
var targetAngle by remember { mutableStateOf(0f) }
val animatedAngle by animateFloatAsState(
targetValue = targetAngle,
animationSpec = tween(durationMillis = 1000)
)
var toggle by remember { mutableStateOf(false) }
@ardakazanci
ardakazanci / InteractiveTouchCanvas.kt
Created February 15, 2024 18:09
Interactive Canvas for jetpack compose
@Composable
fun InteractiveCanvas(maxWidth: Int, maxHeight: Int) {
val random = remember { Random.Default }
var touchPosition by remember { mutableStateOf(Offset.Unspecified) }
val heartSize = 75F
val heartPath = createHeartPath(heartSize)
val heartOffsets = remember { mutableStateListOf<Offset>() }
val heartColors = remember { mutableStateListOf<Color>() }
if (heartOffsets.isEmpty()) {
@ardakazanci
ardakazanci / SpringDrawingShape.kt
Created January 29, 2024 17:26
Spring Animation for Jetpack Compose
class DotParticle(
var position: Offset,
var velocity: Offset,
val color: Color,
var radius: Float = 5f
) {
fun move() {
position += velocity
}
}