I want to replace the fragment with animation, but it must be dynamic every time, i.e. it will start from the point where I will click on the screen, but the method fragmentTransaction.setCustomAnimationsuses a predefined animation defined in the animation folder:
fragmentTransaction.setCustomAnimations(R.anim.bounce, R.anim.bounce);
I create an object ScaleAnimationto satisfy my need:
ScaleAnimation animation = new ScaleAnimation(fromX,ToX,fromY,toY,pivitX,pivotY);
animation.setDuration(500);
fragmentTransaction.setCustomAnimationsthe method does not accept ScaleAnimation, it accepts only int. So, how to achieve dynamic animation when replacing a fragment.
source
share