endId, ConstraintSet.LEFT, margin); set.connect(...); set.connect(...); // From XML layout set.clone(context, R.layout.layout_transition_1); // From current state set.clone(constraintLayout); // Animate to a new set ConstraintLayout mConstraintLayout = ...; private void transitionTo(ConstraintSet constraintSet) { TransitionManager.beginDelayedTransition(mConstraintLayout); constraintSet.applyTo(mConstraintLayout); }
y BP = TP + hP R = L + w L ≥ LP + mL R ≤ RP - mR L + R = LP + RP + mL – mR B = T + h T ≥ TP + mT B ≤ BP - mB T + B = TP + BP + mT – mB Parent Constraints Horizontal Constraints Vertical Constraints