Skip to content

Instantly share code, notes, and snippets.

View runo280's full-sized avatar
🤨

runo280 runo280

🤨
View GitHub Profile
@vishal2376
vishal2376 / SweepGradientImage.kt
Created May 25, 2024 15:25
Sweep Line effect with some rotation and scale animation
@Composable
fun SweepGradientImage(
imgResId: Int,
maxImgSize: Dp = 250.dp,
maxImgRotation: Float = -10f
) {
var animationPlayed by remember { mutableStateOf(false) }
val lineOffset by animateFloatAsState(
@vishal2376
vishal2376 / Place.kt
Last active July 31, 2024 10:01
Image Reflection with cool animation using Jetpack Compose
data class Place(
val name: String,
val resId: Int
)
@vishal2376
vishal2376 / CardSlideAnimation.kt
Created May 14, 2024 14:10
Beautiful Card Sliding Animation
package com.vishal2376.animations
import androidx.compose.animation.Crossfade
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.tween
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
@vishal2376
vishal2376 / FlipAnimation.kt
Created April 25, 2024 17:16
Card Flip Animation using Jetpack Compose
package com.vishal2376.animations.ui.theme
import androidx.compose.animation.animateColorAsState
import androidx.compose.animation.core.EaseInOut
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.tween
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
//settings.gradle.kts
dependencyResolutionManagement {
repositories {
maven { url = uri("https://androidx.dev/snapshots/builds/11670047/artifacts/repository/") }
google()
mavenCentral()
maven(url = "https://plugins.gradle.org/m2/")
maven(url = "https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
@Islomov49
Islomov49 / DecimalAmountTransformation.kt
Last active September 19, 2024 07:39
Decimal Amount Visual Transformation - Jetpack compose Visual Transformation for decimal input. Cursor works well! There might be room for optimization
package io.untec.utils.masks
import android.util.Log
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.TextRange
import androidx.compose.ui.text.input.OffsetMapping
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.text.input.TransformedText
import androidx.compose.ui.text.input.VisualTransformation
import java.math.BigDecimal
@bagus2x
bagus2x / TwitterDatePicker.kt
Created March 22, 2023 18:16
Jetpack compose twitter date picker (dob). Jetpack Compose scrollable date picker.
package bagus2x.sosmed.presentation.common.components
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.pager.VerticalPager
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.material.MaterialTheme
@fvilarino
fvilarino / ticker_final.kt
Last active February 9, 2024 16:04
Ticker Final
private val TickerCycleMillis = 150
private object AlphabetMapper {
private val Alphabet = " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789•".toList()
val size: Int = Alphabet.size
fun getLetterAt(index: Int): Char = Alphabet[index % size]
fun getIndexOf(letter: Char, offset: Int = 0): TickerIndex {
import androidx.compose.animation.core.EaseInOut
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.tween
import androidx.compose.desktop.ui.tooling.preview.Preview
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.hoverable
import androidx.compose.foundation.interaction.MutableInteractionSource
@tpoisson
tpoisson / DatePicker.kt
Last active April 11, 2024 09:05
DatePicker for Jetpack Compose and Material
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun DatePickerWithDialog(
value: LocalDate?,
dateFormatter: (LocalDate) -> String,
enabled: Boolean = true,
placeholder: @Composable (() -> Unit)? = null,
dateValidator: (Long) -> Boolean = { true },
onChange: (LocalDate?) -> Unit