Saving Data on Android



Download 19,28 Mb.
Pdf ko'rish
bet171/292
Sana24.01.2022
Hajmi19,28 Mb.
#407089
1   ...   167   168   169   170   171   172   173   174   ...   292
Bog'liq
Bailey J., Dominguez A., Djermanovic D. - Saving Data on Android (1st Edition) - 2019

Loading State
: Displayed when the list of questions are being loaded from your 
database and it is represented by a progress bar:

Data State
: Displayed when you are ready to display a question to your user. This 
state is represented by a text and a group of radio buttons for the options:
Saving Data on Android Chapter 9: Using Room with Google's Architecture Components
raywenderlich.com
157



Empty State
: Displayed when there are no questions in your database. This state 
is represented by an image and a text saying that there are no questions:

Finish State
: A special state, sent from the 
ViewModel
 when there are no more 
questions to be displayed. This state is only used by the 
QuestionActivity
 to 
know when to navigate to the 
ResultActivity
.
To represent the above states you are going to create a sealed class that your 
ViewModel
 will update and the 
QuestionActivity
 will observe using 
LiveData
. In 
the end, you will have an architecture like this:
Your 
View
s will only be in charge of communicating the actions from the user to 
your 
ViewModel
 and rendering the data received. The ViewModel will be in charge of 
communicating with the repository, handling the logic and sending UI ready data to 
your 
View
. Interesting huh? :]
Create a new Kotlin class under the 

Download 19,28 Mb.

Do'stlaringiz bilan baham:
1   ...   167   168   169   170   171   172   173   174   ...   292




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish