I-Jetpack Compose, uhlaka lokwakha izixhumi zomsebenzisi zomdabu ze-Android

Ukuqamba kweJetpack uhlaka olusha (olwenziwe ngokuhlanganyela yiGoogle neJetBrains) okungukuthi Yenzelwe ukudala izixhumi ezibonakalayo zomsebenzisi zezinhlelo zokusebenza ze-Android.

Isebenza kuphela neKotlin hhayi ngolimi lohlelo lweJava. Leli thuluzi lihlose ukusiza abathuthukisi ukuthi bakhe izinhlelo ngokushesha, besebenzisa i- "interface yomdabu yesimanje yomsebenzisi we-Android".

“Namuhla sikhiphe inguqulo engu-1.0 ye-Jetpack Compose, i-Android's native, modern interface interface toolkit to help you ukwakha kangcono, ngokushesha. Izinzile futhi ikulungele ukwamukelwa ekukhiqizweni, ”kusho u-Anna-Chiara Bellini, oyiMenenja yoMkhiqizo, kubhulogi.

“Siklame ukuthi iCompose isheshe futhi ibe lula ukudala izinhlelo zomdabu ze-Android. Ngendlela yokumemezela ngokuphelele, umane uchaze isikhombimsebenzisi sakho somsebenzisi bese uQamba unakekela okusele. Lapho isimo sohlelo lokusebenza sishintsha, i-interface yaso yomsebenzisi ivuselelwa ngokuzenzakalela, okwenza kube lula ukwakhiwa okusheshayo kwezindawo zokuxhumana zomsebenzisi. "

Mayelana neJetpack Compose

Uhlelo lokusebenza belulohlobo lwe-beta izinyanga ezinhlanu futhi selufinyelele ngokusemthethweni enguqulweni engu-1.0 futhi ngokusho kwamagama we-Google le nguqulo i-1.0 isilungele ukusetshenziswa ekukhiqizeni futhi inikela ngemisebenzi esemqoka elandelayo:

  • Ukusebenzisana: Ukubhala kudizayinelwe ukusebenzisana nohlelo lwakho lokusebenza olukhona. Ungashumeka i-Compose interface yomsebenzisi ku- "Ukubuka" noma ku- "Ukubukwa" ku-Qamba. Ungangeza inkinobho eyodwa esikrinini noma ugcine ukubuka okwenziwe ngokwezifiso esikrinini sokubhala.
  • Ukuhlanganiswa kweJetpack: Ukubhala kuklanyelwe ukuhlanganiswa nemitapo yolwazi yeJetpack. Ngokuhlanganiswa kwe-Navigation, Paging, LiveData (noma i-Flow / RxJava), i-ViewModel, ne-Hilt, i-Compose isebenza ngobuciko bakho obukhona.
  • Material: Ukubhala kunikeza ukufakwa kwezinto zezinto zokwakha kanye nezindikimba, okwenza kube lula ukudala izinhlelo zokusebenza ezibukeka kahle. Uhlelo lwezinto zokwakha kulula ukuluqonda nokulandelela, ngaphandle kokudlula kumafayela amaningi weXML.
  • Uhlu: Izinto zeCompose's Lazy zinikela ngendlela elula, emfushane, kepha enamandla yokubonisa uhlu lwedatha kahle, ngobuncane bombhalo we-boilerplate.
  • Ukugqwayiza Ngenxa yama-API wama-animation alula futhi angaguquki, kulula kakhulu konjiniyela ukujabulisa abasebenzisi bohlelo lwabo lokusebenza.

Manje njengoba iJetpack Compose isiphumile ngokusemthethweni ku-beta, abakwaGoogle bakhiphe umgwaqo wabo wezimpawu zokubhala ezizayo. Ukuqinisekisa ukuthi Ukuqamba kulungele ukusetshenziswa konjiniyela, uhlaka luza nezinhlobonhlobo zezinto "zokuklanywa kwento" ezilungele ukusetshenziswa.

I-Google iphinde yamemezela ngaphambilini ukuthi ukusekelwa kwe- "Material You" entsha kuzotholakala maduzane. Ezinye izinto ezikumephu womgwaqo weJetpack Compose zifaka ukwesekwa okugcwele kwe-WearOS, ukusebenza okuthuthukisiwe, futhi okumangalisa kakhulu, amandla okwenza amawijethi esikrini sasekhaya se-Android.

Ngaphezu kwalo Kukhulunywa ukuthi Ukuqamba kunikezela nangethuluzi elikhethekile «Bhala Ukubuka kuqala», ihlanganiswe ne-Android Studio "Arctic Fox". Ngaleli thuluzi, unjiniyela angathola umbono wokuthi uhlelo lwabo lubukeka kanjani noma ushintsho oluthile ngaphandle kokuphinda bahlanganise ikhodi yabo. Ngokufanayo, izintambo ezikukhodi yakho yohlelo lokubhala zingaguqulwa futhi imiphumela ibonakale ngokushesha ku-debugger yakho ngaphandle kokuphindisela.

Tambien I-Google ilungiselele isethi ephelele yezinsizakusebenza zamaqembu wonjiniyela. Ukuze uqalise nge-Jetpack Compose futhi usebenzise amathuluzi akamuva anikezwa i-Google, mane uvuselele enguqulweni entsha ye-Android Studio "i-Arctic Fox", ekhishwe muva nje nokuthi ngesikhathi sayo sokuthuthuka, i-Google ingeze imisebenzi emisha efana ne-Accessibility Scanner, Test IMatrix, ukwesekwa kwendabuko kweMac M1 nokusekelwa okugcwele kweJetpack Compose.

Okokugcina uma unesifiso sokwazi okwengeziwe ngakho, ungabheka kumadokhumenti, kufaka phakathi imihlahlandlela kuma-API angukhiye njengezakhiwo, ukuzulazula noma ukuhlola, ukusetshenziswa konjiniyela noma ukusebenza kwamathuluzi, namavidiyo.

Umthombo: https://android-developers.googleblog.com


Okuqukethwe yi-athikili kunamathela ezimisweni zethu ze izimiso zokuhlelela. Ukubika iphutha chofoza lapha.

Yiba ngowokuqala ukuphawula

Shiya umbono wakho

Ikheli lakho le ngeke ishicilelwe. Ezidingekayo ibhalwe nge *

*

*

  1. Ubhekele imininingwane: Miguel Ángel Gatón
  2. Inhloso yedatha: Lawula Ugaxekile, ukuphathwa kwamazwana.
  3. Ukusemthethweni: Imvume yakho
  4. Ukuxhumana kwemininingwane: Imininingwane ngeke idluliselwe kubantu besithathu ngaphandle kwesibopho esisemthethweni.
  5. Isitoreji sedatha: Idatabase ebanjwe yi-Occentus Networks (EU)
  6. Amalungelo: Nganoma yisiphi isikhathi ungakhawulela, uthole futhi ususe imininingwane yakho.