aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/ui/PublishProfilePictureActivity.java
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2016-03-29 22:28:19 +0200
committersteckbrief <steckbrief@chefmail.de>2016-03-29 22:28:19 +0200
commit1d5d94080a6bffaf5fa7c358af76a3cfae0a8ade (patch)
tree8aa91ceb1f114a2d20249c65223e6b87b7191af6 /src/main/java/de/thedevstack/conversationsplus/ui/PublishProfilePictureActivity.java
parent6244834096727cfc1aaaeba7845a6d9cfe27d2b0 (diff)
Introduction of a TextViewUtil to easily set attributes for TextViews
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ui/PublishProfilePictureActivity.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/PublishProfilePictureActivity.java24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/PublishProfilePictureActivity.java b/src/main/java/de/thedevstack/conversationsplus/ui/PublishProfilePictureActivity.java
index 1501c78a..6793d882 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/PublishProfilePictureActivity.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/PublishProfilePictureActivity.java
@@ -31,6 +31,7 @@ import de.thedevstack.conversationsplus.services.AvatarService;
import de.thedevstack.conversationsplus.utils.ExifHelper;
import de.thedevstack.conversationsplus.utils.FileUtils;
import de.thedevstack.conversationsplus.utils.PhoneHelper;
+import de.thedevstack.conversationsplus.utils.ui.TextViewUtil;
import de.thedevstack.conversationsplus.xmpp.pep.Avatar;
public class PublishProfilePictureActivity extends XmppActivity {
@@ -87,8 +88,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 +114,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 +287,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 +295,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 +313,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
}