mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-30 13:35:18 +00:00
hide irrelevant preferences in RecipientPreferenceActivity
fixes #4505 Closes #4509 //FREEBIE
This commit is contained in:
parent
43ebf829ca
commit
ce617fb7cb
@ -219,16 +219,13 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
|
|||||||
vibratePreference.setValueIndex(2);
|
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()) {
|
if (!recipients.isSingleRecipient() || recipients.isGroupRecipient()) {
|
||||||
blockPreference.setEnabled(false);
|
this.getPreferenceScreen().removePreference(colorPreference);
|
||||||
identityPreference.setEnabled(false);
|
this.getPreferenceScreen().removePreference(blockPreference);
|
||||||
|
this.getPreferenceScreen().removePreference(identityPreference);
|
||||||
} else {
|
} else {
|
||||||
blockPreference.setEnabled(true);
|
colorPreference.setChoices(MaterialColors.CONVERSATION_PALETTE.asConversationColorArray(getActivity()));
|
||||||
identityPreference.setEnabled(true);
|
colorPreference.setValue(recipients.getColor().toActionBarColor(getActivity()));
|
||||||
|
|
||||||
if (recipients.isBlocked()) blockPreference.setTitle(R.string.RecipientPreferenceActivity_unblock);
|
if (recipients.isBlocked()) blockPreference.setTitle(R.string.RecipientPreferenceActivity_unblock);
|
||||||
else blockPreference.setTitle(R.string.RecipientPreferenceActivity_block);
|
else blockPreference.setTitle(R.string.RecipientPreferenceActivity_block);
|
||||||
|
Loading…
Reference in New Issue
Block a user