Search in sources :

Example 1 with LVImageView

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;
}
Also used : LVImageView(com.taobao.luaview.view.LVImageView) LVImageView(com.taobao.luaview.view.LVImageView) View(android.view.View) LVRecyclerView(com.taobao.luaview.view.LVRecyclerView)

Aggregations

View (android.view.View)1 LVImageView (com.taobao.luaview.view.LVImageView)1 LVRecyclerView (com.taobao.luaview.view.LVRecyclerView)1