Clean ups

This commit is contained in:
Karim Abou Zeid 2016-01-27 22:11:38 +01:00
commit 44ba560d77
28 changed files with 243 additions and 422 deletions

View file

@ -1,26 +0,0 @@
package com.kabouzeid.gramophone.misc;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.support.design.widget.FloatingActionButton;
import android.util.Property;
import com.kabouzeid.gramophone.util.ColorUtil;
/**
* @author Karim Abou Zeid (kabouzeid)
*/
public class FloatingActionButtonProperties {
public static final Property<FloatingActionButton, Integer> COLOR = new Property<FloatingActionButton, Integer>(Integer.class, "color") {
@Override
public void set(FloatingActionButton object, Integer value) {
object.setBackgroundTintList(ColorStateList.valueOf(value));
object.getDrawable().mutate().setColorFilter(ColorUtil.getPrimaryTextColorForBackground(object.getContext(), value), PorterDuff.Mode.SRC_IN);
}
@Override
public Integer get(FloatingActionButton object) {
return object.getBackgroundTintList() != null ? object.getBackgroundTintList().getDefaultColor() : 0;
}
};
}