Add ultramarine as a conversation color option.

This commit is contained in:
Greyson Parrelli
2020-04-03 12:59:06 -04:00
parent 6ecd3b59fd
commit fc6b5c1d7c
8 changed files with 89 additions and 27 deletions

View File

@@ -413,10 +413,18 @@ public class Recipient {
}
public @NonNull MaterialColor getColor() {
if (isGroupInternal()) return MaterialColor.GROUP;
else if (color != null) return color;
else if (name != null) return ContactColors.generateFor(name);
else return ContactColors.UNKNOWN_COLOR;
if (isGroupInternal()) {
return MaterialColor.GROUP;
} else if (color != null) {
return color;
} else if (name != null) {
Log.i(TAG, "Saving color for " + id);
MaterialColor color = ContactColors.generateFor(name);
DatabaseFactory.getRecipientDatabase(ApplicationDependencies.getApplication()).setColor(id, color);
return color;
} else {
return ContactColors.UNKNOWN_COLOR;
}
}
public @NonNull Optional<UUID> getUuid() {