From 2f27378f1635fad2501b30e4080100418a00e193 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 26 Jan 2020 20:18:13 +0100 Subject: use more material style --- src/main/java/de/pixart/messenger/ui/XmppActivity.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/main/java/de/pixart/messenger/ui/XmppActivity.java') diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java index e1abbe593..ac2289d92 100644 --- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java +++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java @@ -114,6 +114,8 @@ public abstract class XmppActivity extends ActionBarActivity { public boolean xmppConnectionServiceBound = false; protected int mColorWarningButton; + protected int mColorWarningText; + protected int mColorDefaultButtonText; protected int mColorWhite; protected static final String FRAGMENT_TAG_DIALOG = "dialog"; @@ -406,9 +408,12 @@ public abstract class XmppActivity extends ActionBarActivity { this.isCameraFeatureAvailable = getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA); if (isDarkTheme()) { mColorWarningButton = ContextCompat.getColor(this, R.color.warning_button_dark); + mColorWarningText = ContextCompat.getColor(this, R.color.warning_button); } else { mColorWarningButton = ContextCompat.getColor(this, R.color.warning_button); + mColorWarningText = ContextCompat.getColor(this, R.color.warning_button_dark); } + mColorDefaultButtonText = ContextCompat.getColor(this, R.color.realwhite); mColorWhite = ContextCompat.getColor(this, R.color.white70); this.mUsingEnterKey = usingEnterKey(); } @@ -676,8 +681,7 @@ public abstract class XmppActivity extends ActionBarActivity { protected void displayErrorDialog(final int errorCode) { runOnUiThread(() -> { - Builder builder = new Builder( - XmppActivity.this); + AlertDialog.Builder builder = new AlertDialog.Builder(XmppActivity.this); builder.setIconAttribute(android.R.attr.alertDialogIcon); builder.setTitle(getString(R.string.error)); builder.setMessage(errorCode); @@ -945,6 +949,14 @@ public abstract class XmppActivity extends ActionBarActivity { return this.mColorWarningButton; } + public int getWarningTextColor() { + return this.mColorWarningText; + } + + public int getDefaultButtonTextColor() { + return this.mColorDefaultButtonText; + } + public int getPixel(int dp) { DisplayMetrics metrics = getResources().getDisplayMetrics(); return ((int) (dp * metrics.density)); -- cgit v1.2.3