private RecyclerView.ItemDecoration parseTransforms(String raw){
  if (raw == null) {
    return null;
  }
  float scaleX=0f, scaleY=0f;
  int translateX=0, translateY=0;
  float opacity=0f;
  int rotate=0;
  Matcher matcher=transformPattern.matcher(raw);
  while (matcher.find()) {
    String match=matcher.group();
    String name=matcher.group(1);
    try {
switch (name) {
case "scale":
        scaleX=Float.parseFloat(matcher.group(2));
      scaleY=Float.parseFloat(matcher.group(3));
    break;
case "translate":
  translateX=Integer.parseInt(matcher.group(2));
translateY=Integer.parseInt(matcher.group(3));
break;
case "opacity":
opacity=Float.parseFloat(matcher.group(2));
break;
case "rotate":
rotate=Integer.parseInt(matcher.group(2));
break;
default :
WXLogUtils.e(TAG,"Invaild transform expression:" + match);
break;
}
}
 catch (NumberFormatException e) {
WXLogUtils.e("",e);
WXLogUtils.e(TAG,"Invaild transform expression:" + match);
}
}
return new TransformItemDecoration(getOrientation() == VERTICAL,opacity,translateX,translateY,rotate,scaleX,scaleY);
}

private RecyclerView . ItemDecoration parseTransforms ( String raw ) { if ( raw == null ) { return null ; } float scaleX = 0f , scaleY = 0f ; int translateX = 0 , translateY = 0 ; float opacity = 0f ; int rotate = 0 ; Matcher matcher = transformPattern . matcher ( raw ) ; while ( matcher . find ( ) ) { String match = matcher . group ( ) ; String name = matcher . group ( 1 ) ; try { switch ( name ) { case "scale" : scaleX = Float . parseFloat ( matcher . group ( 2 ) ) ; scaleY = Float . parseFloat ( matcher . group ( 3 ) ) ; break ; case "translate" : translateX = Integer . parseInt ( matcher . group ( 2 ) ) ; translateY = Integer . parseInt ( matcher . group ( 3 ) ) ; break ; case "opacity" : opacity = Float . parseFloat ( matcher . group ( 2 ) ) ; break ; case "rotate" : rotate = Integer . parseInt ( matcher . group ( 2 ) ) ; break ; default : WXLogUtils . e ( TAG , "Invaild transform expression:" + match ) ; break ; } } catch ( NumberFormatException e ) { WXLogUtils . e ( "" , e ) ; WXLogUtils . e ( TAG , "Invaild transform expression:" + match ) ; } } return new TransformItemDecoration ( getOrientation ( ) == VERTICAL , opacity , translateX , translateY , rotate , scaleX , scaleY ) ; }
these transform functions are supported : - ` scale ( x , y ) ` : scale item , x and y should be a positive float number . - ` translate ( x , y ) ` : translate item , ` x ` and ` y ` shoule be integer numbers . - ` opacity ( n ) ` : change the transparency of item , ` n ` must in ` [ 0 , 1 . 0 ] ` . - ` rotate ( n ) ` : rotate item , n is integer number .
