public Drawable getDrawable() { if (downloadFile.exists()) { return AttachedImageDrawable.drawableFromPath(this, downloadFile.getFile().getAbsolutePath()); } AvatarData.asyncRequestDownload(userId); return getDefaultDrawable(); }
@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(); }
private void optionallyLoadAvatar(long userId, ContentValues values) { if (MyPreferences.showAvatars() && values.containsKey(User.AVATAR_URL)) { AvatarData.getForUser(userId).requestDownload(); } }