Remove the ability to set a color for a group.
No longer applicable given that we're adding back per-person colors in groups.
This commit is contained in:
parent
710fa4a6f0
commit
275ca9e3ba
4 changed files with 14 additions and 12 deletions
|
@ -47,4 +47,8 @@
|
||||||
<color name="conversation_steel">#6b6b78</color>
|
<color name="conversation_steel">#6b6b78</color>
|
||||||
<color name="conversation_steel_tint">#bebec6</color>
|
<color name="conversation_steel_tint">#bebec6</color>
|
||||||
<color name="conversation_steel_shade">#5a5a63</color>
|
<color name="conversation_steel_shade">#5a5a63</color>
|
||||||
|
|
||||||
|
<color name="conversation_group">@color/textsecure_primary</color>
|
||||||
|
<color name="conversation_group_tint">@color/textsecure_primary</color>
|
||||||
|
<color name="conversation_group_shade">@color/textsecure_primary_dark</color>
|
||||||
</resources>
|
</resources>
|
|
@ -54,7 +54,6 @@ import org.thoughtcrime.securesms.database.RecipientDatabase.VibrateState;
|
||||||
import org.thoughtcrime.securesms.database.loaders.ThreadMediaLoader;
|
import org.thoughtcrime.securesms.database.loaders.ThreadMediaLoader;
|
||||||
import org.thoughtcrime.securesms.jobs.MultiDeviceBlockedUpdateJob;
|
import org.thoughtcrime.securesms.jobs.MultiDeviceBlockedUpdateJob;
|
||||||
import org.thoughtcrime.securesms.jobs.MultiDeviceContactUpdateJob;
|
import org.thoughtcrime.securesms.jobs.MultiDeviceContactUpdateJob;
|
||||||
import org.thoughtcrime.securesms.jobs.MultiDeviceGroupUpdateJob;
|
|
||||||
import org.thoughtcrime.securesms.mms.GlideApp;
|
import org.thoughtcrime.securesms.mms.GlideApp;
|
||||||
import org.thoughtcrime.securesms.mms.GlideRequests;
|
import org.thoughtcrime.securesms.mms.GlideRequests;
|
||||||
import org.thoughtcrime.securesms.mms.OutgoingGroupMediaMessage;
|
import org.thoughtcrime.securesms.mms.OutgoingGroupMediaMessage;
|
||||||
|
@ -381,14 +380,15 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
|
||||||
vibrateCallPreference.setSummary(vibrateCallSummary.first);
|
vibrateCallPreference.setSummary(vibrateCallSummary.first);
|
||||||
vibrateCallPreference.setValueIndex(vibrateCallSummary.second);
|
vibrateCallPreference.setValueIndex(vibrateCallSummary.second);
|
||||||
|
|
||||||
colorPreference.setColors(MaterialColors.CONVERSATION_PALETTE.asConversationColorArray(getActivity()));
|
|
||||||
colorPreference.setColor(recipient.getColor().toActionBarColor(getActivity()));
|
|
||||||
|
|
||||||
if (recipient.isGroupRecipient()) {
|
if (recipient.isGroupRecipient()) {
|
||||||
|
if (colorPreference != null) colorPreference.setVisible(false);
|
||||||
if (identityPreference != null) identityPreference.setVisible(false);
|
if (identityPreference != null) identityPreference.setVisible(false);
|
||||||
if (aboutCategory != null) getPreferenceScreen().removePreference(aboutCategory);
|
if (aboutCategory != null) getPreferenceScreen().removePreference(aboutCategory);
|
||||||
if (aboutDivider != null) getPreferenceScreen().removePreference(aboutDivider);
|
if (aboutDivider != null) getPreferenceScreen().removePreference(aboutDivider);
|
||||||
} else {
|
} else {
|
||||||
|
colorPreference.setColors(MaterialColors.CONVERSATION_PALETTE.asConversationColorArray(getActivity()));
|
||||||
|
colorPreference.setColor(recipient.getColor().toActionBarColor(getActivity()));
|
||||||
|
|
||||||
aboutPreference.setTitle(formatAddress(recipient.getAddress()));
|
aboutPreference.setTitle(formatAddress(recipient.getAddress()));
|
||||||
aboutPreference.setSummary(recipient.getCustomLabel());
|
aboutPreference.setSummary(recipient.getCustomLabel());
|
||||||
aboutPreference.setSecure(recipient.getRegistered() == RecipientDatabase.RegisteredState.REGISTERED);
|
aboutPreference.setSecure(recipient.getRegistered() == RecipientDatabase.RegisteredState.REGISTERED);
|
||||||
|
@ -583,11 +583,7 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
|
||||||
protected Void doInBackground(Void... params) {
|
protected Void doInBackground(Void... params) {
|
||||||
DatabaseFactory.getRecipientDatabase(context).setColor(recipient, selectedColor);
|
DatabaseFactory.getRecipientDatabase(context).setColor(recipient, selectedColor);
|
||||||
|
|
||||||
if (recipient.resolve().isGroupRecipient()) {
|
if (recipient.resolve().getRegistered() == RecipientDatabase.RegisteredState.REGISTERED) {
|
||||||
ApplicationContext.getInstance(context)
|
|
||||||
.getJobManager()
|
|
||||||
.add(new MultiDeviceGroupUpdateJob(context));
|
|
||||||
} else if (recipient.resolve().getRegistered() == RecipientDatabase.RegisteredState.REGISTERED) {
|
|
||||||
ApplicationContext.getInstance(context)
|
ApplicationContext.getInstance(context)
|
||||||
.getJobManager()
|
.getJobManager()
|
||||||
.add(new MultiDeviceContactUpdateJob(context, recipient.getAddress()));
|
.add(new MultiDeviceContactUpdateJob(context, recipient.getAddress()));
|
||||||
|
|
|
@ -25,7 +25,8 @@ public enum MaterialColor {
|
||||||
VIOLET (R.color.conversation_violet, R.color.conversation_violet_tint, R.color.conversation_violet_shade, "purple"),
|
VIOLET (R.color.conversation_violet, R.color.conversation_violet_tint, R.color.conversation_violet_shade, "purple"),
|
||||||
PLUM (R.color.conversation_plumb, R.color.conversation_plumb_tint, R.color.conversation_plumb_shade, "pink"),
|
PLUM (R.color.conversation_plumb, R.color.conversation_plumb_tint, R.color.conversation_plumb_shade, "pink"),
|
||||||
TAUPE (R.color.conversation_taupe, R.color.conversation_taupe_tint, R.color.conversation_taupe_shade, "blue_grey"),
|
TAUPE (R.color.conversation_taupe, R.color.conversation_taupe_tint, R.color.conversation_taupe_shade, "blue_grey"),
|
||||||
STEEL (R.color.conversation_steel, R.color.conversation_steel_tint, R.color.conversation_steel_shade, "grey");
|
STEEL (R.color.conversation_steel, R.color.conversation_steel_tint, R.color.conversation_steel_shade, "grey"),
|
||||||
|
GROUP (R.color.conversation_group, R.color.conversation_group_tint, R.color.conversation_group_shade, "blue");
|
||||||
|
|
||||||
private static final Map<String, MaterialColor> COLOR_MATCHES = new HashMap<String, MaterialColor>() {{
|
private static final Map<String, MaterialColor> COLOR_MATCHES = new HashMap<String, MaterialColor>() {{
|
||||||
put("red", CRIMSON);
|
put("red", CRIMSON);
|
||||||
|
@ -47,7 +48,7 @@ public enum MaterialColor {
|
||||||
put("lime", WINTERGREEN);
|
put("lime", WINTERGREEN);
|
||||||
put("blue_grey", TAUPE);
|
put("blue_grey", TAUPE);
|
||||||
put("grey", STEEL);
|
put("grey", STEEL);
|
||||||
put("group_color", BLUE);
|
put("group_color", GROUP);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
private final @ColorRes int mainColor;
|
private final @ColorRes int mainColor;
|
||||||
|
|
|
@ -292,7 +292,8 @@ public class Recipient implements RecipientModifiedListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized @NonNull MaterialColor getColor() {
|
public synchronized @NonNull MaterialColor getColor() {
|
||||||
if (color != null) return color;
|
if (isGroupRecipient()) return MaterialColor.GROUP;
|
||||||
|
else if (color != null) return color;
|
||||||
else if (name != null) return ContactColors.generateFor(name);
|
else if (name != null) return ContactColors.generateFor(name);
|
||||||
else return ContactColors.UNKNOWN_COLOR;
|
else return ContactColors.UNKNOWN_COLOR;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue