I have an activity where there is an imageView at the top and a recyclerview at the bottom of the imageview. I used MotionLayout to animate the imageView's bottom constraints to top of the screen and recyclerview fill the screen, when I scroll the recyclerview. Everything works fine. But, what I want is that when the recyclerview is empty, I don't want animation to happen. Based on this document and this answer, I used this code:
motionLayout.getTransition(R.id.yourTransition).setEnable(false);
But, this code is not working for me. Even if I add this code, animation still happens. What is wrong with this code? Am I missing something?