package com.cauchymop.goblob.model;

import android.content.Context;
import android.net.Uri;
import android.widget.ImageView;

import com.google.android.gms.common.images.ImageManager;
import com.google.common.collect.Maps;

import java.util.Map;

/**
 * Class storing avatars Uris for {@link GoPlayer}s.
 */
public class AvatarManager {
  private final Map<String, Uri> avatarUrisByPlayerIds = Maps.newHashMap();
  final ImageManager imageManager;

  public AvatarManager(Context context) {
    imageManager = ImageManager.create(context);
  }

  public void setAvatarUri(String playerId, Uri avatarUri) {
    if (getAvatarUri(playerId) == null) {
      avatarUrisByPlayerIds.put(playerId, avatarUri);
    }
  }

  private  Uri getAvatarUri(String playerId) {
    return avatarUrisByPlayerIds.get(playerId);
  }

  public void loadImage(ImageView avatarImage, String playerId) {
    imageManager.loadImage(avatarImage, getAvatarUri(playerId));
  }
}

@@ -248,17 +248,25 @@
 %0A/**%0A * 
-C
+Utility c
 lass sto
@@ -304,16 +304,88 @@
 Player%7Ds
+ and using them to load Avatar images in%0A * %7B@link ImageView%7Ds on demand
 .%0A */%0Apu
@@ -791,108 +791,8 @@
  %7D%0A%0A
-  private  Uri getAvatarUri(String playerId) %7B%0A    return avatarUrisByPlayerIds.get(playerId);%0A  %7D%0A%0A
   pu
@@ -922,10 +922,111 @@
 ));%0A  %7D%0A
+%0A  private  Uri getAvatarUri(String playerId) %7B%0A    return avatarUrisByPlayerIds.get(playerId);%0A  %7D%0A%0A
 %7D%0A

Fix AvatarManager class comment and method order.