1
00:00:00,240 --> 00:00:05,360
So now let's actually click on this text tab here at the bottom.

2
00:00:05,490 --> 00:00:09,280
And now as you can see here we have this relatively out here.

3
00:00:09,330 --> 00:00:09,840
OK.

4
00:00:10,020 --> 00:00:14,420
So now let's change this relatively out to linear layout.

5
00:00:14,610 --> 00:00:20,280
So here just click on this preview here at the right hand side as you can see we have this preview option.

6
00:00:20,280 --> 00:00:21,360
Just click on it.

7
00:00:21,420 --> 00:00:27,690
Now we can actually see our user interface and now this actually zoom into this user interface here

8
00:00:27,740 --> 00:00:30,480
by just click on this the zoom button here.

9
00:00:31,500 --> 00:00:35,280
And now I can see this User Interface he had better.

10
00:00:35,340 --> 00:00:36,210
Right.

11
00:00:36,210 --> 00:00:38,650
So let's actually make this area wider.

12
00:00:38,820 --> 00:00:40,940
So here we can see our user interface.

13
00:00:41,090 --> 00:00:44,350
Ok so now we have this relatively out.

14
00:00:44,350 --> 00:00:50,660
So let's actually change this relatively to linearly out.

15
00:00:51,070 --> 00:00:53,200
And now we have a linear layout.

16
00:00:53,260 --> 00:00:58,650
So here let's actually specified that the orientation of this linearly out here.

17
00:00:58,650 --> 00:01:02,220
So just add another attribute to this linearly out here.

18
00:01:02,230 --> 00:01:10,390
So here before the end in tact of this linearly out here as you can see now I want to add another attribute

19
00:01:10,420 --> 00:01:11,400
orientation.

20
00:01:11,410 --> 00:01:13,390
So just type in here orientation.

21
00:01:13,700 --> 00:01:19,540
And as you can see here the autocomplete feature of Android studio is helping me to choose this attribute

22
00:01:19,570 --> 00:01:25,190
orientation data selected by person by pressing on there or on the Enter key on your keyboard.

23
00:01:25,570 --> 00:01:27,510
And here we have two options.

24
00:01:27,580 --> 00:01:34,180
We can say that this linear layout is actually a horizontal linearly out or we can say that this linearly

25
00:01:34,180 --> 00:01:36,690
out is actually a vertical linear layout.

26
00:01:36,820 --> 00:01:42,790
So in this case if you want to use a vertical linearly out for the roots of our activity here.

27
00:01:42,850 --> 00:01:47,310
So just select this vertical here and then press an interview on your keyboard.

28
00:01:47,710 --> 00:01:53,050
And now let's ask you to go inside this linearly out here as you can see now we are inside this linear

29
00:01:53,050 --> 00:01:53,820
lift.

30
00:01:53,830 --> 00:02:00,040
This is the beginning tag as you can see here where we actually specify the attributes of this linearly

31
00:02:00,040 --> 00:02:00,370
out.

32
00:02:00,520 --> 00:02:01,630
And this is the ending.

33
00:02:01,660 --> 00:02:07,100
And this means that we can put some user interface components inside the linearly out.

34
00:02:07,150 --> 00:02:08,870
So now I want to do that here.

35
00:02:09,070 --> 00:02:14,950
So now let's actually make this area a little bit smaller and make this a little earlier a little bit

36
00:02:14,950 --> 00:02:16,130
wider and now.

37
00:02:16,420 --> 00:02:19,300
So now inside this linearly out vertical.

38
00:02:19,300 --> 00:02:21,220
Let's create another linearly out.

39
00:02:21,220 --> 00:02:25,000
But this time I want to create a linearly out horizontal.

40
00:02:25,210 --> 00:02:29,340
So just put an opening tag here and just type in here linearly out.

41
00:02:30,070 --> 00:02:34,110
And now just select here and select is linearly linearly.

42
00:02:34,120 --> 00:02:39,370
And as you can see here the autocomplete feature of Android studio is helping me to actually specify

43
00:02:39,370 --> 00:02:42,830
the layout and the layout height of my linearly out here.

44
00:02:42,830 --> 00:02:45,300
OK these two attributes are necessary.

45
00:02:45,340 --> 00:02:51,670
We need to specify a value for the layout with and for the layout height of are linearly out here as

46
00:02:51,670 --> 00:02:52,670
you can see right.

47
00:02:52,720 --> 00:02:57,820
So the layout is going to be for example match parent.

48
00:02:57,850 --> 00:03:03,280
So for the layout with assigned a value match parent and for the layout height assigned the value or

49
00:03:03,280 --> 00:03:04,180
add content.

50
00:03:04,330 --> 00:03:05,590
OK.

51
00:03:05,790 --> 00:03:12,610
Now as you can see here if I don't specify the art orientation attributes of this linearly or here the

52
00:03:12,610 --> 00:03:17,300
default value is actually what exactly but for here.

53
00:03:17,380 --> 00:03:22,510
Because I don't want to get you confused here I want to specify the orientation here so just type in

54
00:03:22,510 --> 00:03:25,170
here orientation and choose horizontal here.

55
00:03:25,300 --> 00:03:30,000
But again this orientation here as you can see it but by default is horizontal.

56
00:03:29,990 --> 00:03:36,320
So if you don't specify the orientation of your linearly out here the default value is horizontal.

57
00:03:36,660 --> 00:03:41,320
And now let's actually specify an ID for this linearly out here.

58
00:03:41,350 --> 00:03:43,610
So just press on until your keyboard.

59
00:03:43,630 --> 00:03:47,830
And here I can actually specify an ID for this linearly.

60
00:03:47,830 --> 00:03:49,690
So here I can just type in ID.

61
00:03:49,990 --> 00:03:52,830
And now I can actually select this id attribute.

62
00:03:53,230 --> 00:03:58,870
And here again in order to specify an ID for my Alania lay out here I need to just type in here and

63
00:03:58,880 --> 00:04:02,360
sign Plus Id slash.

64
00:04:02,900 --> 00:04:07,300
And now for the idea I can just step in here first.

65
00:04:07,330 --> 00:04:08,810
First row.

66
00:04:09,230 --> 00:04:12,550
Linear layout.

67
00:04:12,760 --> 00:04:15,790
So this is the ID of my Linnea lay out here.

68
00:04:15,790 --> 00:04:16,600
Right.

69
00:04:16,690 --> 00:04:18,420
First row linearly.

70
00:04:18,430 --> 00:04:23,640
So this is going to be our role here that we can actually put two buttons inside it.

71
00:04:23,920 --> 00:04:27,170
So now let me ask you to show you the actual application.

72
00:04:27,280 --> 00:04:30,590
So as you can see here we have three rows here.

73
00:04:30,610 --> 00:04:36,000
The first throw is this one that actually contains two buttons holes and Pinguin.

74
00:04:36,280 --> 00:04:41,630
The second row is this one which actually contains two BOTTEN peacock and bird.

75
00:04:41,830 --> 00:04:47,590
And the second row and the first row excuse me is this one as you can see here which contains these

76
00:04:47,590 --> 00:04:48,520
two buttons.

77
00:04:48,600 --> 00:04:49,590
And Dalfin right.

78
00:04:49,810 --> 00:04:54,840
So now you are actually creating this row here that actually contains these two buttons.

79
00:04:54,850 --> 00:04:55,300
Right.

80
00:04:55,390 --> 00:05:03,430
So we have this linearly or horizontal as you can see here and in the as you can see in a preview here

81
00:05:03,490 --> 00:05:04,580
at the right hand side.

82
00:05:04,600 --> 00:05:12,580
So now as you can see if you actually click on this preview here now you can see that this area is actually

83
00:05:12,580 --> 00:05:14,230
highlighted here right.

84
00:05:14,290 --> 00:05:20,830
So now I want to actually add two buttons inside this linearly or what is horizontal.

85
00:05:20,860 --> 00:05:25,720
So as you can see here I can actually go inside this linearly out here as you can see this is the beginning

86
00:05:25,890 --> 00:05:27,770
tag and this is the ending tag.

87
00:05:27,790 --> 00:05:28,340
Right.

88
00:05:28,360 --> 00:05:31,090
So inside is linearly or horizontal.

89
00:05:31,130 --> 00:05:32,630
I want to add two buttons.

90
00:05:32,770 --> 00:05:37,550
So now inside is a horizontal linear play out here as you can see.

91
00:05:37,810 --> 00:05:42,910
I'm going to actually pasting some lines of code here and then I'm going to explain to you what's going

92
00:05:42,910 --> 00:05:44,180
on here.

93
00:05:44,200 --> 00:05:48,630
So as you can see here these are two lines of code that I pasted here.

94
00:05:48,790 --> 00:05:54,330
So in the right hand right inside this preview we can see that we added two buttons into this.

95
00:05:54,400 --> 00:05:56,550
The linear layout horizontal right.

96
00:05:56,550 --> 00:05:59,240
We have this button here and we have this button.

97
00:05:59,280 --> 00:06:01,130
So now let's actually look at our coats here.

98
00:06:01,140 --> 00:06:04,200
As you can see these are the lines of code that I pasted here.

99
00:06:04,290 --> 00:06:06,280
And as you can see we have this button here.

100
00:06:06,450 --> 00:06:07,050
Right.

101
00:06:07,110 --> 00:06:13,530
And the layout of it is zero DPI as you can see here the layout height is that content and I actually

102
00:06:13,650 --> 00:06:18,640
assigned a value for the layout weight attribute which is actually 0.5.

103
00:06:19,080 --> 00:06:26,700
And this means that because I actually assign the value 0 the P to that layout of this button here.

104
00:06:26,790 --> 00:06:32,290
Now I assigned the values 0.5 to the lay out what the weight of this button and this means that it's

105
00:06:32,290 --> 00:06:40,370
going to actually take a half of the Vee's of its patent which is actually linearly out horizontal here

106
00:06:40,380 --> 00:06:41,380
right.

107
00:06:41,490 --> 00:06:47,730
This button here is going to actually take a half of the V of its patent which is this linearly out

108
00:06:47,910 --> 00:06:49,080
horizontal.

109
00:06:49,290 --> 00:06:53,040
And as you can see here we have these attribute lines too.

110
00:06:53,150 --> 00:06:53,690
OK.

111
00:06:53,880 --> 00:06:58,650
And this means that we can actually add two lines of text to this button here.

112
00:06:58,650 --> 00:07:01,830
OK so for example we have a long test text here.

113
00:07:01,830 --> 00:07:04,200
Here we are specified the number of lines.

114
00:07:04,230 --> 00:07:09,310
And here it's going to actually put that line text here in two lines.

115
00:07:09,330 --> 00:07:09,870
OK.

116
00:07:09,990 --> 00:07:13,070
So that's the attribute that you can actually specify here.

117
00:07:13,530 --> 00:07:17,780
And for the out margin as you can see here I assigned the value 5 DP.

118
00:07:17,780 --> 00:07:24,510
So as you can see here I specify the lay margin for each direction left top right and bottom which is

119
00:07:24,510 --> 00:07:25,610
actually 5 DP.

120
00:07:25,740 --> 00:07:26,460
OK.

121
00:07:26,700 --> 00:07:32,530
So now as you can see here we have this button again to lay out which is zero DP.

122
00:07:32,650 --> 00:07:38,850
The layout height is the content and the layout weight is zero DP So it's going to actually take a half

123
00:07:38,850 --> 00:07:43,110
of the width of its Pallant which is this linearly out horizontal.

124
00:07:43,440 --> 00:07:50,080
And again for the lines attribute I assigned de-valued number two and this means that this button here

125
00:07:50,100 --> 00:07:55,320
is going to actually accept two lines of text and we have this play out.

126
00:07:55,320 --> 00:07:56,020
Margene.

127
00:07:56,160 --> 00:08:01,660
And as you can see here for each direction left top right and bottom we have five DP Margene.

128
00:08:01,830 --> 00:08:02,510
OK.

129
00:08:02,790 --> 00:08:09,390
The external actually then is around this button here is that left margin attribute.

130
00:08:09,540 --> 00:08:11,760
So hopefully that makes sense.

131
00:08:11,760 --> 00:08:17,580
And this is our linear layout horizontal that actually contains these two buttons right.

132
00:08:17,580 --> 00:08:23,970
So now after the ending Tyche of this linearly horizontal here as you can see now I'm going to actually

133
00:08:24,300 --> 00:08:26,700
create another linearly or horizontal.

134
00:08:26,700 --> 00:08:27,260
Right.

135
00:08:27,300 --> 00:08:32,700
So I just need to put an opening tag here so linearly out as you can see here.

136
00:08:32,910 --> 00:08:35,780
And for the layout of it I can assign the value.

137
00:08:35,790 --> 00:08:43,760
For example a match parent and for the lay out height I can assign the value of content.

138
00:08:43,890 --> 00:08:50,220
So content and now we can actually specify other attributes.

139
00:08:50,360 --> 00:09:00,590
So I can actually specify the orientation which is horizontal and the idea is going to be a second row

140
00:09:01,820 --> 00:09:04,100
linearly out as you can see here.

141
00:09:04,100 --> 00:09:04,700
Right.

142
00:09:04,790 --> 00:09:09,140
This first linearly out is first row linearly as you can see here.

143
00:09:09,260 --> 00:09:13,470
And if you have another linearly out here as you can see second row linear layout.

144
00:09:13,700 --> 00:09:19,460
And as you can see here we have an error and that's because if you want to actually specify an I.D.

145
00:09:19,460 --> 00:09:26,160
for your user interface component you need to frailest just type in here at sign Plus Id slash.

146
00:09:26,420 --> 00:09:28,710
And then you can specify the name of the ID.

147
00:09:29,030 --> 00:09:35,300
So now let's actually go inside this linearly out horizontal here and again I'm going to actually put

148
00:09:35,300 --> 00:09:38,220
two buttons here inside is linearly out here.

149
00:09:38,360 --> 00:09:43,670
So now if we actually show you the emulator here as you can see this is our emulator and this is our

150
00:09:43,670 --> 00:09:46,370
application that is actually running on the simulator.

151
00:09:46,520 --> 00:09:52,040
And if you have this section the here that contains these two buttons right this Picot and despair the

152
00:09:52,100 --> 00:09:52,760
button.

153
00:09:52,760 --> 00:09:59,270
So here we can actually put two buttons into this linearly out horizontal.

154
00:09:59,270 --> 00:10:01,320
So this is our linearly or horizontal.

155
00:10:01,520 --> 00:10:06,920
And now inside is linearly or horizontal I'm going to paste in some lines of code here and then I'm

156
00:10:06,920 --> 00:10:09,060
going to explain to you what's going on here.

157
00:10:09,080 --> 00:10:09,970
Exactly.

