aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-08-12 21:03:45 +0200
committeriNPUTmice <daniel@gultsch.de>2014-08-12 21:03:45 +0200
commit721b308f28c6efbe8eda917725f2a85d8f70525f (patch)
treedf3d07a2a1f826f7a748a8e983c482e61a2506e1 /src/eu
parent6952e630c413314da1cbc0d335825c7613e4ae93 (diff)
fixed long press to bring back default in publish avatar activity
Diffstat (limited to 'src/eu')
-rw-r--r--src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java b/src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java
index 0661f1a9..434d1d4d 100644
--- a/src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java
+++ b/src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java
@@ -154,16 +154,23 @@ public class PublishProfilePictureActivity extends XmppActivity {
this.support = this.account.getXmppConnection().getFeatures().pubsub();
}
if (this.avatarUri == null) {
- if (this.account.getAvatar() != null) {
+ if (this.account.getAvatar() != null || this.defaultUri == null) {
this.avatar.setImageBitmap(this.account.getImage(
getApplicationContext(), 384));
- this.avatar
- .setOnLongClickListener(this.backToDefaultListener);
- } else {
if (this.defaultUri != null) {
- this.avatarUri = this.defaultUri;
- loadImageIntoPreview(this.defaultUri);
+ this.avatar
+ .setOnLongClickListener(this.backToDefaultListener);
+ } else {
+ this.secondaryHint.setVisibility(View.INVISIBLE);
}
+ if (!support) {
+ this.hintOrWarning.setTextColor(getWarningTextColor());
+ this.hintOrWarning.setText(R.string.error_publish_avatar_no_server_support);
+ }
+ } else {
+ this.avatarUri = this.defaultUri;
+ loadImageIntoPreview(this.defaultUri);
+ this.secondaryHint.setVisibility(View.INVISIBLE);
}
} else {
loadImageIntoPreview(avatarUri);
@@ -191,7 +198,7 @@ public class PublishProfilePictureActivity extends XmppActivity {
if (this.defaultUri != null && uri.equals(this.defaultUri)) {
this.secondaryHint.setVisibility(View.INVISIBLE);
this.avatar.setOnLongClickListener(null);
- } else {
+ } else if (this.defaultUri != null ) {
this.secondaryHint.setVisibility(View.VISIBLE);
this.avatar.setOnLongClickListener(this.backToDefaultListener);
}