1
00:00:00,300 --> 00:00:05,500
So as you can see here these are the lines of code that I pasted here.

2
00:00:05,730 --> 00:00:07,330
So we have our method.

3
00:00:07,500 --> 00:00:11,760
And as you can see today the access modifier of this method is private.

4
00:00:11,760 --> 00:00:18,630
The return type of the Smurfette is void and the name of this method is disable cookies spottiness.

5
00:00:18,630 --> 00:00:24,340
So the purpose of this Smurfit is actually to disable the quiz spottiness right.

6
00:00:24,530 --> 00:00:28,050
So as you can see here this method doesn't accept any arguments.

7
00:00:28,110 --> 00:00:33,540
So let's actually go inside the curly braces of the Smurfette And let's see what's going on here.

8
00:00:33,540 --> 00:00:35,390
So as you can see we have a for loop here.

9
00:00:35,400 --> 00:00:36,840
Right.

10
00:00:36,890 --> 00:00:42,680
And this fall of here I actually created of the habit of type integer and the name is row.

11
00:00:42,870 --> 00:00:46,520
And then initially I assigned the value 0 to this rally.

12
00:00:46,980 --> 00:00:53,250
And here I actually created a condition that actually determines how many times this for loop here is

13
00:00:53,250 --> 00:00:54,610
going to be executed.

14
00:00:54,840 --> 00:01:01,110
So until the value of this the row here is actually less than the value of this number of animals gets

15
00:01:01,110 --> 00:01:01,940
grows.

16
00:01:01,950 --> 00:01:08,550
So if I scroll to the top here as you can see inside this classman activity fragment we actually declared

17
00:01:08,790 --> 00:01:09,990
this variable here.

18
00:01:09,990 --> 00:01:11,920
Number of animals guess Rose.

19
00:01:12,060 --> 00:01:12,730
Right.

20
00:01:12,900 --> 00:01:14,550
Which is actually after integer.

21
00:01:14,550 --> 00:01:20,090
So this variable is going to actually hold the number of rows that we have inside our quiz.

22
00:01:20,190 --> 00:01:20,760
Right.

23
00:01:20,760 --> 00:01:22,830
So now let me show you the emulator.

24
00:01:22,830 --> 00:01:28,170
So as you can see here our application is running on the simulator and here as you can see we have a

25
00:01:28,180 --> 00:01:29,760
free guestrooms right.

26
00:01:29,880 --> 00:01:37,050
So this variable here is actually expected to hold the number of animals Jethro's right.

27
00:01:37,080 --> 00:01:39,610
We have free throws and six buttons.

28
00:01:39,940 --> 00:01:44,970
And now if you click on these settings here as you can see we have number of guesses right.

29
00:01:44,970 --> 00:01:52,140
So here we can actually determine that how many buttons that we want to be included in the quiz for

30
00:01:52,140 --> 00:01:52,230
us.

31
00:01:52,290 --> 00:01:53,990
For example for buttons.

32
00:01:54,300 --> 00:01:57,420
And if I click on this back button here at the top as you can see.

33
00:01:57,420 --> 00:02:02,070
Now we have two guests throws right to just rules that actually include that.

34
00:02:02,070 --> 00:02:05,080
Each of them include two buttons.

35
00:02:05,130 --> 00:02:10,260
The first row actually as as you can see here the first row contains two buttons.

36
00:02:10,350 --> 00:02:13,710
And the second row here actually contains two buttons.

37
00:02:13,710 --> 00:02:20,020
So and this variable is deter is actually expected to hold the number of guests.

38
00:02:20,040 --> 00:02:22,500
So here we have to guess rules.

39
00:02:22,560 --> 00:02:26,930
So let's actually scroll down here and now inside the Smurfette.

40
00:02:27,060 --> 00:02:32,910
I actually think I'm saying that until the value of this low value is actually less than the number

41
00:02:32,910 --> 00:02:38,140
of animals gets throws then it's going I to execute this follow up here and here.

42
00:02:38,220 --> 00:02:44,460
And finally here I am actually saying that after each execution of this follow up increment the value

43
00:02:44,460 --> 00:02:47,630
of this roll a variable by one.

44
00:02:47,790 --> 00:02:48,410
OK.

45
00:02:48,570 --> 00:02:52,160
So let's actually go inside is follow up and let's see what's going on here.

46
00:02:52,170 --> 00:02:59,940
First of all in line number 100 an 89 as you can see we have actually our variable of type linear layout

47
00:03:00,540 --> 00:03:07,860
and the name of this rowdier but is just a row linearly out or if it's an assignment operator here and

48
00:03:07,860 --> 00:03:11,660
then here as you can see I am actually referring to the name of this variable.

49
00:03:11,660 --> 00:03:18,950
The rows of guest buttons in animalcules right rows of buttons in animalcules.

50
00:03:18,960 --> 00:03:21,970
So now let's actually scroll to the top here.

51
00:03:22,260 --> 00:03:29,110
As you can see inside this class I actually declare this variable here in line number 51.

52
00:03:29,220 --> 00:03:33,530
As you can see here we have an array of linear layouts here.

53
00:03:33,540 --> 00:03:34,020
Right.

54
00:03:34,050 --> 00:03:39,360
And Arey of linearly outs and then Aimee's rows of spottiness in animal queries.

55
00:03:39,780 --> 00:03:47,360
And here in line I should be in insights uncreate view Mefford we actually initialized this lose of

56
00:03:47,550 --> 00:03:53,670
spottiness valuable sort of rows of spottiness in any Mercuries assignment operator new linearly out

57
00:03:53,820 --> 00:03:54,460
free.

58
00:03:54,720 --> 00:04:01,640
So this is actually is going to hold our free values of type linearly out.

59
00:04:01,650 --> 00:04:05,300
So this is that this is actually the size of this Arey free.

60
00:04:05,730 --> 00:04:09,850
And then here as you can see in lines of 79 flew 81.

61
00:04:10,060 --> 00:04:13,290
He had actually initialising up this at 8.

62
00:04:13,290 --> 00:04:21,030
For example inside as you can see this inside the index zero of this Auret we want to actually put this

63
00:04:21,030 --> 00:04:24,950
value first throw linearly out inciting the x number of one of these already.

64
00:04:25,110 --> 00:04:30,650
We want to assign second rule in linearly out and inside the index number to have this and we want to

65
00:04:30,660 --> 00:04:32,750
assign first row linearly.

66
00:04:32,880 --> 00:04:35,250
So we already initialized this arey.

67
00:04:35,280 --> 00:04:36,110
Right.

68
00:04:36,120 --> 00:04:42,360
So unless I actually scroll down here as you can see here I am saying that rows of just spottiness in

69
00:04:42,470 --> 00:04:48,340
animalcules which is actually an array sup row right.

70
00:04:48,350 --> 00:04:49,610
So for example.

71
00:04:49,730 --> 00:04:51,620
Now let me show you the emulator here.

72
00:04:51,620 --> 00:04:57,770
Let's actually click on the Settings button and number of guesses for example to get this right to number

73
00:04:57,770 --> 00:04:59,420
of actually just options.

74
00:04:59,420 --> 00:05:02,620
If I actually click on Patch button here at the top.

75
00:05:02,690 --> 00:05:06,670
Now as you can see here we have only two buttons and one gets through.

76
00:05:06,800 --> 00:05:08,100
So what does this mean.

77
00:05:08,120 --> 00:05:13,730
This means that here I actually created a full upright and he had this four loops says that until the

78
00:05:13,730 --> 00:05:18,720
value of the stroke which is actually zero is less than number of animals just throws.

79
00:05:18,800 --> 00:05:21,330
So as you can see here we have only one through.

80
00:05:21,330 --> 00:05:23,660
So this value is number one right.

81
00:05:23,690 --> 00:05:25,470
So 0 is less than number one right.

82
00:05:25,490 --> 00:05:28,890
So this follow up here is going to be executed now.

83
00:05:29,110 --> 00:05:38,440
And now here in line number 100 an 89 it we actually created a variable of type linearly out guess linearly

84
00:05:38,450 --> 00:05:39,220
out right.

85
00:05:39,350 --> 00:05:44,010
Assignment operator rows of guess spottiness in animalcules.

86
00:05:44,060 --> 00:05:45,050
So these are 8.

87
00:05:45,080 --> 00:05:51,520
Now actually contains this row here as you can see we have only one row here that contains two buttons

88
00:05:51,530 --> 00:05:52,960
right now.

89
00:05:52,970 --> 00:05:54,590
These are a later.

90
00:05:54,590 --> 00:06:01,160
I'll actually show you here we haven't still puts the lines of code that are related to there actually

91
00:06:01,630 --> 00:06:03,190
are two.

92
00:06:03,620 --> 00:06:12,770
Adding or actually removing rows of buttons rows of just buttons and later I will show you that when

93
00:06:12,800 --> 00:06:14,630
I went they're going to.

94
00:06:14,660 --> 00:06:18,710
And we want to actually for example a change the number of guesses.

95
00:06:18,800 --> 00:06:24,690
But for now just know that here this a is going to hold that that gets through.

96
00:06:24,860 --> 00:06:26,680
So here we have only one guess rule.

97
00:06:27,020 --> 00:06:32,800
And here is Suppe row and this means for example now the value of this low is zero right.

98
00:06:32,840 --> 00:06:37,820
So it's going to go inside this Arey and it's going to actually get a value that is inside of the index

99
00:06:37,820 --> 00:06:38,280
0.

100
00:06:38,330 --> 00:06:43,260
So this row here as you can see is inside the index 0 right.

101
00:06:43,430 --> 00:06:46,370
And it's going to assign that role to this role in your layout.

102
00:06:46,490 --> 00:06:52,030
As you can see here and then here we have another for loop.

103
00:06:52,100 --> 00:06:57,400
So for it bought an index so now we want to actually go inside this classroom here.

104
00:06:57,410 --> 00:07:01,080
And we want to access these buttons inside this linearly out.

105
00:07:01,080 --> 00:07:05,160
So for it but an index assignment operator to zero.

106
00:07:05,540 --> 00:07:12,400
So here we created another variable and we assign the value 0 initially to the spot an index variable.

107
00:07:12,740 --> 00:07:18,510
And then here as you can see we created a condition that actually determines how many times this fall

108
00:07:18,610 --> 00:07:20,590
here is going to be executed.

109
00:07:20,600 --> 00:07:27,320
So until the value of the Spartan index as you can see here is less than the value of this just throw

110
00:07:27,360 --> 00:07:29,140
linearly out as you can see here.

111
00:07:29,150 --> 00:07:31,290
This gets through here right.

112
00:07:31,420 --> 00:07:37,250
Get child count get child count means the children of this linearly out which are actually that is two

113
00:07:37,250 --> 00:07:38,180
buttons right.

114
00:07:38,300 --> 00:07:42,630
These two buttons are actually the children of that linear layout.

115
00:07:42,710 --> 00:07:43,730
Right.

116
00:07:43,730 --> 00:07:53,300
So now as you can see just scroll linearly out that get child count button index plus plus.

117
00:07:53,300 --> 00:07:59,430
So here are they finally you are actually saying that are after effects each execution of this follow

118
00:07:59,420 --> 00:08:01,710
up increment the value of the spot an index.

119
00:08:01,760 --> 00:08:04,520
So the button index Z is 0 right.

120
00:08:04,520 --> 00:08:06,440
So now it's going to actually go inside this loop.

121
00:08:06,500 --> 00:08:08,420
So just throw linearly out.

122
00:08:08,420 --> 00:08:13,200
So here I am referring to this gets through linear layouts that actually holds this linearly out here

123
00:08:13,220 --> 00:08:13,490
right.

124
00:08:13,490 --> 00:08:19,040
This row gets thrown linearly out that get child at.

125
00:08:19,040 --> 00:08:23,270
So it can actually go inside this row get child at bottom index.

126
00:08:23,300 --> 00:08:25,920
So the pattern index is zero right.

127
00:08:26,000 --> 00:08:31,560
So now we can actually get this birth button this button but an index is now 0.

128
00:08:31,790 --> 00:08:38,630
So this button here this actually this birth the button is inside the index 0 of this linear left right

129
00:08:39,020 --> 00:08:42,250
disrobe button index that set enable to false.

130
00:08:42,290 --> 00:08:44,620
So it can actually disable this button.

131
00:08:45,860 --> 00:08:46,840
Right.

132
00:08:46,890 --> 00:08:53,310
And after after executing this for Lapeer is going to try to increment the value of the Spartan index

133
00:08:53,310 --> 00:08:54,060
by Yvonne.

134
00:08:54,120 --> 00:08:56,400
So now the value of what an index is 1.

135
00:08:56,400 --> 00:08:57,130
Right.

136
00:08:57,150 --> 00:09:00,750
So number one is actually less than two.

137
00:09:00,750 --> 00:09:05,110
So as you can see here this row here actually contains two buttons right.

138
00:09:05,190 --> 00:09:11,760
So now button index is actually less than the value of the Get child count of this just rolling out

139
00:09:12,130 --> 00:09:12,910
right.

140
00:09:12,990 --> 00:09:14,440
One is less than two.

141
00:09:14,850 --> 00:09:16,360
And then it's going to again.

142
00:09:16,350 --> 00:09:19,920
It's the cutest thing I've got here it gets through linearly out that child.

143
00:09:19,960 --> 00:09:24,050
But index for about an index now is number one that's set enabled.

144
00:09:24,060 --> 00:09:28,970
So the button here holds is inside the index number one of this row.

145
00:09:29,130 --> 00:09:30,560
So that set enable false.

146
00:09:30,570 --> 00:09:33,710
So it can actually disable this spot in here.

147
00:09:34,020 --> 00:09:38,760
And after that it's going to increment the value of the button indexed by one.

148
00:09:38,760 --> 00:09:41,570
So now the value of this spot an index is two.

149
00:09:41,850 --> 00:09:47,410
And then again it's going to take this condition here so to is not less than the value of this just

150
00:09:47,550 --> 00:09:54,720
linearly out just throw linearly that get child child child because number two is not less than two.

151
00:09:54,720 --> 00:09:57,760
We have two buttons and number two is that is not less than two.

152
00:09:57,870 --> 00:10:00,400
So it's not going to execute this follow up here any more.

153
00:10:00,450 --> 00:10:04,600
As you can see here and it's going to go again to the top here.

154
00:10:04,710 --> 00:10:08,870
It's going to increments the value of this law by what you want.

155
00:10:08,880 --> 00:10:10,500
So here we have only one rule.

156
00:10:10,620 --> 00:10:11,280
OK.

157
00:10:11,400 --> 00:10:15,030
So here now the value of this rule is one.

158
00:10:15,030 --> 00:10:19,050
And number one is not less than number of animals kestrels as you can see here.

159
00:10:19,110 --> 00:10:20,650
We have only one guess through.

160
00:10:20,670 --> 00:10:22,140
So one is not less than one.

161
00:10:22,350 --> 00:10:25,570
And that it's not going to actually execute this for loop here anymore.

162
00:10:25,880 --> 00:10:28,930
And this method here is not going to be executed.

163
00:10:29,160 --> 00:10:35,030
So now as you can see here this is how this effort works in this way we can actually disable our guest

164
00:10:35,090 --> 00:10:36,590
Spartans.

165
00:10:36,630 --> 00:10:43,070
It doesn't really matter that how many good options that we have this method here that we created is

166
00:10:43,070 --> 00:10:45,620
going to actually do that job for us.

167
00:10:45,750 --> 00:10:48,130
So hopefully that makes sense.

168
00:10:48,180 --> 00:10:54,280
And now we need to actually provide another method here as you can see if I scroll to the top here.

169
00:10:54,640 --> 00:10:58,890
Inside this listener we actually provided some of these methods.

170
00:10:58,890 --> 00:11:06,810
For example just get the exact animal name and disable quis guest buttons and we also need to provide

171
00:11:06,860 --> 00:11:11,520
the Smurfette here research animal quiz and animate animal quiz.

172
00:11:11,800 --> 00:11:16,860
So now let's actually create this reset animalcules here inside this class.

173
00:11:16,860 --> 00:11:22,830
So I'm going actually pasting some lines of code here and then I'm going to explain to you what's going

174
00:11:22,830 --> 00:11:23,590
on here.

