aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/ui
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2016-03-29 11:43:22 +0200
committersteckbrief <steckbrief@chefmail.de>2016-03-29 11:43:22 +0200
commit6244834096727cfc1aaaeba7845a6d9cfe27d2b0 (patch)
treebc532e86b2bfca9afbcfcfc4c383b48ecb287ea4 /src/main/java/de/thedevstack/conversationsplus/ui
parent0c0676b7dbf87e24ebcc4714adfb10d91e3d72b8 (diff)
Implements FS#173: Move access to colors to separate helper class
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ui')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/ChangePasswordActivity.java5
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/EditAccountActivity.java13
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/PublishProfilePictureActivity.java15
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/TrustKeysActivity.java5
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/VerifyOTRActivity.java5
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/XmppActivity.java66
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/adapter/AccountAdapter.java7
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java3
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/adapter/MessageAdapter.java9
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/adapter/PresencesArrayAdapter.java2
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/dialogs/MessageDetailsDialog.java3
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/forms/FormFieldWrapper.java3
12 files changed, 50 insertions, 86 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/ChangePasswordActivity.java b/src/main/java/de/thedevstack/conversationsplus/ui/ChangePasswordActivity.java
index 1eb9fa05..65b3c49b 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/ChangePasswordActivity.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/ChangePasswordActivity.java
@@ -6,6 +6,7 @@ import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
+import de.thedevstack.conversationsplus.ConversationsPlusColors;
import de.thedevstack.conversationsplus.R;
import de.thedevstack.conversationsplus.entities.Account;
import de.thedevstack.conversationsplus.services.XmppConnectionService;
@@ -38,7 +39,7 @@ public class ChangePasswordActivity extends XmppActivity implements XmppConnecti
mNewPasswordConfirm.setError(null);
xmppConnectionService.updateAccountPasswordOnServer(mAccount, newPassword, ChangePasswordActivity.this);
mChangePasswordButton.setEnabled(false);
- mChangePasswordButton.setTextColor(getSecondaryTextColor());
+ mChangePasswordButton.setTextColor(ConversationsPlusColors.secondaryText());
mChangePasswordButton.setText(R.string.updating);
}
}
@@ -91,7 +92,7 @@ public class ChangePasswordActivity extends XmppActivity implements XmppConnecti
public void run() {
mNewPassword.setError(getString(R.string.could_not_change_password));
mChangePasswordButton.setEnabled(true);
- mChangePasswordButton.setTextColor(getPrimaryTextColor());
+ mChangePasswordButton.setTextColor(ConversationsPlusColors.primaryText());
mChangePasswordButton.setText(R.string.change_password);
}
});
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/EditAccountActivity.java b/src/main/java/de/thedevstack/conversationsplus/ui/EditAccountActivity.java
index ac06544a..9a616414 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/EditAccountActivity.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/EditAccountActivity.java
@@ -38,6 +38,7 @@ import java.util.List;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
+import de.thedevstack.conversationsplus.ConversationsPlusColors;
import de.thedevstack.conversationsplus.ui.listeners.ShowResourcesListDialogListener;
import de.thedevstack.conversationsplus.Config;
import de.thedevstack.conversationsplus.R;
@@ -336,24 +337,24 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
if (accountInfoEdited() && !mInitMode) {
this.mSaveButton.setText(R.string.save);
this.mSaveButton.setEnabled(true);
- this.mSaveButton.setTextColor(getPrimaryTextColor());
+ this.mSaveButton.setTextColor(ConversationsPlusColors.primaryText());
} else if (mAccount != null && (mAccount.getStatus() == Account.State.CONNECTING || mFetchingAvatar)) {
this.mSaveButton.setEnabled(false);
- this.mSaveButton.setTextColor(getSecondaryTextColor());
+ this.mSaveButton.setTextColor(ConversationsPlusColors.secondaryText());
this.mSaveButton.setText(R.string.account_status_connecting);
} else if (mAccount != null && mAccount.getStatus() == Account.State.DISABLED && !mInitMode) {
this.mSaveButton.setEnabled(true);
- this.mSaveButton.setTextColor(getPrimaryTextColor());
+ this.mSaveButton.setTextColor(ConversationsPlusColors.primaryText());
this.mSaveButton.setText(R.string.enable);
} else {
this.mSaveButton.setEnabled(true);
- this.mSaveButton.setTextColor(getPrimaryTextColor());
+ this.mSaveButton.setTextColor(ConversationsPlusColors.primaryText());
if (!mInitMode) {
if (mAccount != null && mAccount.isOnlineAndConnected()) {
this.mSaveButton.setText(R.string.save);
if (!accountInfoEdited()) {
this.mSaveButton.setEnabled(false);
- this.mSaveButton.setTextColor(getSecondaryTextColor());
+ this.mSaveButton.setTextColor(ConversationsPlusColors.secondaryText());
}
} else {
this.mSaveButton.setText(R.string.connect);
@@ -552,7 +553,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
getActionBar().setHomeButtonEnabled(false);
}
this.mCancelButton.setEnabled(false);
- this.mCancelButton.setTextColor(getSecondaryTextColor());
+ this.mCancelButton.setTextColor(ConversationsPlusColors.secondaryText());
}
if (Config.DOMAIN_LOCK == null) {
final KnownHostsAdapter mKnownHostsAdapter = new KnownHostsAdapter(this,
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/PublishProfilePictureActivity.java b/src/main/java/de/thedevstack/conversationsplus/ui/PublishProfilePictureActivity.java
index 23601f44..1501c78a 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/PublishProfilePictureActivity.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/PublishProfilePictureActivity.java
@@ -22,6 +22,7 @@ import com.soundcloud.android.crop.Crop;
import java.io.File;
import java.io.FileNotFoundException;
+import de.thedevstack.conversationsplus.ConversationsPlusColors;
import de.thedevstack.conversationsplus.utils.ImageUtil;
import de.thedevstack.conversationsplus.Config;
import de.thedevstack.conversationsplus.R;
@@ -85,7 +86,7 @@ public class PublishProfilePictureActivity extends XmppActivity {
@Override
public void run() {
hintOrWarning.setText(errorCode);
- hintOrWarning.setTextColor(getWarningTextColor());
+ hintOrWarning.setTextColor(ConversationsPlusColors.warning());
publishButton.setText(R.string.publish);
enablePublishButton();
}
@@ -245,7 +246,7 @@ public class PublishProfilePictureActivity extends XmppActivity {
}
if (!support) {
this.hintOrWarning
- .setTextColor(getWarningTextColor());
+ .setTextColor(ConversationsPlusColors.warning());
this.hintOrWarning
.setText(R.string.error_publish_avatar_no_server_support);
}
@@ -288,7 +289,7 @@ public class PublishProfilePictureActivity extends XmppActivity {
if (bm == null) {
disablePublishButton();
- this.hintOrWarning.setTextColor(getWarningTextColor());
+ this.hintOrWarning.setTextColor(ConversationsPlusColors.warning());
this.hintOrWarning
.setText(R.string.error_publish_avatar_converting);
return;
@@ -298,10 +299,10 @@ public class PublishProfilePictureActivity extends XmppActivity {
enablePublishButton();
this.publishButton.setText(R.string.publish);
this.hintOrWarning.setText(R.string.publish_avatar_explanation);
- this.hintOrWarning.setTextColor(getPrimaryTextColor());
+ this.hintOrWarning.setTextColor(ConversationsPlusColors.primaryText());
} else {
disablePublishButton();
- this.hintOrWarning.setTextColor(getWarningTextColor());
+ this.hintOrWarning.setTextColor(ConversationsPlusColors.warning());
this.hintOrWarning
.setText(R.string.error_publish_avatar_no_server_support);
}
@@ -316,12 +317,12 @@ public class PublishProfilePictureActivity extends XmppActivity {
protected void enablePublishButton() {
this.publishButton.setEnabled(true);
- this.publishButton.setTextColor(getPrimaryTextColor());
+ this.publishButton.setTextColor(ConversationsPlusColors.primaryText());
}
protected void disablePublishButton() {
this.publishButton.setEnabled(false);
- this.publishButton.setTextColor(getSecondaryTextColor());
+ this.publishButton.setTextColor(ConversationsPlusColors.secondaryText());
}
public void refreshUiReal() {
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/TrustKeysActivity.java b/src/main/java/de/thedevstack/conversationsplus/ui/TrustKeysActivity.java
index a3f674be..7772adc4 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/TrustKeysActivity.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/TrustKeysActivity.java
@@ -18,6 +18,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+import de.thedevstack.conversationsplus.ConversationsPlusColors;
import de.thedevstack.conversationsplus.R;
import de.thedevstack.conversationsplus.crypto.axolotl.AxolotlService;
import de.thedevstack.conversationsplus.crypto.axolotl.XmppAxolotlSession;
@@ -306,12 +307,12 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate
private void unlock() {
mSaveButton.setEnabled(true);
- mSaveButton.setTextColor(getPrimaryTextColor());
+ mSaveButton.setTextColor(ConversationsPlusColors.primaryText());
}
private void lock() {
mSaveButton.setEnabled(false);
- mSaveButton.setTextColor(getSecondaryTextColor());
+ mSaveButton.setTextColor(ConversationsPlusColors.secondaryText());
}
private void lockOrUnlockAsNeeded() {
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/VerifyOTRActivity.java b/src/main/java/de/thedevstack/conversationsplus/ui/VerifyOTRActivity.java
index 494d4bea..3ecdc179 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/VerifyOTRActivity.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/VerifyOTRActivity.java
@@ -19,6 +19,7 @@ import com.google.zxing.integration.android.IntentResult;
import net.java.otr4j.OtrException;
import net.java.otr4j.session.Session;
+import de.thedevstack.conversationsplus.ConversationsPlusColors;
import de.thedevstack.conversationsplus.R;
import de.thedevstack.conversationsplus.entities.Account;
import de.thedevstack.conversationsplus.entities.Contact;
@@ -380,14 +381,14 @@ public class VerifyOTRActivity extends XmppActivity implements XmppConnectionSer
protected void activateButton(Button button, int text, View.OnClickListener listener) {
button.setEnabled(true);
- button.setTextColor(getPrimaryTextColor());
+ button.setTextColor(ConversationsPlusColors.primaryText());
button.setText(text);
button.setOnClickListener(listener);
}
protected void deactivateButton(Button button, int text) {
button.setEnabled(false);
- button.setTextColor(getSecondaryTextColor());
+ button.setTextColor(ConversationsPlusColors.secondaryText());
button.setText(text);
button.setOnClickListener(null);
}
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/XmppActivity.java b/src/main/java/de/thedevstack/conversationsplus/ui/XmppActivity.java
index fed3049b..f7856a9c 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/XmppActivity.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/XmppActivity.java
@@ -70,6 +70,7 @@ import java.util.List;
import java.util.concurrent.RejectedExecutionException;
import de.thedevstack.android.logcat.Logging;
+import de.thedevstack.conversationsplus.ConversationsPlusColors;
import de.thedevstack.conversationsplus.ConversationsPlusPreferences;
import de.thedevstack.conversationsplus.utils.ImageUtil;
import de.thedevstack.conversationsplus.Config;
@@ -103,16 +104,6 @@ public abstract class XmppActivity extends Activity {
public boolean xmppConnectionServiceBound = false;
protected boolean registeredListeners = false;
- protected int mPrimaryTextColor;
- protected int mSecondaryTextColor;
- protected int mTertiaryTextColor;
- protected int mPrimaryBackgroundColor;
- protected int mSecondaryBackgroundColor;
- protected int mColorRed;
- protected int mColorOrange;
- protected int mColorGreen;
- protected int mPrimaryColor;
-
protected boolean mUseSubject = true;
private DisplayMetrics metrics;
@@ -360,15 +351,6 @@ public abstract class XmppActivity extends Activity {
super.onCreate(savedInstanceState);
metrics = getResources().getDisplayMetrics();
ExceptionHelper.init(getApplicationContext());
- mPrimaryTextColor = getResources().getColor(R.color.primaryText);
- mSecondaryTextColor = getResources().getColor(R.color.secondaryText);
- mTertiaryTextColor = getResources().getColor(R.color.black12);
- mColorRed = getResources().getColor(R.color.error);
- mColorOrange = getResources().getColor(R.color.orange500);
- mColorGreen = getResources().getColor(R.color.online);
- mPrimaryColor = getResources().getColor(R.color.primary);
- mPrimaryBackgroundColor = getResources().getColor(R.color.primaryBackground);
- mSecondaryBackgroundColor = getResources().getColor(R.color.secondaryBackground);
this.mTheme = findTheme();
setTheme(this.mTheme);
this.mUsingEnterKey = ConversationsPlusPreferences.displayEnterKey();
@@ -749,30 +731,30 @@ public abstract class XmppActivity extends Activity {
if (Config.X509_VERIFICATION && trust == XmppAxolotlSession.Trust.TRUSTED_X509) {
trustToggle.setOnClickListener(null);
}
- key.setTextColor(getPrimaryTextColor());
- keyType.setTextColor(getSecondaryTextColor());
+ key.setTextColor(ConversationsPlusColors.primaryText());
+ keyType.setTextColor(ConversationsPlusColors.secondaryText());
break;
case UNDECIDED:
trustToggle.setChecked(false);
trustToggle.setEnabled(false);
- key.setTextColor(getPrimaryTextColor());
- keyType.setTextColor(getSecondaryTextColor());
+ key.setTextColor(ConversationsPlusColors.primaryText());
+ keyType.setTextColor(ConversationsPlusColors.secondaryText());
break;
case INACTIVE_UNTRUSTED:
case INACTIVE_UNDECIDED:
trustToggle.setOnClickListener(null);
trustToggle.setChecked(false);
trustToggle.setEnabled(false);
- key.setTextColor(getTertiaryTextColor());
- keyType.setTextColor(getTertiaryTextColor());
+ key.setTextColor(ConversationsPlusColors.tertiaryText());
+ keyType.setTextColor(ConversationsPlusColors.tertiaryText());
break;
case INACTIVE_TRUSTED:
case INACTIVE_TRUSTED_X509:
trustToggle.setOnClickListener(null);
trustToggle.setChecked(true);
trustToggle.setEnabled(false);
- key.setTextColor(getTertiaryTextColor());
- keyType.setTextColor(getTertiaryTextColor());
+ key.setTextColor(ConversationsPlusColors.tertiaryText());
+ keyType.setTextColor(ConversationsPlusColors.tertiaryText());
break;
}
@@ -782,7 +764,7 @@ public abstract class XmppActivity extends Activity {
keyType.setVisibility(View.GONE);
}
if (highlight) {
- keyType.setTextColor(getResources().getColor(R.color.accent));
+ keyType.setTextColor(ConversationsPlusColors.accent());
keyType.setText(getString(x509 ? R.string.omemo_fingerprint_x509_selected_message : R.string.omemo_fingerprint_selected_message));
} else {
keyType.setText(getString(x509 ? R.string.omemo_fingerprint_x509 : R.string.omemo_fingerprint));
@@ -944,34 +926,6 @@ public abstract class XmppActivity extends Activity {
}
};
- public int getTertiaryTextColor() {
- return this.mTertiaryTextColor;
- }
-
- public int getSecondaryTextColor() {
- return this.mSecondaryTextColor;
- }
-
- public int getPrimaryTextColor() {
- return this.mPrimaryTextColor;
- }
-
- public int getWarningTextColor() {
- return this.mColorRed;
- }
-
- public int getOnlineColor() {
- return this.mColorGreen;
- }
-
- public int getPrimaryBackgroundColor() {
- return this.mPrimaryBackgroundColor;
- }
-
- public int getSecondaryBackgroundColor() {
- return this.mSecondaryBackgroundColor;
- }
-
public int getPixel(int dp) {
DisplayMetrics metrics = getResources().getDisplayMetrics();
return ((int) (dp * metrics.density));
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/AccountAdapter.java b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/AccountAdapter.java
index b6caa019..ee209576 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/AccountAdapter.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/AccountAdapter.java
@@ -13,6 +13,7 @@ import android.widget.TextView;
import java.util.List;
import de.thedevstack.conversationsplus.Config;
+import de.thedevstack.conversationsplus.ConversationsPlusColors;
import de.thedevstack.conversationsplus.R;
import de.thedevstack.conversationsplus.entities.Account;
import de.thedevstack.conversationsplus.services.AvatarService;
@@ -48,14 +49,14 @@ public class AccountAdapter extends ArrayAdapter<Account> {
statusView.setText(getContext().getString(account.getStatus().getReadableId()));
switch (account.getStatus()) {
case ONLINE:
- statusView.setTextColor(activity.getOnlineColor());
+ statusView.setTextColor(ConversationsPlusColors.online());
break;
case DISABLED:
case CONNECTING:
- statusView.setTextColor(activity.getSecondaryTextColor());
+ statusView.setTextColor(ConversationsPlusColors.secondaryText());
break;
default:
- statusView.setTextColor(activity.getWarningTextColor());
+ statusView.setTextColor(ConversationsPlusColors.warning());
break;
}
final Switch tglAccountState = (Switch) view.findViewById(R.id.tgl_account_status);
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java
index ab131cd0..37b8aa18 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java
@@ -20,6 +20,7 @@ import java.lang.ref.WeakReference;
import java.util.List;
import java.util.concurrent.RejectedExecutionException;
+import de.thedevstack.conversationsplus.ConversationsPlusColors;
import de.thedevstack.conversationsplus.ui.listeners.ShowResourcesListDialogListener;
import de.tzur.conversations.Settings;
import de.thedevstack.conversationsplus.R;
@@ -52,7 +53,7 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
// Highlight the currently selected conversation
if (this.activity instanceof ConversationActivity) {
ConversationActivity a = (ConversationActivity) this.activity;
- int c = conversation == a.getSelectedConversation() ? a.getSecondaryBackgroundColor() : a.getPrimaryBackgroundColor();
+ int c = conversation == a.getSelectedConversation() ? ConversationsPlusColors.secondaryBackground() : ConversationsPlusColors.primaryBackground();
view.findViewById(R.id.conversationListRowContent).setBackgroundColor(c);
view.findViewById(R.id.conversationListRowFrame).setBackgroundColor(c);
}
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/MessageAdapter.java b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/MessageAdapter.java
index bcfc1dc6..9311674b 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/MessageAdapter.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/MessageAdapter.java
@@ -39,6 +39,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import de.thedevstack.conversationsplus.ConversationsPlusApplication;
+import de.thedevstack.conversationsplus.ConversationsPlusColors;
import de.thedevstack.conversationsplus.ConversationsPlusPreferences;
import de.thedevstack.conversationsplus.R;
import de.thedevstack.conversationsplus.crypto.axolotl.XmppAxolotlSession;
@@ -121,9 +122,9 @@ public class MessageAdapter extends ArrayAdapter<Message> {
private int getMessageTextColor(boolean onDark, boolean primary) {
if (onDark) {
- return activity.getResources().getColor(primary ? R.color.white : R.color.white70);
+ return primary ? ConversationsPlusColors.primaryTextOnDark() : ConversationsPlusColors.secondaryTextOnDark();
} else {
- return activity.getResources().getColor(primary ? R.color.black87 : R.color.black54);
+ return primary ? ConversationsPlusColors.primaryText() : ConversationsPlusColors.secondaryText();
}
}
@@ -184,7 +185,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
break;
}
if (error && type == SENT) {
- viewHolder.time.setTextColor(activity.getWarningTextColor());
+ viewHolder.time.setTextColor(ConversationsPlusColors.warning());
} else {
viewHolder.time.setTextColor(this.getMessageTextColor(darkBackground,false));
}
@@ -199,7 +200,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
message.getAxolotlFingerprint());
if(trust == null || (!trust.trusted() && !trust.trustedInactive())) {
- viewHolder.indicator.setColorFilter(activity.getWarningTextColor());
+ viewHolder.indicator.setColorFilter(ConversationsPlusColors.warning());
viewHolder.indicator.setAlpha(1.0f);
} else {
viewHolder.indicator.clearColorFilter();
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/PresencesArrayAdapter.java b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/PresencesArrayAdapter.java
index 2f8d12f2..2d777897 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/PresencesArrayAdapter.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/PresencesArrayAdapter.java
@@ -36,7 +36,7 @@ public class PresencesArrayAdapter extends ArrayAdapter<Presence> {
View rowView = inflater.inflate(R.layout.dialog_resources_status, parent, false);
TextView textView = (TextView) rowView.findViewById(R.id.dlg_res_stat_resource_name);
textView.setText(this.values[position].resource);
- textView.setTextColor(Color.parseColor(UIHelper.getStatusColor(this.values[position].status)));
+ textView.setTextColor(UIHelper.getStatusColor(this.values[position].status));
return rowView;
}
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/MessageDetailsDialog.java b/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/MessageDetailsDialog.java
index 9ef51dd4..dfa3147d 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/MessageDetailsDialog.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/MessageDetailsDialog.java
@@ -8,6 +8,7 @@ import android.widget.TextView;
import java.util.Date;
import de.thedevstack.android.logcat.Logging;
+import de.thedevstack.conversationsplus.ConversationsPlusColors;
import de.thedevstack.conversationsplus.R;
import de.thedevstack.conversationsplus.entities.Conversation;
import de.thedevstack.conversationsplus.entities.Message;
@@ -86,7 +87,7 @@ public class MessageDetailsDialog extends AbstractAlertDialog {
break;
case Message.STATUS_SEND_FAILED:
msgStatusResId = R.string.dlg_msg_details_msg_status_failed;
- msgStatusTextView.setTextColor(getContext().getResources().getColor(R.color.error));
+ msgStatusTextView.setTextColor(ConversationsPlusColors.error());
break;
case Message.STATUS_RECEIVED:
msgStatusResId = R.string.dlg_msg_details_msg_status_received;
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/forms/FormFieldWrapper.java b/src/main/java/de/thedevstack/conversationsplus/ui/forms/FormFieldWrapper.java
index c82421a2..662d5bb5 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/forms/FormFieldWrapper.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/forms/FormFieldWrapper.java
@@ -9,6 +9,7 @@ import android.view.View;
import java.util.List;
+import de.thedevstack.conversationsplus.ConversationsPlusColors;
import de.thedevstack.conversationsplus.R;
import de.thedevstack.conversationsplus.xmpp.forms.Field;
@@ -57,7 +58,7 @@ public abstract class FormFieldWrapper {
int start = label.length();
int end = label.length() + 2;
spannableString.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), start, end, 0);
- spannableString.setSpan(new ForegroundColorSpan(context.getResources().getColor(R.color.accent)), start, end, 0);
+ spannableString.setSpan(new ForegroundColorSpan(ConversationsPlusColors.accent()), start, end, 0);
}
return spannableString;
}