fix: img::tint

This commit is contained in:
hyb1996 2018-10-13 13:42:44 +08:00
parent 67775055c1
commit ac889ceff6

View File

@ -48,7 +48,9 @@ public class ImageViewAttributes extends ViewAttributes {
getDrawables().setupWithImage(getView(), value)
);
registerAttr("tint", Color::parseColor, value -> {
ImageViewCompat.setImageTintList(getView(), ColorStateList.valueOf(value));
// FIXME: 2018/10/13 setImageTineList not working
PorterDuff.Mode mode = ImageViewCompat.getImageTintMode(getView());
getView().setColorFilter(value, mode == null ? PorterDuff.Mode.SRC_ATOP : mode);
});
registerAttr("tintMode", TINT_MODES::get, value -> {
ImageViewCompat.setImageTintMode(getView(), value);