‫Let's understand the layouts in Android studio.
‫I created a new project called Layout App and let's move to the activity underscore main dot XML file,
‫remove the text view and let's replace the constraint layout, which is the root element of this file.
‫With the linear layout, click enter and here we go.
‫Always when you create a new layout file, linear constraint relative or whatever the layout is, keep
‫these or write these three lines in order to get the tools and to link it with a link.
‫XML with Android.
‫These are not very important to deep dive into them because these are just the codes to link the linear
‫layout or the layout you create with the android.
‫Now here are the parameters, the layout width and the layout height.
‫The layout width is set to matchparent, which means the linear layout will take up the full width of
‫its parent container layout.
‫Height is Matchparent also that it will take up the full height of its parent container if I switch
‫it.
‫To wrap content, you can see it wraps the content, which means the height of the linear layout will
‫adjust to fit its child views.
‫The context is the main activity.
‫I am linking it with the main activity.
‫Now let's start creating the views inside this linear layout.
‫I'll start with text view.
‫So we created these two text views.
‫Inside this linear layout.
‫You can see that text number one is near to text number two.
‫If I need to arrange these texts in different orientation, I'll use orientation attribute in linear
‫layout, click vertical and you can see that the text views are arranged vertically.
‫If I create another text view here, you can see that the text view or the text number three is added
‫vertically under number two.
‫So the linear layout arranges the views in a single row or column, depending on the orientation you
‫set.
‫This is the orientation.
‫If I change it to horizontal, you can see text number one, text number two and text number three.
‫But here the texts are very big.
‫I'll reduce them to 18, SP, 18, SP and 18.
‫You can see text number one, text number two and text number three are arranged in one row because
‫the orientation is horizontal.
‫If I change it to vertical, it will change it to vertical way and arrange them into one single column.