TransformationLayout
TransformationLayout copied to clipboard
It not working with navigation component
Please complete the following information:
- Library Version [e.g. v1.0.7]
- Affected Device(s) [e.g. Android 10.0]
Describe the Bug: I using navigation component call Home fragment => Home Detail Fragment, it not working with navigation component. Can you please give me more instructions
====>RecyclerView Adapter
holder.binding.transformationLayout.transitionName = data[position].id.toString()
holder.binding.layoutRoot.setOnClickListener {
onItemClickListener?.let {
onItemClickListener?.onItemClick(
holder.binding.transformationLayout,
holder.binding.transformationLayout,
data[position]
)
}
}
====>Home Fragment
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
onTransformationStartContainer()
}
val bundle = itemView.getBundle(Constants.PARAMS_LAYOUT_KEY)
bundle.putParcelable("detail_feature_key", item)
val extras = FragmentNavigatorExtras(view to Constants.PARAMS_LAYOUT_KEY)
findNavController().navigate(
R.id.action_global_homeFeatureDetailFragment,
bundle,
null,
extras
)
=====>Home Detail Fragment
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
sharedElementEnterTransition = TransitionInflater.from(context).inflateTransition(android.R.transition.move)
arguments?.let {
paramsLayout = it.getParcelable(PARAMS_LAYOUT_KEY)
if(paramsLayout != null) {
onTransformationEndContainer(paramsLayout)
}
}
}
Hi,
onTransformationStartContainer() and onTransformationEndContainer must be called before super.onCreate.
I have followed the instructions but still have not solved the problem, when clicking on the item it blinks https://drive.google.com/drive/folders/1nl08FknTsuXeqzyD_FrzCBRQGYIMpBWp?usp=sharing