Hey there, I am new to the world of Android develo...
# android
t
Hey there, I am new to the world of Android development. Starting with Jetpack compose. so skipping the XML completely. Wish me luck.
🐕 6
f
Good luck!
k
XML is alegacy... hope they anonce smth like
compose first
on next IO
p
What is
compose first
?
f
In my view;
Compose first
would be when Google will: • Recommend using Compose over Views (already happening?) • Won’t add new features to Views, just keep them around for legacy apps / legacy reasons • Won’t recommend new developers learn Views • Make Compose
Stable
and performant. (Lot’s of Material 3 Composables require you to annotate with “Experimental”) • All Google-created libraries will support Compose, and won’t require you to use Views. (For example, Google Maps map as Composable instead of MapView; Google Ads as Composable instead of View) • Thereby they won’t be “cheating” by using an AndroidView https://developer.android.com/develop/ui/compose/migrate/interoperability-apis/views-in-compose • They will mention these facts at Google I/O, Blogs and documentation Bonus: • They will put more effort in the Multiplatform efforts of Compose, seems that JetBrains is mostly working on that. • They will add/improve documentation (/code), about integrating certain API’s with Compose. ( For example, LiveData doesn’t integrate well with Compose/ViewModel, due to other LifeCycle )
👍 1
They did already make huge efforts towards making it
Compose first
.
These would be, among others: • Compose UI Previews in Android Studio • Providing lots of documentation, blogs, video’s, example code, tutorials and code-labs • Efforts to making Compose more stable and performant • Making sure Compose integrates with latest Material Design • Making sure most commonly used Views have a Compose alternative.
👍 1
k
Agree, and from what i see it's going to be at some point • google removing views-related lessons and replace em with compose • they add multiplatform supportf for most of libs (recent they add lifecycle-multiplatform)
k
There are still places which require xml/views and compose in those places doesn't seem feasible. Custom notifications layout (although they may deprecate them I guess); RemoteViews for widgets (can be wrapped with a bit different compose framework) Splash screen (not a view exactly)
f
Right, for Widgets, you still need to use RemoteViews; Yes you can use Compose, using Glance, but in the back, that will still output RemoteViews. This is needed for legacy / compatibility reasons. Views will be here for a while, due to compatibilty.