Hi Tarek, great tutorial! Was wondering how can we use download images in android slices. Would we use isLoading flag ? But when then should be notify the content is now available for display?
Thank you for that question,
Yes, you have to set
true in the builder of the delayed content, which is the
CellBuilder in the example here.
addImage(null, ListBuilder.SMALL_IMAGE, true) and once your image is downloaded,
getContentResolver().notifyChange(sliceUri) using your Slice URI. and that will invoke
BTW, we used
notifyChange(sliceUri) in the tutorial to update the notification icon.
Note, some of the content like
subtitle is annotated as a NonNull object so you need to set a placeholder at least.
For more information about delayed-content, check the official https://developer.android.com/guide/slices/templates#delayed-content
Thank you again! feel free to ask more questions :]
This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you!