I have Two motion layouts in an XML. One is a parent, one is its child.
While animating the start animation from XML , it works . But when the same motion layout is dynamically started with code the view does not get display but the animation in the log shows it is completed. What might be the issue?
@Override
public void onTransitionCompleted(MotionLayout motionLayout, int currentId) {
switch (currentId) {
case R.id.endHomeLaunch:
motionLayout.setTransition(R.id.expanded, R.id.collapsed);
motionLayout.setProgress(0);
motionLayoutFloatButton.setTransition(R.id.startFloat,R.id.endFloat);
motionLayoutFloatButton.setTransitionDuration(1000);
motionLayoutFloatButton.transitionToEnd();
break;
As my parent layout has swipe animation I cant add an on-click animation as this adds bug in layout animation . The only option was to create two separate motion layout scene.