Q: Android Fragments and animation

D: How should you implement the sort of sliding that for example the Honeycomb Gmail client uses?
Can TransactionManager handle this automatically by adding and removing the Fragments, it's kind of difficult to test this due to the emulator being a slideshow :)

Test Case #19


File ID: #4819665-2-cc


FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.setCustomAnimations(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
CertificateDetailsFragment newFragment = CertificateDetailsFragment.newInstance(getPackageName());
ft.replace(R.id.fragment_host, newFragment, "detailFragment");
// Start the animated transition.
ft.commit();

  1. When i tried this it show *RuntimeException: Unknown animator name: translate*.
  2. I'm targeting API Level 7 with the compatability APIs. Is there a way for me to animate Fragments?
  3. That helped a lot. I was on the right track but just did not get all the way there. For the other readers, you could also have android:interpolator as an attribute, with your favorite one specified (such as "@android:interpolator/linear""). It defaults to "@android:interpolator/accelerate_decelerate"".

Comments Quality
Accurate?:
Precise?:
Concise?:
Useful?: