@NonNull public Drawable getDrawable() { Drawable drawable = MyImageCache.getAvatarDrawable(this, downloadFile.getFilePath()); if (drawable == MyDrawableCache.BROKEN) { return getDefaultDrawable(); } else if (drawable != null) { return drawable; } if (!downloadFile.exists()) { AvatarData.asyncRequestDownload(userId); } return getDefaultDrawable(); }
public static Drawable getDefaultDrawable() { return MyImageCache.getStyledDrawable( R.drawable.ic_person_black_36dp, R.drawable.ic_person_white_36dp); }