aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-08-16 17:31:53 +0200
committeriNPUTmice <daniel@gultsch.de>2014-08-16 17:31:53 +0200
commit38f36aa2631f863d927f417b3758eb7969b31111 (patch)
treea8b33c1e803fa508dd30c7c48e550cff5afadbd7 /src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java
parent5aa8afdc1c0c60a47f8e93076697ad65e702764d (diff)
more error handling for avatar publication
Diffstat (limited to '')
-rw-r--r--src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java b/src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java
index 3b6ca13d..e874eeb7 100644
--- a/src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java
+++ b/src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java
@@ -129,6 +129,9 @@ public class PublishProfilePictureActivity extends XmppActivity {
if (resultCode == RESULT_OK) {
if (requestCode == REQUEST_CHOOSE_FILE) {
this.avatarUri = data.getData();
+ if (xmppConnectionServiceBound) {
+ loadImageIntoPreview(this.avatarUri);
+ }
}
}
}
@@ -173,6 +176,12 @@ public class PublishProfilePictureActivity extends XmppActivity {
protected void loadImageIntoPreview(Uri uri) {
Bitmap bm = xmppConnectionService.getFileBackend().cropCenterSquare(
uri, 384);
+ if (bm==null) {
+ disablePublishButton();
+ this.hintOrWarning.setTextColor(getWarningTextColor());
+ this.hintOrWarning.setText(R.string.error_publish_avatar_converting);
+ return;
+ }
this.avatar.setImageBitmap(bm);
if (support) {
enablePublishButton();