Clean ups.

This commit is contained in:
Karim Abou Zeid 2016-02-27 22:50:47 +01:00
commit 14516092f5
30 changed files with 133 additions and 164 deletions

View file

@ -18,17 +18,17 @@ public abstract class PhonographColoredTarget extends BitmapPaletteTarget {
@Override
public void onLoadFailed(Exception e, Drawable errorDrawable) {
super.onLoadFailed(e, errorDrawable);
onColorReady(getDefaultBarColor());
onColorReady(getDefaultFooterColor());
}
@Override
public void onResourceReady(BitmapPaletteWrapper resource, GlideAnimation<? super BitmapPaletteWrapper> glideAnimation) {
super.onResourceReady(resource, glideAnimation);
onColorReady(PhonographColorUtil.getColor(resource.getPalette(), getDefaultBarColor()));
onColorReady(PhonographColorUtil.getColor(resource.getPalette(), getDefaultFooterColor()));
}
protected int getDefaultBarColor() {
return ATHUtil.resolveColor(getView().getContext(), R.attr.default_bar_color);
protected int getDefaultFooterColor() {
return ATHUtil.resolveColor(getView().getContext(), R.attr.defaultFooterColor);
}
public abstract void onColorReady(int color);