Android Layouts: a new world - Google I/O 2016

Android Developers · 43K views · 2016 · 32:13

Open on YouTube

Software (other)UX & UI designtalkdated

Why Stack Overflow recommends it

Stack Overflow users link it as the official introduction to ConstraintLayout when answering or asking how to position, center, and space views with it.

Recommended by 2 people across 2 different months, 2016 to 2017.

What it is

A Google I/O 2016 session from the Android Developers channel introducing ConstraintLayout and the new graphical layout editor in Android Studio. It explains the constraint-based layout engine and how to build flat, flexible layouts with drag and drop design tools.

What people said

Recommends Arturo Mejia · 2016-06 · Stack Overflow · on “how use these Material Design UI in my android studio while developing the application? ie .sketch file”

I think could give it a look to the new UI Designer & Constraint Layout [LINK] in Android Studio 2.2 Preview, It may help to create your layout quickly and easily, just using drag and drop. More info: Google I/O 2016 talk about UI Designer & Constraint Layout [this video] Android Blog Post about UI Designer & Constraint Layout [LINK] Happy Coding!

Recommends gunesevitan · 2017-07 · Stack Overflow · on “How to debug an unexpected Android layout?”

The problem is you are not using constraints at all which is the whole point of constraint layout. For example, if you don't use constraints on Download Brochure button and use only tools:layout_editor_absoluteX and tools:layout_editor_absoluteY attributes, the button stays at the position where you put it on the editor but when you compile the app, the button goes top left corner. You need to add those to Download Brochure button, then set its location. So it will be on the same position in every possible situation. app:layout_constraintLeft_toLeftOf="parent", app:layout_constraintRight_toRightOf="parent" But I suggest you to do it on editor while playing around with constraint layout which

Cites AdamK · 2016-05 · Stack Overflow · on “Evenly spacing views using ConstraintLayout”

A common use for LinearLayout [LINK] is to evenly space (weight) views, for example: [LINK] How do you implement evenly spaced views like this using the new ConstraintLayout ? ConstraintLayout links for reference: blog post [LINK] , I/O session video [this video]

Cites android developer · 2016-05 · Stack Overflow · on “How to center multiple Views together using ConstraintLayout?”

Background Google has announced a new layout called " ConstraintLayout [LINK] " that's supposed to be the ultimate layout, that could replace all of the layouts while staying flat (without nested layouts) and have better performance. The problem Thing is, I barely see any tutorials for it that could help me on this matter, other than the video presented on Google IO. What I am trying to do is, given that I have a vertically-centered LinearLayout within another layout - convert them both into a single ConstraintLayout. After all, this is the purpose of this new layout... The layout I wish to deal with looks like this: [LINK] Notice that the views in the center are only centered vertically, an

Cites Marcin Koziński · 2016-06 · Stack Overflow · on “How to center multiple Views together using ConstraintLayout?”

EDIT: This answer had been written before chains became available. Please use chains now, see above answer: [LINK] For now I believe your only choice would be to wrap the two text views in another layout - probably linear layout best fits this situation. But the team behind constraint layout said they want to introduce "virtual containers", which serve exactly this use case: you group two or more views together and set a constraint (like centring vertically) on the container. The idea is that it is not a full nested layout inside of constraint layout, but just something that constraint layout uses to position it's children - hence it should provide better performance than nesting. They menti