Ejemplo n.º 1
0
 static {
   try {
     if (mDefaultBitmap == null) {
       mDefaultBitmap =
           DemoUtils.decodeStream(
               CCPAppManager.getContext().getAssets().open("avatar/default_nor_avatar.png"),
               ResourceHelper.getDensity(null));
     }
   } catch (IOException e) {
   }
 }
Ejemplo n.º 2
0
  /**
   * 查找头像
   *
   * @param username
   * @return
   */
  public static Bitmap getPhoto(String username) {

    try {
      if (photoCache.containsKey(username)) {
        return photoCache.get(username);
      }

      Bitmap bitmap =
          DemoUtils.decodeStream(
              CCPAppManager.getContext().getAssets().open("avatar/" + username),
              ResourceHelper.getDensity(null));
      photoCache.put(username, bitmap);
      return bitmap;
    } catch (IOException e) {
    }
    return mDefaultBitmap;
  }
Ejemplo n.º 3
0
 private static boolean isAlphaTest() {
   return ALPHA_ACCOUNT.equals(DemoUtils.getLoginAccount());
 }