Hire live on any story or even a hunch about trying to lay out in Android.
So let's create an android studio project and for the application and just they've been here constraints
in Android.
So specifically the company domain package name here and then the project location just click next and
here for the minimalistic nature's API 16 Android 4.1 did it mean for phone and tablet just couldn't
connect.
And here is MT-NW activity next.
So he had just don't change anything.
And then click on finish.
So now as you can see here our project is created.
So let's go to the activity Underland minute example.
So here inside this project pane you can just open the rest for that.
And then the layout folder I didn't see this activity underlined minute segment let's double click on
this tab here in order to make this area wider.
So now let me actually tell you about these views here.
We have this view here and we have this one here.
So what is this.
This is actually a blueprint.
This is called blueprint and this is used for Bayda actually designing and position in our user interface
components inside our layout.
So here you can see these icons at the top.
And for example the first one is actually design only.
So if I actually click on this one here the blueprint is going to be disappeared.
So this is actually just the design and the second icon is show blueprint.
If you click on it you can see that the design has disappeared.
And the blueprint is appier here.
And the first icon is actually designed plus blueprint.
If I click on it you can see both of these views here.
Right.
So what is this one.
This one is actually for use is used for actually watching the application in landscape mode or portrait.
Let's actually click on it.
You can see now the application is actually in landscape mode.
If I click on it again now it is in portrait.
And here this one is used for actually changing the device.
If I click on it you can see all these devices Nexus One they see as Galaxy next was the Nexus 4 and
all these other devices here.
So for now we're going to actually stick with the Nexus 4 and here this is the actually the API that
we are going to target.
We are going to target apelike 25 because this is actually there.
The API the only API that we can actually target a 25 This is the least the latest API that is actually
introduced by Android.
And here we can specify the app fien here if you want to we can actually specify the app from for example
if I click on all we can for example change selectees will no titlebar right.
Or if I click on material dark here you can for example select material that dialog that no action bar
or if I select the material light I can select this one material that light but dark action.
But if I click on this one here if it's so select select this one and then click on OK.
Now you can see that the action is Blache right.
This is actually dark and we have all these are for example languages here.
If you want to actually translate my application to another language I can choose this option here.
So I talked about translating our application to other languages in another section of the course so
thoughtfully about these options.
Now for now we just want to I just want to focus on the constraints left.
So looking at these options here these options appear here because you're are using constraints lay
out.
So what is a constraint really are.
So constraint is actually of the newest features that is actually introduced by Android in order to
position our user interface components inside our layout this is actually an other side of the aisle.
If we're at the bottom of the Android studio that's going to take a stab here we can see that we have
constraints play out in Android studio 2.0 free.
It is actually the default lay out that is going to be created whenever you create an android application.
And let's go back to the design tab.
Now we have this hill over takes let's actually for example select this hello world text view and you
can actually drag it and we can for example change the place of this hello world wherever you want.
For example I can put it here right.
It's actually live with here and here on the right hand side you can see it is a propertys view.
And we have the ID attribute so you can actually specify the idea of your hello world here and look
at this one here for example.
These are called constraints.
So now for example select is text view and you can see this little circle here.
This little circle that is actually pulsating here.
Now I can select this one and then I can actually track it line to the top of the actually the top top
edge of the view of my android view here.
Let's actually put it here and then release it and now you can see that a constraint is actually created
here and it is number eight here.
So what is this number eight.
This is actually called the Margene So here in the Properties window you can see that we have a constraint
to the top of the Android view to top off a view actually and the margin is 8 so I can increase the
margin for example I can change the margin to for example 20.
And that person entered a new keyboard.
So now you can see that the margin is 20 and the distance between this hello world to the top of the
view is actually increased.
If I want to I can actually just click on this dropdown here and select one of these values for example
32 right.
Or I can just put a custom value here for example 200 and then person enter on your keyboard.
So now you can see that the Margene now is 200.
Here the top margin is now 200.
And we also have left margin bottom margin bottom and margin to the right.
So let's actually select this left circle here that is pulsating here right to select this one and then
drag a line a constraint to the left of the to the left edge of the view.
Here we can see right.
And then release it.
Now a constraint is created to the left view to the left edge of the Android view here.
And in the Properties window you can see this margin here and it says 8 right.
I can actually for example change the value to 42 Right.
Or I can change it to for example 2.
And that person interregional keyboard.
So now we can also create a constraint to the right and a constraint to the bottom right.
So look at these handler here inside these properties we do is fight right if we actually just change
the place of this handler.
I can't I can't I can change the place of this hello world takes you here in say it is a blue print
here you can see that the place is actually changed.
If I put it here now the hello world is actually at the bottom of the find.
So we have also this handler here in order to change the place are HELLO HELLO WORLD.
Horizontally here for example here and we have to lay out lay out height.
So now let's select this hello world view here and then press on delete key on your keyboard to select
it and then press on religion or keyboard.
So now I want to drag an image view into our view here.