1

I am relatively new to animations in android, I tried to add transaction animations to fragments, they look and feel good. I made slide in and out animations. The problem is you can click the buttons while animation is in progress. How can I make sure user can't click new screens buttons until animation is done? Thanks.

fragmentTransaction.setCustomAnimations(R.anim.enter_from_right,R.anim.exit_to_left);
            fragmentTransaction.replace(R.id.frame_container, new LoginFragment());

enter_from_right.xml:

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:shareInterpolator="false">
    <translate
        android:fromXDelta="100%" android:toXDelta="0%"
        android:fromYDelta="0%" android:toYDelta="0%"
        android:duration="700" />
</set>

exit_to_left.xml:

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:shareInterpolator="false">
    <translate
        android:fromXDelta="0%" android:toXDelta="-100%"
        android:fromYDelta="0%" android:toYDelta="0%"
        android:duration="700"/>
</set>
yigitserin
  • 573
  • 2
  • 6
  • 24
  • This may help http://stackoverflow.com/questions/11120372/performing-action-after-fragment-transaction-animation-is-finished – QuantumTiger Dec 16 '15 at 15:12

0 Answers0