What's the equivalent of Modifier.visible / if (visible) { } in Android Views?

In Classic Android, use:

android:visibility

Jetpack Compose

Modifier.visible / if (visible) { }

Classic Android

android:visibility

Dispatch Newsletter
Get the complete migration cheatsheet in your inbox
Curated Insights
Digest in 5 minutes or less
Android Analysis
Entertaining takes on happenings
Insider Tips
From top Android developers
Hidden Gems
You won't find elsewhere
"
"Dispatch has been my go-to resource lately to keep up with Compose. It's packed with useful information while being fun at the same time. The Insider Insight is my favorite section."
Subhrajyoti Sen
Android Engineer @ Motive | GDE for Android
Join thousands of Android devs who look forward to Dispatch every week