Fix several ChatColors issues.

This commit is contained in:
Alex Hart
2021-05-26 20:06:57 -03:00
parent c794b5c2e7
commit 35930fb23a
6 changed files with 11 additions and 10 deletions

View File

@@ -1531,8 +1531,9 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
public @NonNull List<Projection> getColorizerProjections() {
List<Projection> projections = new LinkedList<>();
if (messageRecord.isOutgoing() &&
!hasNoBubble(messageRecord) &&
if (messageRecord.isOutgoing() &&
!hasNoBubble(messageRecord) &&
!messageRecord.isRemoteDelete() &&
bodyBubbleCorners != null)
{
projections.add(Projection.relativeToViewRoot(bodyBubble, bodyBubbleCorners).translateX(bodyBubble.getTranslationX()));

View File

@@ -51,7 +51,7 @@ sealed class ChatColorSelectionRepository(context: Context) {
if (wallpaper != null) {
consumer(wallpaper.autoChatColors)
} else {
consumer(ChatColorsPalette.Bubbles.default)
consumer(ChatColorsPalette.Bubbles.default.withId(ChatColors.Id.Auto))
}
}
}

View File

@@ -30,7 +30,7 @@ data class ChatColorSelectionState(
)
} else {
ChatColorMappingModel(
ChatColorsPalette.Bubbles.default,
ChatColorsPalette.Bubbles.default.withId(ChatColors.Id.Auto),
chatColors?.id == ChatColors.Id.Auto,
true
)

View File

@@ -927,7 +927,7 @@ public class Recipient {
} else if (getWallpaper() != null) {
return getWallpaper().getAutoChatColors();
} else {
return ChatColorsPalette.Bubbles.getDefault();
return ChatColorsPalette.Bubbles.getDefault().withId(ChatColors.Id.Auto.INSTANCE);
}
}

View File

@@ -116,13 +116,13 @@ public class ChatWallpaperFragment extends Fragment {
viewModel.saveWallpaperSelection();
dialog.dismiss();
})
.setNeutralButton(R.string.ChatWallpaperFragment__reset_all_wallpapers, (dialog, which) -> {
.setNegativeButton(R.string.ChatWallpaperFragment__reset_all_wallpapers, (dialog, which) -> {
viewModel.setWallpaper(null);
viewModel.setDimInDarkTheme(true);
viewModel.resetAllWallpaper();
dialog.dismiss();
})
.setNegativeButton(android.R.string.cancel, (dialog, which) -> {
.setNeutralButton(android.R.string.cancel, (dialog, which) -> {
dialog.dismiss();
})
.show();
@@ -136,11 +136,11 @@ public class ChatWallpaperFragment extends Fragment {
viewModel.clearChatColor();
dialog.dismiss();
})
.setNeutralButton(R.string.ChatWallpaperFragment__reset_all_colors, (dialog, which) -> {
.setNegativeButton(R.string.ChatWallpaperFragment__reset_all_colors, (dialog, which) -> {
viewModel.resetAllChatColors();
dialog.dismiss();
})
.setNegativeButton(android.R.string.cancel, (dialog, which) -> {
.setNeutralButton(android.R.string.cancel, (dialog, which) -> {
dialog.dismiss();
})
.show();

View File

@@ -44,7 +44,7 @@ class ChatWallpaperRepository {
} else if (SignalStore.wallpaper().hasWallpaperSet()) {
return Objects.requireNonNull(SignalStore.wallpaper().getWallpaper()).getAutoChatColors();
} else {
return ChatColorsPalette.Bubbles.getDefault();
return ChatColorsPalette.Bubbles.getDefault().withId(ChatColors.Id.Auto.INSTANCE);
}
}