Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

speaker list avatar fix #28

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

burntcookie90
Copy link
Contributor

Fixes #26

Fixes 360Conferences#26:

When loading the speaker list, avatar images would pop in late, or have
a "ghost" from the previous bind. The viewholder was requesting
a `downloadUrl` for each avatar on bind. This switches to using
coroutines to map the avatar download url into the `Speaker` model
itself. Doing this lets the recycler have all the data it needs to bind
its viewholders.
})
override suspend fun getAvatarUri(speaker: Speaker) = suspendCoroutine<String> { c ->
val id = speaker.id ?: ""
if (id.isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can just be id == null to get rid of the ?: above

Copy link
Collaborator

@rharter rharter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, I think we're ready to coroutine all the things ;)

@@ -10,7 +10,8 @@ class Speaker(val id: String? = null,
val email: String? = null,
val twitter: String? = null,
val github: String? = null,
val bio: String? = null) {
val bio: String? = null,
val downloadUrl: String? = null) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity could you please rename this to something like avatarUrl?

@burntcookie90
Copy link
Contributor Author

All ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants