Hi (˵ •̀ ᴗ - ˵ ) ✧ I recently started learning jetpack compose which is mind-blowing for me.
It's a new thing that will revolutionalize creating Android UI.
I never thought about it but creating a User Interface in Android was always very problematic.
You need to create a .xml file where you store your design. It's nice but in some cases, it can be shortened.
For example, in the Currency app, I will show creating a very common List view.
I will try to explain from bottom to top. I think it useful to fully see the way it updates UI
Here we have item UI where data will be filled in
Later we need to add a class where data passed are set in
Now, the most important class - Adapter
Here we manage to load multiple items at a fast rate
The last step is to submit the downloaded data
It's long right?
Now Compose
That's it.
By Lazy Views, we pass items to List View which creates items when scrolled to the wanted position. Inside brackets of items indexed is the content of showed UI. Compose is just an amazing library to bring your Android skills to another level which for me is just amazing. It has a lot of perks over standard Android UI especially
Dividing UI into multiple modules
Setting height and width at %
Shorten and easier code
Thank you for reading and see you soon
Comments