mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
generating avatar as fallback
Signed-off-by: tobiaskaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
f428c8140c
commit
be3086c2f4
1 changed files with 11 additions and 1 deletions
|
@ -896,7 +896,11 @@ public class ThumbnailsCacheManager {
|
|||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log_OC.e(TAG, "Error downloading avatar", e);
|
||||
try {
|
||||
return TextDrawable.createAvatar(mAccount.name, mAvatarRadius);
|
||||
} catch (Exception e1) {
|
||||
Log_OC.e(TAG, "Error generating fallback avatar");
|
||||
}
|
||||
} finally {
|
||||
if (get != null) {
|
||||
get.releaseConnection();
|
||||
|
@ -904,6 +908,12 @@ public class ThumbnailsCacheManager {
|
|||
}
|
||||
} else {
|
||||
Log_OC.d(TAG, "Server too old");
|
||||
|
||||
try {
|
||||
return TextDrawable.createAvatar(mAccount.name, mAvatarRadius);
|
||||
} catch (Exception e) {
|
||||
Log_OC.e(TAG, "Error generating fallback avatar");
|
||||
}
|
||||
}
|
||||
}
|
||||
return BitmapUtils.bitmapToCircularBitmapDrawable(mResources, avatar);
|
||||
|
|
Loading…
Reference in a new issue