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
"
"Keep up the good work with the newsletter 💪 I really enjoy it."
Saúl Molinero
Senior Android Engineer @ Significo
Join thousands of Android devs who look forward to Dispatch every week