I have a ConstraintLayout and I'm adding a maxHeight constraint by using constraintSet.constrainMaxHeight(R.id.recyclerView, (Utils.getScreenHeight() / 2.2).toInt())
Later in my excecution I need to remove this max height constraint, so I do:
constraintSet.connect(R.id.recyclerView, TOP, PARENT, TOP)
constraintSet.constrainHeight(R.id.recyclerView, MATCH_CONSTRAINT)
constraintSet.constrainMaxHeight(R.id.liveFeedRecyclerView, UNSET)
However, my recyclerView still has the "max height" assigned to it. What is the proper way of unsetting the max height constraint and setting my view's height to Match Constraint?
P.S.: All the Constant values are the constants found in the ConstraintSet class.
It looks like ConstraintLayout defaults the max height to
Integer.MAX_VALUE(decimal value is 2147483647), so try using that instead ofUNSETwhich is -1.