aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/XmppActivity.java66
1 files changed, 10 insertions, 56 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
index 2568e4b9..880641b9 100644
--- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
+++ b/src/main/java/eu/siacs/conversations/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;
@@ -104,16 +105,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;
@@ -361,15 +352,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();
@@ -750,30 +732,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;
}
@@ -783,7 +765,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));
@@ -945,34 +927,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));