aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-10-10 21:39:55 +0200
committerChristian Schneppe <christian@pix-art.de>2017-10-10 21:39:55 +0200
commitba02a92f104ce7ec1280a0c4d2ec481f797bf5ef (patch)
tree27c5426c7ded321c7d0eca066f7705cc38dc7d92 /src/main/java/de/pixart/messenger
parent21a1aa401e87c51a16ecc810c309a0cfba63c062 (diff)
use a lighter red color for 'delete contact button' and remove this action from actionbar
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java13
-rw-r--r--src/main/java/de/pixart/messenger/ui/XmppActivity.java6
2 files changed, 7 insertions, 12 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java
index 0cf8a2919..024e92b02 100644
--- a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java
@@ -6,7 +6,6 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
-import android.graphics.Color;
import android.graphics.PorterDuff;
import android.net.Uri;
import android.os.Bundle;
@@ -338,14 +337,6 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
case R.id.action_share_uri:
shareLink(false);
break;
- case R.id.action_delete_contact:
- builder.setTitle(getString(R.string.action_delete_contact))
- .setMessage(
- getString(R.string.remove_contact_text,
- contact.getDisplayJid()))
- .setPositiveButton(getString(R.string.delete),
- removeFromRoster).create().show();
- break;
case R.id.action_edit_contact:
Uri systemAccount = contact.getSystemAccount();
if (systemAccount == null) {
@@ -382,7 +373,6 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
MenuItem block = menu.findItem(R.id.action_block);
MenuItem unblock = menu.findItem(R.id.action_unblock);
MenuItem edit = menu.findItem(R.id.action_edit_contact);
- MenuItem delete = menu.findItem(R.id.action_delete_contact);
if (contact == null) {
return true;
}
@@ -399,7 +389,6 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
}
if (!contact.showInRoster()) {
edit.setVisible(false);
- delete.setVisible(false);
}
return super.onCreateOptionsMenu(menu);
}
@@ -445,7 +434,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
receive.setVisibility(View.VISIBLE);
addContactButton.setVisibility(View.VISIBLE);
addContactButton.setText(getString(R.string.action_delete_contact));
- addContactButton.getBackground().setColorFilter(Color.RED, PorterDuff.Mode.MULTIPLY);
+ addContactButton.getBackground().setColorFilter(getWarningButtonColor(), PorterDuff.Mode.MULTIPLY);
final AlertDialog.Builder deleteFromRosterDialog = new AlertDialog.Builder(ContactDetailsActivity.this);
addContactButton.setOnClickListener(new OnClickListener() {
@Override
diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
index bdf321dc3..840e29692 100644
--- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
@@ -110,6 +110,7 @@ public abstract class XmppActivity extends Activity {
protected int mPrimaryBackgroundColor;
protected int mSecondaryBackgroundColor;
protected int mColorRed;
+ protected int mColorWarningButton;
protected int mColorWhite;
protected int mColorOrange;
protected int mColorGreen;
@@ -410,6 +411,7 @@ public abstract class XmppActivity extends Activity {
mSecondaryTextColor = ContextCompat.getColor(this, R.color.black54);
mTertiaryTextColor = ContextCompat.getColor(this, R.color.black12);
mColorRed = ContextCompat.getColor(this, R.color.red800);
+ 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);
@@ -979,6 +981,10 @@ public abstract class XmppActivity extends Activity {
return this.mColorRed;
}
+ public int getWarningButtonColor() {
+ return this.mColorWarningButton;
+ }
+
public int getOnlineColor() {
return this.mColorGreen;
}