1

I am trying to replace fragment B with fragment A. But after replacing, onResume() is never called on Fragment B, though I can interact with it. Also, onDestroyView is never called on Fragment B.

val transform = MaterialContainerTransform()
            transform.duration = 500
            val frag = SecondFragment()
            frag.sharedElementEnterTransition = transform


            ( requireActivity() as MainActivityffff).supportFragmentManager.beginTransaction()
                .addSharedElement(textview_first123123 as ConstraintLayout,"textOCHEK")
                .replace(R.id.frags,frag,"second").addToBackStack("second").commit()

The problem I am facing is that I can't reverse my Material transformation back.

If anyone knows how to resolve this issue please help.

Thanks.

Levi
  • 187
  • 2
  • 17

1 Answers1

0

UPD. Found answer: to fix Fragments unexpected behavior I added this dependencies:

implementation 'androidx.appcompat:appcompat:1.3.0'
    implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
    implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'