Added colored notification (as an option). Relabeled some vars.

This commit is contained in:
Karim Abou Zeid 2015-06-15 23:37:13 +02:00
commit 554bc25f83
15 changed files with 55 additions and 41 deletions

View file

@ -118,7 +118,7 @@ public class AlbumDetailActivity extends AbsFabActivity implements PaletteColorH
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
postponeEnterTransition();
if (PreferenceUtils.getInstance(this).coloredNavigationBarAlbumEnabled())
if (PreferenceUtils.getInstance(this).coloredNavigationBarAlbum())
setNavigationBarColor(DialogUtils.resolveColor(this, R.attr.default_bar_color));
}
@ -236,7 +236,7 @@ public class AlbumDetailActivity extends AbsFabActivity implements PaletteColorH
toolbarColor = vibrantSwatch.getRgb();
albumTitleView.setBackgroundColor(toolbarColor);
albumTitleView.setTextColor(Util.getOpaqueColor(vibrantSwatch.getTitleTextColor()));
if (Util.isAtLeastLollipop() && PreferenceUtils.getInstance(AlbumDetailActivity.this).coloredNavigationBarAlbumEnabled())
if (Util.isAtLeastLollipop() && PreferenceUtils.getInstance(AlbumDetailActivity.this).coloredNavigationBarAlbum())
setNavigationBarColor(toolbarColor);
notifyTaskColorChange(toolbarColor);
} else {
@ -258,7 +258,7 @@ public class AlbumDetailActivity extends AbsFabActivity implements PaletteColorH
albumTitleView.setBackgroundColor(defaultBarColor);
albumTitleView.setTextColor(titleTextColor);
if (Util.isAtLeastLollipop() && PreferenceUtils.getInstance(this).coloredNavigationBarArtistEnabled())
if (Util.isAtLeastLollipop() && PreferenceUtils.getInstance(this).coloredNavigationBarArtist())
setNavigationBarColor(DialogUtils.resolveColor(this, R.attr.default_bar_color));
notifyTaskColorChange(toolbarColor);

View file

@ -132,7 +132,7 @@ public class ArtistDetailActivity extends AbsFabActivity implements PaletteColor
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
postponeEnterTransition();
if (PreferenceUtils.getInstance(this).coloredNavigationBarArtistEnabled())
if (PreferenceUtils.getInstance(this).coloredNavigationBarArtist())
setNavigationBarColor(DialogUtils.resolveColor(this, R.attr.default_bar_color));
}
@ -317,7 +317,7 @@ public class ArtistDetailActivity extends AbsFabActivity implements PaletteColor
toolbarColor = vibrantSwatch.getRgb();
artistNameTv.setBackgroundColor(vibrantSwatch.getRgb());
artistNameTv.setTextColor(Util.getOpaqueColor(vibrantSwatch.getTitleTextColor()));
if (Util.isAtLeastLollipop() && PreferenceUtils.getInstance(ArtistDetailActivity.this).coloredNavigationBarArtistEnabled())
if (Util.isAtLeastLollipop() && PreferenceUtils.getInstance(ArtistDetailActivity.this).coloredNavigationBarArtist())
setNavigationBarColor(vibrantSwatch.getRgb());
notifyTaskColorChange(toolbarColor);
} else {
@ -356,7 +356,7 @@ public class ArtistDetailActivity extends AbsFabActivity implements PaletteColor
artistNameTv.setBackgroundColor(defaultBarColor);
artistNameTv.setTextColor(titleTextColor);
if (Util.isAtLeastLollipop() && PreferenceUtils.getInstance(this).coloredNavigationBarArtistEnabled())
if (Util.isAtLeastLollipop() && PreferenceUtils.getInstance(this).coloredNavigationBarArtist())
setNavigationBarColor(DialogUtils.resolveColor(this, R.attr.default_bar_color));
notifyTaskColorChange(toolbarColor);

View file

@ -88,7 +88,7 @@ public class MainActivity extends AbsFabActivity
setUpToolbar();
setUpViewPager();
if (PreferenceUtils.getInstance(this).coloredNavigationBarOtherScreensEnabled())
if (PreferenceUtils.getInstance(this).coloredNavigationBarOtherScreens())
setNavigationBarThemeColor();
handlePlaybackIntent(getIntent());

View file

@ -417,7 +417,7 @@ public class MusicControllerActivity extends AbsFabActivity {
if (opaqueStatusBar) setStatusBarColor(newColor);
else setStatusBarColor(Color.TRANSPARENT);
if (Util.isAtLeastLollipop() && PreferenceUtils.getInstance(this).coloredNavigationBarCurrentPlayingEnabled())
if (Util.isAtLeastLollipop() && PreferenceUtils.getInstance(this).coloredNavigationBarCurrentPlaying())
setNavigationBarColor(newColor);
lastFooterColor = newColor;
}

View file

@ -77,7 +77,7 @@ public class PlaylistDetailActivity extends AbsFabActivity implements CabHolder
getSupportActionBar().setTitle(playlist.name);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
if (PreferenceUtils.getInstance(this).coloredNavigationBarPlaylistEnabled())
if (PreferenceUtils.getInstance(this).coloredNavigationBarPlaylist())
setNavigationBarThemeColor();
setStatusBarThemeColor();

View file

@ -41,7 +41,7 @@ public class SettingsActivity extends AbsBaseActivity implements ColorChooserDia
if (savedInstanceState == null)
getFragmentManager().beginTransaction().replace(R.id.content_frame, new SettingsFragment()).commit();
if (PreferenceUtils.getInstance(this).coloredNavigationBarOtherScreensEnabled())
if (PreferenceUtils.getInstance(this).coloredNavigationBarOtherScreens())
setNavigationBarThemeColor();
setStatusBarThemeColor();
}
@ -136,6 +136,13 @@ public class SettingsActivity extends AbsBaseActivity implements ColorChooserDia
});
}
Preference coloredNotification = findPreference("colored_notification");
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
coloredNotification.setEnabled(false);
coloredNotification.setWidgetLayoutResource(0);
coloredNotification.setSummary(R.string.pref_only_lollipop);
}
equalizer = findPreference("equalizer");
resolveEqualizer();
equalizer.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {

View file

@ -193,7 +193,7 @@ public abstract class AbsTagEditorActivity extends AbsBaseActivity {
paletteColorPrimary = primaryColor;
observableScrollViewCallbacks.onScrollChanged(scrollView.getCurrentScrollY(), false, false);
setStatusBarColor(paletteColorPrimary);
if (Util.isAtLeastLollipop() && PreferenceUtils.getInstance(this).coloredNavigationBarTagEditorEnabled())
if (Util.isAtLeastLollipop() && PreferenceUtils.getInstance(this).coloredNavigationBarTagEditor())
setNavigationBarColor(paletteColorPrimary);
header.setBackgroundColor(paletteColorPrimary);
notifyTaskColorChange(paletteColorPrimary);
@ -246,7 +246,7 @@ public abstract class AbsTagEditorActivity extends AbsBaseActivity {
header.setBackgroundColor(paletteColorPrimary);
setStatusBarColor(paletteColorPrimary);
if (PreferenceUtils.getInstance(this).coloredNavigationBarTagEditorEnabled())
if (PreferenceUtils.getInstance(this).coloredNavigationBarTagEditor())
setNavigationBarColor(paletteColorPrimary);
}
@ -289,7 +289,7 @@ public abstract class AbsTagEditorActivity extends AbsBaseActivity {
paletteColorPrimary = vibrantColor;
observableScrollViewCallbacks.onScrollChanged(scrollView.getCurrentScrollY(), false, false);
setStatusBarColor(paletteColorPrimary);
if (Util.isAtLeastLollipop() && PreferenceUtils.getInstance(AbsTagEditorActivity.this).coloredNavigationBarTagEditorEnabled())
if (Util.isAtLeastLollipop() && PreferenceUtils.getInstance(AbsTagEditorActivity.this).coloredNavigationBarTagEditor())
setNavigationBarColor(paletteColorPrimary);
header.setBackgroundColor(paletteColorPrimary);
notifyTaskColorChange(paletteColorPrimary);