Update colors for scroll-to buttons to match material3 spec.

This commit is contained in:
Alex Hart
2022-06-06 13:20:19 -03:00
parent 5080dd4c4b
commit 7010985be8
7 changed files with 18 additions and 6 deletions

View File

@@ -46,6 +46,14 @@ public final class ConversationScrollToView extends FrameLayout {
}
}
public void setWallpaperEnabled(boolean hasWallpaper) {
if (hasWallpaper) {
scrollButton.setBackgroundResource(R.drawable.scroll_to_bottom_background_wallpaper);
} else {
scrollButton.setBackgroundResource(R.drawable.scroll_to_bottom_background_normal);
}
}
public void setUnreadCountBackgroundTint(@ColorInt int tint) {
unreadCount.getBackground().setColorFilter(new SimpleColorFilter(tint));
}

View File

@@ -377,7 +377,11 @@ public class ConversationFragment extends LoggingFragment implements Multiselect
presentConversationMetadata(messageData.getMetadata());
}));
disposables.add(conversationViewModel.getWallpaper().subscribe(w -> chatWallpaper = w.orElse(null)));
disposables.add(conversationViewModel.getWallpaper().subscribe(w -> {
chatWallpaper = w.orElse(null);
scrollToBottomButton.setWallpaperEnabled(w.isPresent());
scrollToMentionButton.setWallpaperEnabled(w.isPresent());
}));
conversationViewModel.getShowMentionsButton().observe(getViewLifecycleOwner(), shouldShow -> {
if (shouldShow) {