aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java25
1 files changed, 7 insertions, 18 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java b/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java
index 301baff5..1916947b 100644
--- a/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java
@@ -24,6 +24,8 @@ import java.io.FileNotFoundException;
import de.thedevstack.conversationsplus.ConversationsPlusColors;
import de.thedevstack.conversationsplus.utils.ImageUtil;
+import de.thedevstack.conversationsplus.utils.ui.TextViewUtil;
+
import eu.siacs.conversations.Config;
import eu.siacs.conversations.R;
import eu.siacs.conversations.entities.Account;
@@ -87,8 +89,7 @@ public class PublishProfilePictureActivity extends XmppActivity {
public void run() {
hintOrWarning.setText(errorCode);
hintOrWarning.setTextColor(ConversationsPlusColors.warning());
- publishButton.setText(R.string.publish);
- enablePublishButton();
+ TextViewUtil.enable(publishButton, ConversationsPlusColors.primaryText(), R.string.publish);
}
});
@@ -114,8 +115,7 @@ public class PublishProfilePictureActivity extends XmppActivity {
@Override
public void onClick(View v) {
if (avatarUri != null) {
- publishButton.setText(R.string.publishing);
- disablePublishButton();
+ TextViewUtil.disable(publishButton, ConversationsPlusColors.secondaryText(), R.string.publishing);
AvatarService.getInstance().publishAvatar(account, avatarUri,
avatarPublication);
}
@@ -288,7 +288,7 @@ public class PublishProfilePictureActivity extends XmppActivity {
}
if (bm == null) {
- disablePublishButton();
+ TextViewUtil.disable(this.publishButton, ConversationsPlusColors.secondaryText());
this.hintOrWarning.setTextColor(ConversationsPlusColors.warning());
this.hintOrWarning
.setText(R.string.error_publish_avatar_converting);
@@ -296,12 +296,11 @@ public class PublishProfilePictureActivity extends XmppActivity {
}
this.avatar.setImageBitmap(bm);
if (support) {
- enablePublishButton();
- this.publishButton.setText(R.string.publish);
+ TextViewUtil.enable(this.publishButton, ConversationsPlusColors.primaryText(), R.string.publish);
this.hintOrWarning.setText(R.string.publish_avatar_explanation);
this.hintOrWarning.setTextColor(ConversationsPlusColors.primaryText());
} else {
- disablePublishButton();
+ TextViewUtil.disable(this.publishButton, ConversationsPlusColors.secondaryText());
this.hintOrWarning.setTextColor(ConversationsPlusColors.warning());
this.hintOrWarning
.setText(R.string.error_publish_avatar_no_server_support);
@@ -315,16 +314,6 @@ public class PublishProfilePictureActivity extends XmppActivity {
}
}
- protected void enablePublishButton() {
- this.publishButton.setEnabled(true);
- this.publishButton.setTextColor(ConversationsPlusColors.primaryText());
- }
-
- protected void disablePublishButton() {
- this.publishButton.setEnabled(false);
- this.publishButton.setTextColor(ConversationsPlusColors.secondaryText());
- }
-
public void refreshUiReal() {
//nothing to do. This Activity doesn't implement any listeners
}