use of com.taobao.luaview.view.LVImageView in project LuaViewSDK by alibaba.
the class UDView method setEffects.
private UDView setEffects(Integer effects, Varargs varargs) {
final View view = getView();
if (view != null) {
this.mEffects = effects;
if (effects != null) {
switch(effects) {
case UDViewEffect.EFFECT_NONE:
ForegroundDelegate.clearForeground(view);
break;
case UDViewEffect.EFFECT_CLICK:
final Integer color = ColorUtil.parse(LuaUtil.getValue(varargs, 3));
final Integer alpha = LuaUtil.getAlphaInt(LuaUtil.getValue(varargs, 4));
ForegroundDelegate.setupDefaultForeground(view, color, alpha);
break;
case UDViewEffect.EFFECT_PARALLAX:
int deltaX = DimenUtil.dpiToPx(LuaUtil.getFloat(varargs, 0f, 3));
int deltaY = DimenUtil.dpiToPx(LuaUtil.getFloat(varargs, 0f, 4));
((LVImageView) view).setMotionDistanceXY(deltaX, deltaY);
break;
}
}
}
return this;
}
Aggregations