Thanks Jorge Aguilar for spending the time in debugging the issue. Indeed the culprit to change to is as below.

compile 'com.android.support.constraint:constraint-layout:1.0.2'

By having this, my original code of Constraint Layout works too, and without need to animate through the Kotlin code. Just need the animateLayoutChanges="true" in the ConstraintLayout will do.

Indeed Constraint Layout is a great layout to be explored on. Much to be learnt.

Thanks again.

Written by

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store