@@ -64,6 +64,9 @@ public class ResideMenu extends FrameLayout{
6464 // Valid scale factor is between 0.0f and 1.0f.
6565 private float mScaleValue = 0.5f ;
6666
67+ private boolean mUse3D ;
68+ private static final int ROTATE_Y_ANGLE = 10 ;
69+
6770 public ResideMenu (Context context ) {
6871 super (context );
6972 initViews (context );
@@ -386,6 +389,11 @@ private AnimatorSet buildScaleDownAnimation(View target,float targetScaleX,float
386389 ObjectAnimator .ofFloat (target , "scaleY" , targetScaleY )
387390 );
388391
392+ if (mUse3D ) {
393+ int angle = scaleDirection == DIRECTION_LEFT ? -ROTATE_Y_ANGLE : ROTATE_Y_ANGLE ;
394+ scaleDown .playTogether (ObjectAnimator .ofFloat (target , "rotationY" , angle ));
395+ }
396+
389397 scaleDown .setInterpolator (AnimationUtils .loadInterpolator (activity ,
390398 android .R .anim .decelerate_interpolator ));
391399 scaleDown .setDuration (250 );
@@ -408,6 +416,10 @@ private AnimatorSet buildScaleUpAnimation(View target,float targetScaleX,float t
408416 ObjectAnimator .ofFloat (target , "scaleY" , targetScaleY )
409417 );
410418
419+ if (mUse3D ) {
420+ scaleUp .playTogether (ObjectAnimator .ofFloat (target , "rotationY" , 0 ));
421+ }
422+
411423 scaleUp .setDuration (250 );
412424 return scaleUp ;
413425 }
@@ -576,6 +588,10 @@ public void setScaleValue(float scaleValue) {
576588 this .mScaleValue = scaleValue ;
577589 }
578590
591+ public void setUse3D (boolean use3D ) {
592+ mUse3D = use3D ;
593+ }
594+
579595 public interface OnMenuListener {
580596
581597 /**
0 commit comments