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

By: Android Developers

375   19   36223

Uploaded on 05/20/2016

Have you ever longed for an intuitive way to design your android layouts? This presentation will introduce a new layout engine and graphical design tools, and will cover everything you need to know to start using it in your own applications. The new system will help you quickly create layouts and iterate on the design, without sacrificing the powerful behavior expected of modern user interfaces.

Watch more Android talks at I/O 2016 here: https://goo.gl/Uv3jls
See all the talks from Google I/O 2016 here: https://goo.gl/olw6kV

Subscribe to the Android Developers channel at http://goo.gl/GEh1ds

#io16 #GoogleIO #GoogleIO2016

Comments (4):

By anonymous    2017-09-20

EDIT: This answer had been written before chains became available. Please use chains now, see above answer: https://stackoverflow.com/a/40102296/1402641


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 mention it in their I/O talk (linked to the exact time). So I guess stay tuned.

Original Thread

By anonymous    2017-09-20

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 is much easier.

You can also watch this video. https://www.youtube.com/watch?v=sO9aX87hq9c. It helps a lot.

Original Thread

Popular Videos 32

Artificial Intelligence Courses

Submit Your Video

If you have some great dev videos to share, please fill out this form.