Task color (color of bar in recents entry) will match the palette color of the artist/album detail, now playing, and tag editor activities.
This commit is contained in:
parent
2f4ada964e
commit
0747e8837c
5 changed files with 36 additions and 1 deletions
|
|
@ -207,6 +207,7 @@ public class AlbumDetailActivity extends AbsFabActivity implements PaletteColorH
|
||||||
toolbarColor = swatch.getRgb();
|
toolbarColor = swatch.getRgb();
|
||||||
albumTitleView.setBackgroundColor(toolbarColor);
|
albumTitleView.setBackgroundColor(toolbarColor);
|
||||||
albumTitleView.setTextColor(swatch.getTitleTextColor());
|
albumTitleView.setTextColor(swatch.getTitleTextColor());
|
||||||
|
notifyTaskColorChange(toolbarColor);
|
||||||
if (Util.hasLollipopSDK() && PreferenceUtils.getInstance(AlbumDetailActivity.this).coloredNavigationBarAlbumEnabled())
|
if (Util.hasLollipopSDK() && PreferenceUtils.getInstance(AlbumDetailActivity.this).coloredNavigationBarAlbumEnabled())
|
||||||
getWindow().setNavigationBarColor(toolbarColor);
|
getWindow().setNavigationBarColor(toolbarColor);
|
||||||
}
|
}
|
||||||
|
|
@ -214,6 +215,11 @@ public class AlbumDetailActivity extends AbsFabActivity implements PaletteColorH
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean overrideTaskColor() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getPaletteColor() {
|
public int getPaletteColor() {
|
||||||
return toolbarColor;
|
return toolbarColor;
|
||||||
|
|
|
||||||
|
|
@ -302,6 +302,7 @@ public class ArtistDetailActivity extends AbsFabActivity implements PaletteColor
|
||||||
toolbarColor = swatch.getRgb();
|
toolbarColor = swatch.getRgb();
|
||||||
artistNameTv.setBackgroundColor(swatch.getRgb());
|
artistNameTv.setBackgroundColor(swatch.getRgb());
|
||||||
artistNameTv.setTextColor(swatch.getTitleTextColor());
|
artistNameTv.setTextColor(swatch.getTitleTextColor());
|
||||||
|
notifyTaskColorChange(toolbarColor);
|
||||||
if (Util.hasLollipopSDK() && PreferenceUtils.getInstance(ArtistDetailActivity.this).coloredNavigationBarArtistEnabled())
|
if (Util.hasLollipopSDK() && PreferenceUtils.getInstance(ArtistDetailActivity.this).coloredNavigationBarArtistEnabled())
|
||||||
getWindow().setNavigationBarColor(swatch.getRgb());
|
getWindow().setNavigationBarColor(swatch.getRgb());
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -311,6 +312,11 @@ public class ArtistDetailActivity extends AbsFabActivity implements PaletteColor
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean overrideTaskColor() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
|
|
||||||
|
|
@ -288,6 +288,11 @@ public class MusicControllerActivity extends AbsFabActivity {
|
||||||
songArtist.setText(song.artistName);
|
songArtist.setText(song.artistName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean overrideTaskColor() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private void setUpAlbumArtAndApplyPalette() {
|
private void setUpAlbumArtAndApplyPalette() {
|
||||||
albumArt.post(new Runnable() {
|
albumArt.post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -323,6 +328,7 @@ public class MusicControllerActivity extends AbsFabActivity {
|
||||||
animateColorChange(swatch.getRgb());
|
animateColorChange(swatch.getRgb());
|
||||||
songTitle.setTextColor(swatch.getTitleTextColor());
|
songTitle.setTextColor(swatch.getTitleTextColor());
|
||||||
songArtist.setTextColor(swatch.getBodyTextColor());
|
songArtist.setTextColor(swatch.getBodyTextColor());
|
||||||
|
notifyTaskColorChange(swatch.getRgb());
|
||||||
} else {
|
} else {
|
||||||
resetColors();
|
resetColors();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,12 +66,22 @@ public abstract class ThemeBaseActivity extends ActionBarActivity implements Kab
|
||||||
// Dark theme
|
// Dark theme
|
||||||
ThemeSingleton.get().darkTheme = PreferenceUtils.getInstance(this).getGeneralTheme() == R.style.Theme_MaterialMusic;
|
ThemeSingleton.get().darkTheme = PreferenceUtils.getInstance(this).getGeneralTheme() == R.style.Theme_MaterialMusic;
|
||||||
|
|
||||||
|
if (!overrideTaskColor()) {
|
||||||
|
notifyTaskColorChange(PreferenceUtils.getInstance(this).getThemeColorPrimary());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean overrideTaskColor() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void notifyTaskColorChange(int color) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
// Sets color of entry in the system recents page
|
// Sets color of entry in the system recents page
|
||||||
ActivityManager.TaskDescription td = new ActivityManager.TaskDescription(
|
ActivityManager.TaskDescription td = new ActivityManager.TaskDescription(
|
||||||
getString(R.string.app_name),
|
getString(R.string.app_name),
|
||||||
BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher),
|
BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher),
|
||||||
PreferenceUtils.getInstance(this).getThemeColorPrimary());
|
color);
|
||||||
setTaskDescription(td);
|
setTaskDescription(td);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -290,12 +290,14 @@ public abstract class AbsTagEditorActivity extends AbsBaseActivity {
|
||||||
private void applyPalette(final Bitmap bitmap) {
|
private void applyPalette(final Bitmap bitmap) {
|
||||||
if (bitmap != null) {
|
if (bitmap != null) {
|
||||||
Palette.generateAsync(bitmap, new Palette.PaletteAsyncListener() {
|
Palette.generateAsync(bitmap, new Palette.PaletteAsyncListener() {
|
||||||
|
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||||
@Override
|
@Override
|
||||||
public void onGenerated(Palette palette) {
|
public void onGenerated(Palette palette) {
|
||||||
final int vibrantColor = palette.getVibrantColor(DialogUtils.resolveColor(AbsTagEditorActivity.this, R.attr.default_bar_color));
|
final int vibrantColor = palette.getVibrantColor(DialogUtils.resolveColor(AbsTagEditorActivity.this, R.attr.default_bar_color));
|
||||||
paletteColorPrimary = vibrantColor;
|
paletteColorPrimary = vibrantColor;
|
||||||
observableScrollViewCallbacks.onScrollChanged(scrollView.getCurrentScrollY(), false, false);
|
observableScrollViewCallbacks.onScrollChanged(scrollView.getCurrentScrollY(), false, false);
|
||||||
setStatusBarColor(ColorChooserDialog.shiftColorDown(vibrantColor), false);
|
setStatusBarColor(ColorChooserDialog.shiftColorDown(vibrantColor), false);
|
||||||
|
notifyTaskColorChange(paletteColorPrimary);
|
||||||
if (Util.hasLollipopSDK() && PreferenceUtils.getInstance(AbsTagEditorActivity.this).coloredNavigationBarTagEditorEnabled())
|
if (Util.hasLollipopSDK() && PreferenceUtils.getInstance(AbsTagEditorActivity.this).coloredNavigationBarTagEditorEnabled())
|
||||||
getWindow().setNavigationBarColor(vibrantColor);
|
getWindow().setNavigationBarColor(vibrantColor);
|
||||||
}
|
}
|
||||||
|
|
@ -305,6 +307,11 @@ public abstract class AbsTagEditorActivity extends AbsBaseActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean overrideTaskColor() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
protected void writeValuesToFiles(final Map<FieldKey, String> fieldKeyValueMap) {
|
protected void writeValuesToFiles(final Map<FieldKey, String> fieldKeyValueMap) {
|
||||||
writeValuesToFiles(fieldKeyValueMap, null, false);
|
writeValuesToFiles(fieldKeyValueMap, null, false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue