Using nested fragment and animator object alongside
Asked Answered
M

1

8

I have Fragment A which contains two fragments, Fragment B and Fragment C. I want to add fragment B to fragment A using getChildFragmentManager() then replace it with fragment C by card flip animation using this code

getChildFragmentManager()
    .beginTransaction()
    .setCustomAnimations(
            R.animator.card_flip_right_in, R.animator.card_flip_right_out,
            R.animator.card_flip_left_in, R.animator.card_flip_left_out)
    .replace(R.id.fragment_new_word_container, new FragmentCardBack())
    .addToBackStack(null)
    .commit();

Nested Fragments introduced in android 4.2 to use it in earlier versions we can use Support library. everything works great up to here. The problem is FragmentManager in support library doesn't support object animator. So its seems i only have 2 options:

  1. target api level 4.2 and higher which will cost me more than half of my customers. This is not a suitable option for me!
  2. Not using nested fragments since animation is essential part of my app.

So is there any other way in which i can use support library nested fragments alongside with flip card animation?

Mayolamayon answered 28/7, 2014 at 9:31 Comment(1)
Did you figure out a solution for this?Unsettle
P
0

Try using the Android support-v13 library to combine nested fragments with a flip-card animation.

Parietal answered 5/4, 2016 at 8:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.