Skip to content

Instantly share code, notes, and snippets.

View bharath914's full-sized avatar
🚩

Bharath Prakash bharath914

🚩
View GitHub Profile
@bharath914
bharath914 / cardanimation.kt
Created April 13, 2024 04:31
Quick Card Animation in Jetpack Compose
val animatable = remember {
Animatable(0.5f)
}
LaunchedEffect(key1 = true) {
animatable.animateTo(1f, tween(350, easing = FastOutSlowInEasing))
// you can tweak out and customize these animations.
}
// add this animatable to your card's modifier graphics layer.
BookItem(modifier = cardMod.graphicsLayer {
this.scaleX = animatable.value
@bharath914
bharath914 / MainViewModel.kt
Last active April 17, 2024 06:39
Google Play In app Review
// invoking this in the viewmodel.
class MainViewModel @Inject constructor(
private val checkIfFirstLaunchTimeIsStored: CheckIfFirstLaunchTimeIsStored,
) : ViewModel() {
fun checkTheFirstLaunchTime(activity: Activity) {
viewModelScope.launch {
checkIfFirstLaunchTimeIsStored(activity)
}