Removing/Adding constraint programmatically in ConstraintLayout
I have not worked through your code, but the following illustrates how to break and make the constraint using ConstraintSet. ConstraintSet set = new ConstraintSet(); ConstraintLayout layout; layout = (ConstraintLayout) findViewById(R.id.layout); set.clone(layout); // The following breaks the connection. set.clear(R.id.bottomText, ConstraintSet.TOP); // Comment out line above and uncomment line below to make the connection. // set.connect(R.id.bottomText, … Read more