use of com.afollestad.aesthetic.ColorIsDarkState in project Shuttle by timusus.
the class PlayerFragment method invalidateColors.
void invalidateColors(ColorSet colorSet) {
boolean ignorePalette = false;
if (!settingsManager.getUsePalette() && !settingsManager.getUsePaletteNowPlayingOnly()) {
// If we're not using Palette at all, use non-tinted colors for text.
colorSet.setPrimaryTextColorTinted(colorSet.getPrimaryTextColor());
colorSet.setSecondaryTextColorTinted(colorSet.getSecondaryTextColor());
ignorePalette = true;
}
if (!isLandscape && backgroundView != null) {
backgroundView.setBackgroundColor(colorSet.getPrimaryColor());
}
if (!isLandscape && currentTime != null) {
currentTime.setTextColor(colorSet.getPrimaryTextColor());
}
if (!isLandscape && totalTime != null) {
totalTime.setTextColor(colorSet.getPrimaryTextColor());
}
if (track != null) {
track.setTextColor(colorSet.getPrimaryTextColorTinted());
}
if (album != null) {
album.setTextColor(colorSet.getSecondaryTextColorTinted());
}
if (artist != null) {
artist.setTextColor(colorSet.getSecondaryTextColorTinted());
}
if (seekBar != null) {
seekBar.invalidateColors(new ColorIsDarkState(ignorePalette ? colorSet.getAccentColor() : colorSet.getPrimaryTextColorTinted(), false));
}
if (shuffleButton != null) {
shuffleButton.invalidateColors(colorSet.getPrimaryTextColor(), colorSet.getPrimaryTextColorTinted());
}
if (repeatButton != null) {
repeatButton.invalidateColors(colorSet.getPrimaryTextColor(), colorSet.getPrimaryTextColorTinted());
}
if (prevButton != null) {
prevButton.invalidateColors(colorSet.getPrimaryTextColor());
}
if (nextButton != null) {
nextButton.invalidateColors(colorSet.getPrimaryTextColor());
}
if (playPauseView != null) {
playPauseView.setDrawableColor(colorSet.getPrimaryTextColor());
}
this.colorSet = colorSet;
}
use of com.afollestad.aesthetic.ColorIsDarkState in project Shuttle by timusus.
the class CustomCheckbox method onAttachedToWindow.
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
subscriptions = new CompositeDisposable();
// noinspection ConstantConditions
subscriptions.add(Observable.combineLatest(ViewUtil.getObservableForResId(getContext(), backgroundResId, Aesthetic.get(getContext()).colorAccent()), Aesthetic.get(getContext()).isDark(), ColorIsDarkState.creator()).compose(Rx.<ColorIsDarkState>distinctToMainThread()).subscribe(colorIsDarkState -> invalidateColors(colorIsDarkState), onErrorLogAndRethrow()));
ViewTextColorAction.create(this).accept(Color.BLACK);
}
Aggregations