use of com.thebluealliance.androidclient.eventbus.TeamAvatarUpdateEvent in project the-blue-alliance-android by the-blue-alliance.
the class MediaListSubscriber method parseData.
@Override
public void parseData() {
mDataToBind.clear();
mPhotos.clear();
mVideos.clear();
String encodedAvatar = "";
for (int i = 0; i < mAPIData.size(); i++) {
Media media = mAPIData.get(i);
MediaType mediaType = MediaType.fromString(media.getType());
if (mediaType.isImage()) {
mPhotos.children.add(media);
} else if (mediaType.isVideo()) {
mVideos.children.add(media);
} else if (mediaType.isAvatar()) {
encodedAvatar = media.getBase64Image();
}
}
if (!mPhotos.children.isEmpty()) {
mDataToBind.add(mPhotos);
}
if (!mVideos.children.isEmpty()) {
mDataToBind.add(mVideos);
}
mEventBus.post(new TeamAvatarUpdateEvent(encodedAvatar));
}
Aggregations