Verified Commit 0156264f authored by HashikD's avatar HashikD
Browse files

Changed animation slide

parent a21d9123
......@@ -89,24 +89,9 @@ public class MainActivity extends AppCompatActivity implements MainFragmentCallb
Log.d(TAG, "startFragment: " + currentFragment);
//////Animation
Slide slideTransition;
//This defines how the fragment moves. Either from left to right or right to left.
int gravity = transitionToggle ? Gravity.END : Gravity.START;
transitionToggle = !transitionToggle;
if (Build.VERSION.SDK_INT > 21) {
slideTransition = new Slide(gravity);
} else {
slideTransition = new Slide(GravityCompat.getAbsoluteGravity(gravity, getResources().getConfiguration().getLayoutDirection()));
}
slideTransition.setDuration(400);
fragment.setEnterTransition(slideTransition);
//////
getSupportFragmentManager()
.beginTransaction()
.setCustomAnimations(R.anim.frag_entry_slide, R.anim.frag_exit_slide)
.replace(R.id.fragment_container,
fragment, Integer.toString(currentFragment)).commit();
}
......
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<translate
android:duration="@android:integer/config_mediumAnimTime"
android:fromXDelta="-100%"
android:fromYDelta="0%"
android:toXDelta="0%"
android:toYDelta="0%" />
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<translate
android:duration="@android:integer/config_mediumAnimTime"
android:fromXDelta="0%"
android:fromYDelta="0%"
android:toXDelta="100%"
android:toYDelta="0%" />
</set>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment