ConstraintLayout

Why?

  • reduce nested layout
  • easy to deal with complex screen
  • better performance

How to use?

Api changes

  • remove deprecated centerX/Y attributes
  • remove deprecated layout_constraintGuide_Percent attribute taking integers (superseded in alpha 6 by layout_constraintGuide_percent attribute taking a float from [0..1])
  • new attributes (app:layout_goneMarginTop/Bottom/Left/Right/Start/End) to specify different margin values for widgets connected to a GONE widget
  • ConstraintSet class that let you create a set of constraints at runtime and apply it to a ConstraintLayout without set up LayoutParams.
  • chain feature(layout editor support otherwise blueprint mode can’t)

Read More