1
00:00:01,050 --> 00:00:04,610
And now I want to talk about boolean logical operators.

2
00:00:04,930 --> 00:00:10,980
So now let's actually go back inside this content underline minute example because I want to actually

3
00:00:11,010 --> 00:00:14,460
put in lots of components into this screen.

4
00:00:14,460 --> 00:00:15,100
OK.

5
00:00:15,180 --> 00:00:17,840
So as you can see here again is now seen as an error.

6
00:00:18,030 --> 00:00:21,450
So I just need to click on this clear cache here.

7
00:00:21,510 --> 00:00:23,770
Now as you can see the error is gone.

8
00:00:23,790 --> 00:00:31,410
So OK everyone now actually dragging a linearly out horizontal into this linearly out vertical.

9
00:00:31,790 --> 00:00:39,710
OK so now let's actually put in some more components into this are linearly out horizontal OK.

10
00:00:40,020 --> 00:00:43,890
So let's actually dragging our large takes you here.

11
00:00:43,890 --> 00:00:50,910
So just click on this large takes you and then you can actually click on this linearly out horizontal

12
00:00:50,910 --> 00:00:51,210
here.

13
00:00:51,210 --> 00:00:51,950
OK.

14
00:00:52,680 --> 00:00:55,680
So as you can see here now this takes two views here.

15
00:00:55,890 --> 00:00:58,090
So double click on this text view.

16
00:00:58,350 --> 00:01:09,840
And for the text just type in here through and through and for the ID just typing the XTi through and

17
00:01:10,470 --> 00:01:11,180
through.

18
00:01:11,630 --> 00:01:12,230
OK.

19
00:01:12,390 --> 00:01:19,640
And it's actually tracking two more checkboxes into this linearly horizontal.

20
00:01:19,680 --> 00:01:22,460
So as you can see here we've got this checkbox here.

21
00:01:22,800 --> 00:01:28,590
So just click on this checkbox and then click on this linearly out horizontal here.

22
00:01:28,590 --> 00:01:29,510
OK.

23
00:01:29,760 --> 00:01:33,390
So as you can see here now this checkbox is here.

24
00:01:33,630 --> 00:01:38,320
So double click on the checkbox and for the text just type in here yes.

25
00:01:38,820 --> 00:01:45,740
And for the ID just type in it just type in here see it x true and true.

26
00:01:46,230 --> 00:01:47,480
Yes.

27
00:01:48,330 --> 00:01:49,230
OK.

28
00:01:50,190 --> 00:01:58,550
Let's actually rake in another checkbox into this linearly or horizontal.

29
00:01:58,600 --> 00:02:01,780
So just click on this checkbox here and then put it in.

30
00:02:01,780 --> 00:02:05,520
Inside these are linearly and horizontal and then double click.

31
00:02:05,560 --> 00:02:08,260
And this is a checkbox here.

32
00:02:08,500 --> 00:02:10,930
And for the text just type in here no.

33
00:02:11,290 --> 00:02:18,430
And for the ID just type in here see Edge X through and through.

34
00:02:18,700 --> 00:02:19,840
No.

35
00:02:20,740 --> 00:02:21,360
OK.

36
00:02:21,730 --> 00:02:26,230
And then they actually click and these are linearly out horizontal.

37
00:02:26,320 --> 00:02:33,650
And as you can see here we've got our lay out gravity and we've got this gravity attribute OK.

38
00:02:33,790 --> 00:02:40,390
So just click on this gravity attribute and then open this attribute by just clicking on this little

39
00:02:40,390 --> 00:02:45,920
triangle here and then click on this center horizontal here.

40
00:02:45,970 --> 00:02:47,500
OK check this checkbox.

41
00:02:47,500 --> 00:02:54,170
So as you can see here now are components inside this linearly of horizontal is actually positioned

42
00:02:54,190 --> 00:02:57,240
at the center of this linearly of horizontal OK.

43
00:02:57,340 --> 00:02:59,060
So hopefully that makes sense.

44
00:02:59,140 --> 00:03:06,340
And let's actually go back inside this main activity the job of right here and then let's actually create

45
00:03:06,730 --> 00:03:13,010
some more objects from those components as you can see inside this content underline mean that it may

46
00:03:13,030 --> 00:03:18,220
not examine example we need to actually create a text view and two more checkboxes.

47
00:03:18,220 --> 00:03:18,850
OK.

48
00:03:19,180 --> 00:03:24,780
So inside this main activity that over here I can just type in text view.

49
00:03:25,570 --> 00:03:26,340
OK.

50
00:03:26,470 --> 00:03:27,280
XTi.

51
00:03:27,340 --> 00:03:31,140
True and true.

52
00:03:31,660 --> 00:03:37,780
And then I put an assignment operator here and then I need to cast this object to text through this

53
00:03:37,780 --> 00:03:46,010
view find view by id r that ID that T is the true and true.

54
00:03:46,270 --> 00:03:46,940
OK.

55
00:03:47,530 --> 00:03:53,230
So let's actually create a comment here in order to specify that these components are actually related

56
00:03:53,230 --> 00:03:55,860
to this are true and true.

57
00:03:56,040 --> 00:03:56,450
Text.

58
00:03:56,470 --> 00:03:56,890
OK.

59
00:03:56,980 --> 00:03:59,650
So I can just type in True

60
00:04:02,510 --> 00:04:05,620
and true here.

61
00:04:05,720 --> 00:04:06,250
OK.

62
00:04:06,320 --> 00:04:17,360
And now let's actually create two more checkboxes so I can just type in checkbox see X true and true.

63
00:04:17,600 --> 00:04:18,600
Yes.

64
00:04:19,490 --> 00:04:20,070
OK.

65
00:04:20,210 --> 00:04:26,600
And then I put an assignment operator and then I need to actually cast this object to the checkbox object

66
00:04:27,110 --> 00:04:34,500
and then I just need to type in find the way Id are that Id dot see X true and true.

67
00:04:34,550 --> 00:04:35,410
Yes.

68
00:04:35,930 --> 00:04:36,870
OK.

69
00:04:37,430 --> 00:04:43,610
Again I need to create another checkbox object C H x true and true.

70
00:04:43,900 --> 00:04:55,490
No I put an assignment operator here checkbox find view by id r that Id dot see Edge X true and true.

71
00:04:55,880 --> 00:04:56,370
No.

72
00:04:56,470 --> 00:04:57,570
OK.

73
00:04:58,070 --> 00:05:00,250
So hopefully that makes sense.

74
00:05:01,010 --> 00:05:04,100
So now let's actually work on these components.

75
00:05:04,390 --> 00:05:05,080
OK.

76
00:05:05,180 --> 00:05:10,520
So at the bottom here as you can see we can actually create a comment here.

77
00:05:10,520 --> 00:05:13,960
True and true.

78
00:05:14,810 --> 00:05:15,390
OK.

79
00:05:15,590 --> 00:05:16,570
OK everyone.

80
00:05:16,570 --> 00:05:21,550
Now let's actually create a boolean variable here.

81
00:05:21,560 --> 00:05:30,450
So I just need to type in Boolean OK and then the name of my variable is true and true.

82
00:05:30,980 --> 00:05:36,710
OK and then I need to get an assignment operator here and then I want to actually assign a value to

83
00:05:36,710 --> 00:05:37,630
this value.

84
00:05:37,690 --> 00:05:38,160
OK.

85
00:05:38,240 --> 00:05:41,500
So as you can see the data type of a variable is boolean.

86
00:05:41,540 --> 00:05:45,640
So we need to actually assign a value of type Boolean.

87
00:05:45,680 --> 00:05:53,320
So as a result we can only assign either true or false to this true and true valuable.

88
00:05:53,510 --> 00:05:56,420
So I can't just create a boolean expression here.

89
00:05:56,440 --> 00:06:03,220
OK so I just need to put in a pair of round brackets here and then inside Apprentice's can just type

90
00:06:03,220 --> 00:06:03,950
in true.

91
00:06:04,200 --> 00:06:09,680
And so as you can see here I put in two and are symbols here.

92
00:06:09,680 --> 00:06:10,270
OK.

93
00:06:10,490 --> 00:06:12,260
True and true.

94
00:06:14,180 --> 00:06:14,680
OK.

95
00:06:14,780 --> 00:06:18,110
So as you can see here this is actually a boolean expression.

96
00:06:18,110 --> 00:06:18,750
OK.

97
00:06:18,770 --> 00:06:24,250
And the result of this expression is going to be assigned to this a boolean variable.

98
00:06:24,450 --> 00:06:27,680
Ok so now let's actually create an if statement here.

99
00:06:27,680 --> 00:06:33,140
So if and then say the prentices I need to actually specify the condition.

100
00:06:33,260 --> 00:06:36,050
So true and true.

101
00:06:36,320 --> 00:06:43,210
So as you can see here I specified that if the value of this actual and true value above is true.

102
00:06:43,600 --> 00:06:50,420
OK if the result of this expression is true then that true value is going to be assigned to this variable.

103
00:06:50,420 --> 00:06:50,940
OK.

104
00:06:51,050 --> 00:06:54,150
And if the value of this variable is true.

105
00:06:54,290 --> 00:06:57,410
So as you can see here that's the meaning of this statement here.

106
00:06:57,470 --> 00:07:02,440
If the value of this true and true variable is true.

107
00:07:02,900 --> 00:07:07,280
So now I can actually put in my own codes inside of these curly braces.

108
00:07:07,400 --> 00:07:10,460
So C H x true and true.

109
00:07:10,460 --> 00:07:14,020
Yes that said checked.

110
00:07:14,380 --> 00:07:15,570
True.

111
00:07:16,360 --> 00:07:16,570
OK.

112
00:07:16,580 --> 00:07:24,140
And this means that please if the value of this true and true variable is true then we can actually

113
00:07:24,680 --> 00:07:26,470
check this checkbox here.

114
00:07:26,480 --> 00:07:27,580
As you can see it is.

115
00:07:27,680 --> 00:07:28,960
Yes checkbox.

116
00:07:29,190 --> 00:07:31,450
OK and else.

117
00:07:31,450 --> 00:07:39,570
Else if the value of this true and true variable is not true so it is false.

118
00:07:39,800 --> 00:07:40,890
So I can just put it.

119
00:07:40,910 --> 00:07:44,320
I just need to put in an exclamation mark here.

120
00:07:44,330 --> 00:07:46,370
True and true.

121
00:07:46,550 --> 00:07:50,510
And this means if the value of this true and true value bet is false.

122
00:07:50,510 --> 00:07:53,970
So I can just put in another pair of curly braces here.

123
00:07:54,050 --> 00:08:02,930
So as you can see inside these curly braces I can just type in C H x true and true no dot said checked.

124
00:08:02,930 --> 00:08:04,900
So C is true and true.

125
00:08:05,030 --> 00:08:06,620
No that said check it.

126
00:08:06,620 --> 00:08:07,740
True.

127
00:08:08,420 --> 00:08:08,920
OK.

128
00:08:09,020 --> 00:08:10,580
So hopefully that makes sense.

129
00:08:10,580 --> 00:08:12,460
So now let me actually explain again.

130
00:08:12,680 --> 00:08:19,070
First of all we actually created a boolean valuable named true and true and then we assigned a boolean

131
00:08:19,070 --> 00:08:20,760
expression to this idea.

132
00:08:20,860 --> 00:08:24,710
OK and then we actually created an if statement here.

133
00:08:24,800 --> 00:08:32,900
OK so first of all we specify that if the value of these two and two variable is true and that means

134
00:08:32,930 --> 00:08:39,010
if the value of this expression is true then that true value is going to be assigned to this value.

135
00:08:39,050 --> 00:08:39,660
OK.

136
00:08:39,770 --> 00:08:47,150
And if the value of this variable is true then executes this line of code here and LS If the value of

137
00:08:47,150 --> 00:08:51,270
this variable is not true then execute this line of code here.

138
00:08:51,530 --> 00:08:57,760
And if the value of this true and true variable is false it's going to actually check this a no checkbox

139
00:08:57,800 --> 00:08:58,320
here.

140
00:08:58,580 --> 00:08:59,260
OK.

141
00:08:59,450 --> 00:09:03,710
Because we actually specified that is that C is x true and true.

142
00:09:03,710 --> 00:09:05,170
No that said checked.

143
00:09:05,180 --> 00:09:05,690
True.

144
00:09:05,900 --> 00:09:09,730
So it's true it's true value means it's going to actually check this checkbox.

145
00:09:09,740 --> 00:09:16,380
So remember that I told you then that this checkbox is actually checked the value of the 6 X is true.

146
00:09:16,430 --> 00:09:22,670
And when this checkbox is actually is checked of the value of this checkbox is false.

147
00:09:22,790 --> 00:09:23,470
OK.

148
00:09:23,600 --> 00:09:25,340
So hopefully that makes sense.

149
00:09:25,400 --> 00:09:28,060
And let's actually run our project and see what happens.

150
00:09:28,130 --> 00:09:28,620
OK.

151
00:09:28,700 --> 00:09:32,460
Now as you can see our application is actually running on this emulator.

152
00:09:32,630 --> 00:09:38,200
And as you can see here now this checkbox is checked on OK true and true yes.

153
00:09:38,270 --> 00:09:42,690
And this means that the value of this tool and true valuable is true.

154
00:09:42,710 --> 00:09:45,600
So this line of code is actually get executed.

155
00:09:45,920 --> 00:09:46,490
OK.

156
00:09:46,670 --> 00:09:49,490
C S C H x true and true yes.

157
00:09:49,490 --> 00:09:51,590
So this checkbox that checked.

158
00:09:51,590 --> 00:09:52,190
True.

159
00:09:52,550 --> 00:09:53,080
OK.

160
00:09:53,270 --> 00:09:54,650
So hopefully that makes sense.

