DroidKaigi / conference-app-2021

The Official App for DroidKaigi 2021
https://droidkaigi.jp/
Apache License 2.0
641 stars 181 forks source link

Add animation preview of LandingScreen #319

Open takahirom opened 3 years ago

takahirom commented 3 years ago

Kind (Required)

myihsan commented 3 years ago

I am wondering if this feature available now🤔 I tried something like below according the document you provided.

@Preview(showBackground = true)
@Composable
fun PreviewLandingScreen() {
    ConferenceAppFeederTheme(false) {
        val (disappeared, onDisappear) = remember {
            mutableStateOf(false)
        }
        val transition = updateTransition(disappeared)
        val splashAlpha by transition.animateFloat { state ->
            if (state) 0f else 1f
        }

        LandingScreen(
            modifier = Modifier
                .toggleable(value = disappeared, onValueChange = onDisappear)
                .alpha(splashAlpha),
        ){}
    }
}

But the animation inspector button was disabled with a message–"No animations available for inspection".

This is my first time trying Jetpack Compose, and I may doing something wrong. So it is not necessary to teach me the right way if there is something wrong. I will learn from the PR closed this issue.

takahirom commented 3 years ago

I'll check it later