Couldn't find a better place to ask, so might as well do it here.
In step 9, we add data binding to our app. I have two questions about the code here:
1) Why do we use context.resources instead of just resources in BindingUtils.kt lines 45 and 52?
2) In list_item_sleep_night.xml, why do we use, for example, app:sleepImage instead of just sleepImage?
I was not looking at the video while following the audio instructions and for both examples typed in the latter version, yet my app is still working as intended, so I was wondering what the difference there was and why I would want to do it as is provided in the lesson.
We recommend you use the https://knowledge.udacity.com/ platform to discuss individual issues with our experienced mentors so that new students can benefit from the discussion.
Hello,
Couldn't find a better place to ask, so might as well do it here.
In step 9, we add data binding to our app. I have two questions about the code here:
1) Why do we use
context.resources
instead of justresources
in BindingUtils.kt lines 45 and 52?2) In list_item_sleep_night.xml, why do we use, for example,
app:sleepImage
instead of justsleepImage
?I was not looking at the video while following the audio instructions and for both examples typed in the latter version, yet my app is still working as intended, so I was wondering what the difference there was and why I would want to do it as is provided in the lesson.