当解析的出的style中包含了 transform 属性时,绑定的Component就会对动画执行单独处理
Transform设置
具体位置:GraphicActionAbstractAddElement#createComponent
//动画的处理if(mStyle != null && mStyle.containsKey(Constants.Name.TRANSFORM) && component.getTransition() == null) {Map<String, Object> animationMap = new ArrayMap<>(2);//记录js中transform的值,真正动画的执行的数组,如[rotate(-90deg) scale(1.2)]animationMap.put(Constants.Name.TRANSFORM, mStyle.get(Constants.Name.TRANSFORM));//js中transformOrigin对应的值,一般是 left,top,right,bottom 就是动画执行时的锚点animationMap.put(Constants.Name.TRANSFORM_ORIGIN, mStyle.get(Constants.Name.TRANSFORM_ORIGIN));component.addAnimationForElement(animationMap);}
�Transition设置
具体位置GraphicActionCreateBody#构造函数
/*** Style中* transition-property: right, left, top, bottom, width, height, backgroundColor, opacity, transform;* transition-duration: 0.5s;* transition-delay: 0s;* transition-timing-function: cubic-bezier(0.58, 0.1, 0.42, 1.0);* 这些属性的配置,当只有全部配置transition-property属性时,做相应的动画才不会那么突兀,否则都是瞬间变化,无过程可言* 具体可以参考 vue/examples/transition.vue 的使用明细*/component.setTransition(WXTransition.fromMap(component.getStyles(), component));
�
