Skip to content

Instantly share code, notes, and snippets.

View hiberfake's full-sized avatar

Robert Benedikt hiberfake

View GitHub Profile
@vganin
vganin / ComposePathMorphing.kt
Last active March 16, 2023 15:34
Jetpack Compose path morphing animation
@Composable
fun animatePathAsState(path: String): State<List<PathNode>> {
return animatePathAsState(remember(path) { addPathNodes(path) })
}
@Composable
fun animatePathAsState(path: List<PathNode>): State<List<PathNode>> {
var from by remember { mutableStateOf(path) }
var to by remember { mutableStateOf(path) }
val fraction = remember { Animatable(0f) }
@takahirom
takahirom / EventBus.kt
Last active June 9, 2022 10:21
EventBus by Kotlin coroutine
import kotlinx.coroutines.experimental.channels.BroadcastChannel
import kotlinx.coroutines.experimental.channels.ConflatedBroadcastChannel
import kotlinx.coroutines.experimental.channels.ReceiveChannel
import kotlinx.coroutines.experimental.channels.filter
import kotlinx.coroutines.experimental.channels.map
import kotlinx.coroutines.experimental.launch
import javax.inject.Inject
import javax.inject.Singleton