I am replacing a fragment A with a fragment B and animating this. Fragment B has a RelativeLayout
with a TextView
and a ListView
. What I could see is that the views in fragment B are being animated separately, the TextView
slides in with a different velocity than the list item 1 subtitle, while list item 1 title and icon appear instantly without animation, I would like the whole view to animate at the same time, is this possible to achieve?
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
Fragment existing = fragmentManager.findFragmentById(R.id.welcome_content);
if (existing != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
fragmentToLoad.setAllowEnterTransitionOverlap(true);
fragmentToLoad.setEnterTransition(new Slide(Gravity.RIGHT));
}
fragmentTransaction.remove(existing);
}
fragmentTransaction.add(R.id.welcome_content, fragmentToLoad);
fragmentTransaction.commitNow();