Clean ups
This commit is contained in:
parent
62a84454ff
commit
44ba560d77
28 changed files with 243 additions and 422 deletions
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue