Skip to content

speaker list avatar fix#28

Open
burntcookie90 wants to merge 3 commits into360Conferences:masterfrom
burntcookie90:vr/speaker-list-avatar-fix
Open

speaker list avatar fix#28
burntcookie90 wants to merge 3 commits into360Conferences:masterfrom
burntcookie90:vr/speaker-list-avatar-fix

Conversation

@burntcookie90
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 ;)

val github: String? = null,
val bio: String? = null) {
val bio: String? = null,
val downloadUrl: String? = null) {
Copy link
Copy Markdown
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 burntcookie90 force-pushed the vr/speaker-list-avatar-fix branch from 8e54b87 to 987a1fa Compare April 12, 2018 20:25
@burntcookie90
Copy link
Copy Markdown
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.

3 participants