top of page
Szukaj
Zdjęcie autoraPaweł Łukasz

Jetpack Compose



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

  1. Dividing UI into multiple modules

  2. Setting height and width at %

  3. Shorten and easier code


Thank you for reading and see you soon

10 wyświetleń0 komentarzy

Ostatnie posty

Zobacz wszystkie

WWA

War at Myself

Hello Since last post Summary : I got my knee fucked up (cartilage chondromalacia) Created another wine Restore friends <3 Started...

Hard way

Comments


bottom of page