From ce617fb7cb173a360b71d1641613b085f38691a0 Mon Sep 17 00:00:00 2001 From: agrajaghh Date: Fri, 13 Nov 2015 00:48:03 +0100 Subject: [PATCH] hide irrelevant preferences in RecipientPreferenceActivity fixes #4505 Closes #4509 //FREEBIE --- .../securesms/RecipientPreferenceActivity.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/org/thoughtcrime/securesms/RecipientPreferenceActivity.java b/src/org/thoughtcrime/securesms/RecipientPreferenceActivity.java index 1a3dfe9644..b5f4245680 100644 --- a/src/org/thoughtcrime/securesms/RecipientPreferenceActivity.java +++ b/src/org/thoughtcrime/securesms/RecipientPreferenceActivity.java @@ -219,16 +219,13 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi vibratePreference.setValueIndex(2); } - colorPreference.setEnabled(recipients.isSingleRecipient() && !recipients.isGroupRecipient()); - colorPreference.setChoices(MaterialColors.CONVERSATION_PALETTE.asConversationColorArray(getActivity())); - colorPreference.setValue(recipients.getColor().toActionBarColor(getActivity())); - if (!recipients.isSingleRecipient() || recipients.isGroupRecipient()) { - blockPreference.setEnabled(false); - identityPreference.setEnabled(false); + this.getPreferenceScreen().removePreference(colorPreference); + this.getPreferenceScreen().removePreference(blockPreference); + this.getPreferenceScreen().removePreference(identityPreference); } else { - blockPreference.setEnabled(true); - identityPreference.setEnabled(true); + colorPreference.setChoices(MaterialColors.CONVERSATION_PALETTE.asConversationColorArray(getActivity())); + colorPreference.setValue(recipients.getColor().toActionBarColor(getActivity())); if (recipients.isBlocked()) blockPreference.setTitle(R.string.RecipientPreferenceActivity_unblock); else blockPreference.setTitle(R.string.RecipientPreferenceActivity_block);