Correctly avoid displaying about category in groups

Fixes #7702
This commit is contained in:
Moxie Marlinspike 2018-04-19 10:53:37 -07:00
parent 2ac0179d65
commit 8452fc6c58
2 changed files with 5 additions and 3 deletions

View File

@ -6,7 +6,7 @@
<org.thoughtcrime.securesms.preferences.widgets.ContactPreference android:key="pref_key_number" android:persistent="false"/>
</PreferenceCategory>
<PreferenceCategory android:layout="@layout/preference_divider"/>
<PreferenceCategory android:key="about_divider" android:layout="@layout/preference_divider"/>
<PreferenceCategory android:key="notification_settings" android:title="@string/recipient_preferences__chat_settings">
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
@ -43,7 +43,7 @@
<PreferenceCategory android:layout="@layout/preference_divider"/>
<PreferenceCategory android:title="@string/recipient_preferences__call_settings">
<PreferenceCategory android:key="call_settings" android:title="@string/recipient_preferences__call_settings">
<org.thoughtcrime.securesms.preferences.widgets.SignalPreference
android:key="pref_key_recipient_call_ringtone"

View File

@ -328,6 +328,7 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
Preference blockPreference = this.findPreference(PREFERENCE_BLOCK);
Preference identityPreference = this.findPreference(PREFERENCE_IDENTITY);
PreferenceCategory aboutCategory = (PreferenceCategory)this.findPreference("about");
PreferenceCategory aboutDivider = (PreferenceCategory)this.findPreference("about_divider");
ContactPreference aboutPreference = (ContactPreference)this.findPreference(PREFERENCE_ABOUT);
PreferenceCategory privacyCategory = (PreferenceCategory) this.findPreference("privacy_settings");
PreferenceCategory divider = (PreferenceCategory) this.findPreference("divider");
@ -352,7 +353,8 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
if (identityPreference != null) identityPreference.setVisible(false);
if (privacyCategory != null) privacyCategory.setVisible(false);
if (divider != null) divider.setVisible(false);
if (aboutCategory != null) aboutCategory.setVisible(false);
if (aboutCategory != null) getPreferenceScreen().removePreference(aboutCategory);
if (aboutDivider != null) getPreferenceScreen().removePreference(aboutDivider);
} else {
colorPreference.setColors(MaterialColors.CONVERSATION_PALETTE.asConversationColorArray(getActivity()));
colorPreference.setColor(recipient.getColor().toActionBarColor(getActivity()));