From 419504eaecd538561307d2b10ef08bdc3a47b137 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Wed, 2 May 2018 20:06:38 +0200 Subject: use styled colors for online/offline text --- src/main/java/de/pixart/messenger/ui/XmppActivity.java | 8 -------- src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java | 4 ++-- src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) (limited to 'src/main/java/de') diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java index 702f9a5c6..d580b05db 100644 --- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java +++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java @@ -99,8 +99,6 @@ public abstract class XmppActivity extends ActionBarActivity { protected int mColorRed; protected int mColorWarningButton; protected int mColorWhite; - protected int mColorOrange; - protected int mColorGreen; protected static final String FRAGMENT_TAG_DIALOG = "dialog"; @@ -410,8 +408,6 @@ public abstract class XmppActivity extends ActionBarActivity { mColorWarningButton = ContextCompat.getColor(this, R.color.warning_button); } mColorWhite = ContextCompat.getColor(this, R.color.white70); - mColorOrange = ContextCompat.getColor(this, R.color.orange500); - mColorGreen = ContextCompat.getColor(this, R.color.realgreen); this.mUsingEnterKey = usingEnterKey(); mUseSubject = getPreferences().getBoolean("use_subject", getResources().getBoolean(R.bool.use_subject)); } @@ -912,10 +908,6 @@ public abstract class XmppActivity extends ActionBarActivity { return this.mColorWarningButton; } - public int getOnlineColor() { - return this.mColorGreen; - } - public int getPixel(int dp) { DisplayMetrics metrics = getResources().getDisplayMetrics(); return ((int) (dp * metrics.density)); diff --git a/src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java index a7c20eb0e..4ed6a5492 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java @@ -53,14 +53,14 @@ public class AccountAdapter extends ArrayAdapter { statusView.setText(getContext().getString(account.getStatus().getReadableId())); switch (account.getStatus()) { case ONLINE: - statusView.setTextColor(activity.getOnlineColor()); + statusView.setTextColor(Color.get(activity, R.attr.TextColorOnline)); break; case DISABLED: case CONNECTING: statusView.setTextColor(Color.get(activity, android.R.attr.textColorSecondary)); break; default: - statusView.setTextColor(activity.getWarningTextColor()); + statusView.setTextColor(Color.get(activity, R.attr.TextColorError)); break; } return view; diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java index 1b0553bed..512fe989e 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java @@ -319,7 +319,7 @@ public class MessageAdapter extends ArrayAdapter implements CopyTextVie break; } if (error && type == SENT) { - viewHolder.time.setTextAppearance(getContext(), R.style.TextAppearance_Conversations_Caption_Waring); + viewHolder.time.setTextAppearance(getContext(), R.style.TextAppearance_Conversations_Caption_Warning); DownloadableFile file = activity.xmppConnectionService.getFileBackend().getFile(message); if (file.exists()) { if (activity.xmppConnectionService.mHttpConnectionManager.getAutoAcceptFileSize() >= message.getFileParams().size) { -- cgit v1.2.3