with style setonnavigationitemselectedlistener google fragments bottomnavigation bottom bar android animation zoom

android - style - Zoom en la animación



com google android material bottomnavigation bottomnavigationview (3)

Estoy usando RotateAnimation para la imagen. Pero también quiero ampliar la imagen con animación. Significa que cuando mi imagen gira, la imagen también se acerca ...

¿Cómo puedo hacer zoom con la animación de rotación?


En anim xml, puedes trabajar con una escala como esta:

<scale android:pivotX="50%" android:pivotY="50%" android:fromXScale=".1" android:fromYScale=".1" android:toXScale="1.0" android:toYScale="1.0" android:duration="2000" />


Tengo una idea, espero que sea de ayuda.

AnimationSet animSet = new AnimationSet(false); RotateAnimation rotate = new RotateAnimation(0, 180); ScaleAnimation zoom = new ScaleAnimation(0, 0, 1, 1); animSet.addAnimation(rotate); animSet.addAnimation(zoom); animSet.start();

Debe cambiar los parámetros según lo necesite su aplicación.


En la animación de Zoom se llama Animación de escala.

ScaleAnimation scal=new ScaleAnimation(0, 1f, 0, 1f, Animation.RELATIVE_TO_SELF, (float)0.5,Animation.RELATIVE_TO_SELF, (float)0.5); scal.setDuration(500); scal.setFillAfter(true); ((ImageView)findViewById(R.id.logo)).setAnimation(scal);