kopia lustrzana https://github.com/ryukoposting/Signal-Android
Update logic for color selection to match spec.
rodzic
1d6d27d46c
commit
8992f59c3b
|
@ -32,6 +32,7 @@ import org.thoughtcrime.securesms.database.RecipientDatabase.MentionSetting;
|
||||||
import org.thoughtcrime.securesms.database.RecipientDatabase.RegisteredState;
|
import org.thoughtcrime.securesms.database.RecipientDatabase.RegisteredState;
|
||||||
import org.thoughtcrime.securesms.database.RecipientDatabase.UnidentifiedAccessMode;
|
import org.thoughtcrime.securesms.database.RecipientDatabase.UnidentifiedAccessMode;
|
||||||
import org.thoughtcrime.securesms.database.RecipientDatabase.VibrateState;
|
import org.thoughtcrime.securesms.database.RecipientDatabase.VibrateState;
|
||||||
|
import org.thoughtcrime.securesms.database.model.databaseprotos.ChatColor;
|
||||||
import org.thoughtcrime.securesms.database.model.databaseprotos.RecipientExtras;
|
import org.thoughtcrime.securesms.database.model.databaseprotos.RecipientExtras;
|
||||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||||
import org.thoughtcrime.securesms.groups.GroupId;
|
import org.thoughtcrime.securesms.groups.GroupId;
|
||||||
|
@ -910,21 +911,22 @@ public class Recipient {
|
||||||
}
|
}
|
||||||
|
|
||||||
public @NonNull ChatColors getChatColors() {
|
public @NonNull ChatColors getChatColors() {
|
||||||
if (chatColors != null && chatColors.getId() instanceof ChatColors.Id.Auto) {
|
if (chatColors != null && chatColors.getId() instanceof ChatColors.Id.Custom) {
|
||||||
return getAutoChatColor();
|
|
||||||
} else if (chatColors != null) {
|
|
||||||
return chatColors;
|
return chatColors;
|
||||||
} else if (SignalStore.chatColorsValues().hasChatColors()) {
|
} if (chatColors != null && chatColors.getId() instanceof ChatColors.Id.Auto) {
|
||||||
return Objects.requireNonNull(SignalStore.chatColorsValues().getChatColors());
|
return getAutoChatColor();
|
||||||
|
} else {
|
||||||
|
ChatColors global = SignalStore.chatColorsValues().getChatColors();
|
||||||
|
if (global != null && global.getId() instanceof ChatColors.Id.Custom) {
|
||||||
|
return global;
|
||||||
} else {
|
} else {
|
||||||
return getAutoChatColor();
|
return getAutoChatColor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private @NonNull ChatColors getAutoChatColor() {
|
private @NonNull ChatColors getAutoChatColor() {
|
||||||
if (wallpaper != null) {
|
if (getWallpaper() != null) {
|
||||||
return wallpaper.getAutoChatColors();
|
|
||||||
} else if (getWallpaper() != null) {
|
|
||||||
return getWallpaper().getAutoChatColors();
|
return getWallpaper().getAutoChatColors();
|
||||||
} else {
|
} else {
|
||||||
return ChatColorsPalette.Bubbles.getDefault().withId(ChatColors.Id.Auto.INSTANCE);
|
return ChatColorsPalette.Bubbles.getDefault().withId(ChatColors.Id.Auto.INSTANCE);
|
||||||
|
|
Ładowanie…
Reference in New Issue