Welcome back.
In this video we're going to learn about boxes.
The composable counterpart for a framelayout is called a box.
Just like Framelayout, it's used to display children relative to their parents edges and allows you
to stack children.
This is useful when you have elements that need to be displayed in those specific places, or when you
want to display elements that overlap, such as dialogs.
Let's create a new composable function.
I'll name it as my box, and inside this function I'm going to create a box and select the composable
and here modifier dot fill maximum size.
Inside the box I'm going to copy these three texts.
If we run our application and call my box inside the Setcontent, we will get this output.
The three texts are overlapped, so this is a big problem.
We need to specify the position of these items here, I'm going to use inside that text I'll set a modifier.
So here modifier modifier dot align method I'm going to use alignment dot top start.
For the second text I'm going to use another modifier dot center and the third text is modifier dot
align bottom.
And let's run our application and see the change.
You can see this is our application.
The first text is Top Start which is the top left the download master coding application.
The second text is center and from play store bottom and bottom right okay.
So the text fields appear diagonally across the screen with the first one at the top left corner, the
second one in the center, and the last one at the top right corner.
Using a box is really useful in specific situations and they make positioning elements incredibly easy.