I have a grid recyclerview in fragment, which hosted in viewpager. Transition normally works when i open DetailFragment, but no transition effect when press back button...What i'm missing?
I use ListAdapter.
//frag with recyclerview
override fun onCreate(savedInstanceState: Bundle?) {
onTransformationStartContainer()
super.onCreate(savedInstanceState)
}
// put bundle
fun newInstance(artist_id: Int, transformationLayout:TransformationLayout): ArtistInfo {
val fragment = ArtistInfo()
fragment.transition_name=transformationLayout.transitionName
val bundle = transformationLayout?.getBundle("TransformationParams")
bundle.putInt("artist_id", artist_id)
fragment.arguments = bundle
return fragment
}
// detailfrag
override fun onCreate(savedInstanceState: Bundle?) {
val params = arguments?.getParcelable("TransformationParams")
onTransformationEndContainer(params)
super.onCreate(savedInstanceState)
// loading new fragment
val transaction = supportFragmentManager.beginTransaction()
.addTransformation(transformationLayout)
.replace(R.id.albumFragcontainer, fragment, tag)
.addToBackStack(tag)
.commit()
I have a grid recyclerview in fragment, which hosted in viewpager. Transition normally works when i open DetailFragment, but no transition effect when press back button...What i'm missing? I use ListAdapter.
//frag with recyclerview override fun onCreate(savedInstanceState: Bundle?) { onTransformationStartContainer() super.onCreate(savedInstanceState) }
// put bundle fun newInstance(artist_id: Int, transformationLayout:TransformationLayout): ArtistInfo { val fragment = ArtistInfo() fragment.transition_name=transformationLayout.transitionName val bundle = transformationLayout?.getBundle("TransformationParams") bundle.putInt("artist_id", artist_id) fragment.arguments = bundle return fragment } // detailfrag override fun onCreate(savedInstanceState: Bundle?) { val params = arguments?.getParcelable("TransformationParams")
onTransformationEndContainer(params)
super.onCreate(savedInstanceState)
// loading new fragment val transaction = supportFragmentManager.beginTransaction() .addTransformation(transformationLayout) .replace(R.id.albumFragcontainer, fragment, tag) .addToBackStack(tag) .commit()