{ ConstraintSet().apply { load(this@MainActivity, R.layout.constraintset_expand) } } private var mShowExpandImage = false override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main_sta_) mConstraintSetNormal.clone(rootLayout) } fun toggleMode(v: View) { TransitionManager.beginDelayedTransition(rootLayout) mShowExpandImage = !mShowExpandImage applyConug()