Let's Migrate an XML Project to Jetpack Compose!

preview_player
Показать описание
In this video, I'll show you how you can take a full XML project and migrate it to Jetpack Compose step-by-step. You can apply this sequence of steps for any of your XML projects.

⭐ Get certificates for your future job
⭐ Save countless hours of time
⭐ 100% money back guarantee for 30 days
⭐ Become a professional Android developer now:

💻 Let me be your mentor and become an industry-ready Android developer in 10 weeks:

Subscribe to my FREE newsletter for regular Android, Kotlin & Architecture advice!

Join this channel to get access to perks:

Get the initial source code for this video here:

Get the source code after migration here:

Join my Discord server:

You like my free content? Here you can buy me a coffee:
Рекомендации по теме
Комментарии
Автор

As a little addition, in case you also want to migrate your XML theme to Compose:
1. All you really need to do for that is to create the theme-specific Compose files you already get in any new Compose project (Type.kt, Shapes.kt, Colors.kt, Theme.kt). You can just copy these over and adjust based on your theme.
2. Then, in every ComposeView in your project, you use YourAppTheme { ... } as the root wrapper.

That's it.

PhilippLackner
Автор

In my firm, we are now migrating our code from XML to Compose. This video is really helpful. Kudos!

saurabhyadav-szrx
Автор

Thanks for the video. I have been working with migrating XML to compose views for some time, and I prefer to pass the findNavContoller() function to the composable. Then I can create a channel that will be consumed by a shared composable.

That means no callback functions to the fragment, it looks more similar to a pure compose screen and just a single line for each screen to allow navigation, toast, pop with arguments, etc.

Also, a simple way to add all compose dependencies is to right-click on the project and tap New -> Compose -> Empty Compose Activity.

Camlon
Автор

Hey Philipp, Thank you so much for this great video. But you forgot to add inside the fragment which helps composeView to dispose its's composition when the view's lifecycleowner is destroyed.

SachinKumar-nbpg
Автор

This is the only video tutorial from the jetpack compose series that I couldn't finish :(
I got tons of gradle errors just at the last step, I assume it's because the dependencies versions have changed (even tho I replaced those by the more recents).
I think I'll just try it with a newer video tut. Anyway, Thanks Philipp!

xCrawfly
Автор

Thank you for this video. The most important information.

aokruan
Автор

Hi Philipp, why you use lateinit var compose view? you can do like that View = { setContent {} } in onCreateView

pumaelgatosiberian
Автор

could u please make tutorial about baseline profiles?))

azamat
Автор

Ok how can i compare the lioading time and performance of my xml views before and after migration

chrislagos
Автор

Can you make a video about how to handle Lifecycle event in compose? Thanks!

samstoyroom
Автор

I have a silly point but I think it's important, When you have to apply a sound on every button clicked in your app, what should the best approach to this.

nipunkumarit
Автор

@Philipp can you help me understand this XML code?

dealcart
Автор

Hi Philipp, thank you for your content. Can you tell, what theme exactly do you use in your android studio?

eogbqqn
Автор

Can you give us sources to learn Android compose

aymenebenguedouad
Автор

hi philipp, thanks for your tutorial videos because it really helps! if i may ask you one thing, please create one video on how to learn programming really fast. a short video is good too. thank you 🙏

josua_htp
Автор

Another Like from me, even though I dont need this, because Im a "guru". 🤣 jk @Philipp, another good content!

maximooze
Автор

What kind of theme do you have in Android Studio?
P.S. Thank you!

PandaTop.
Автор

can I convert my whole JAVA android project to jetpack compose..?

Rohan_is_discovering
Автор

it's still painful to see UI preview in compose.

sebastianseno
Автор

I really don't like this declarative approach of building UI. When flutter came out with this approach I was really exited. But really didn't like it. I tried flutter multiple times but didn't really like it. Same thing is happening with compose. Anyone else can relate?

atikurrahamanshakur