1
00:00:00,480 --> 00:00:03,850
So now let's actually look at this piece of code here.

2
00:00:04,020 --> 00:00:08,710
As you can see I am actually dividing the number of options by two.

3
00:00:09,030 --> 00:00:16,200
So now let me show you the emulator here and now let me show you the of the final version of the application

4
00:00:16,230 --> 00:00:18,080
of our Quiz application.

5
00:00:18,210 --> 00:00:21,020
As you can see here now we have two rows here right.

6
00:00:21,030 --> 00:00:23,390
So now this actually click on these settings here.

7
00:00:23,400 --> 00:00:25,300
Let's go inside the settings activity.

8
00:00:25,710 --> 00:00:31,530
And now let's just click on this number of guesses here as you can see now for example I want to have

9
00:00:31,710 --> 00:00:33,810
sex I guess options right.

10
00:00:33,810 --> 00:00:36,790
I want to have sex just options inside my quiz.

11
00:00:37,050 --> 00:00:41,620
So now let's actually click on it and now it says new changes are applied.

12
00:00:41,640 --> 00:00:45,690
And if I click on dispatch button here at the top as you can see here.

13
00:00:45,750 --> 00:00:48,320
Now we have six guest options here.

14
00:00:48,360 --> 00:00:49,220
Right.

15
00:00:49,380 --> 00:00:58,550
So now as you can see we have free throws we have six guest options and we have free throws.

16
00:00:58,650 --> 00:01:01,260
So in each row we have two buttons.

17
00:01:01,260 --> 00:01:03,110
The first row has two buttons.

18
00:01:03,120 --> 00:01:07,290
The second rule has two buttons and the first row has also two buttons.

19
00:01:07,290 --> 00:01:12,490
So that's why here we are actually dividing this number of just options by two.

20
00:01:12,630 --> 00:01:20,160
So for example if the user wants to have for example only two options then for example two.

21
00:01:20,340 --> 00:01:25,950
Now the number of options here is two right here the value that we get from the share preferences from

22
00:01:25,950 --> 00:01:28,360
these key guesses is going to be two.

23
00:01:28,470 --> 00:01:30,870
So here we are actually dividing two by two.

24
00:01:30,870 --> 00:01:33,570
So two divided by two results in the Value.

25
00:01:33,570 --> 00:01:36,880
Number one right two divided by two is one.

26
00:01:37,020 --> 00:01:42,690
So this means that we are going to actually assign that number one to this number of animals get through.

27
00:01:42,780 --> 00:01:46,180
So the number of animals gets a rose is going to be only one.

28
00:01:46,350 --> 00:01:50,970
And that means that we are going to have only one just throw as you can see here.

29
00:01:51,140 --> 00:01:51,590
Right.

30
00:01:51,630 --> 00:01:54,270
One gets through that has two buttons.

31
00:01:54,300 --> 00:01:56,400
So that's why we actually divided.

32
00:01:56,400 --> 00:01:59,180
Number of options divided by two as he has here.

33
00:01:59,250 --> 00:02:05,280
We actually divide that number of options by two and we assigned the result to this number of animals.

34
00:02:05,290 --> 00:02:06,880
Jethro's.

35
00:02:07,080 --> 00:02:08,740
So hopefully that makes sense.

36
00:02:08,980 --> 00:02:12,370
And now as you can see here we have actually a for loop.

37
00:02:12,540 --> 00:02:18,310
And let's look at this for loop here for linearly out horizontal linear layout.

38
00:02:18,330 --> 00:02:18,890
Right.

39
00:02:18,890 --> 00:02:25,320
So now let me tell you that this Meffert here modified animal guestrooms is going to be executed every

40
00:02:25,320 --> 00:02:28,850
time we actually change the number of guesses here.

41
00:02:29,070 --> 00:02:34,300
Every time we change for example the number of options that we want to have inside our quiz.

42
00:02:34,320 --> 00:02:38,170
So for example we want to have only Fortius options as you can see here.

43
00:02:38,310 --> 00:02:43,180
So in that specific time these are here the Smurfette is going to be executed.

44
00:02:43,200 --> 00:02:47,890
So now as you can see did you see what they did here.

45
00:02:48,100 --> 00:02:50,270
I actually created a break point.

46
00:02:50,300 --> 00:02:56,000
So these are great points and these are actually used when we want to actually debugged the application

47
00:02:56,660 --> 00:02:58,250
in a more advanced way.

48
00:02:58,490 --> 00:03:03,470
But I'll touch on talking more about these breakpoints later but for now if you accidentally create

49
00:03:03,470 --> 00:03:06,770
a break point just a click on it and then it will disappear.

50
00:03:06,770 --> 00:03:07,700
As you can see here.

51
00:03:07,940 --> 00:03:12,180
So now as you can see here we have this method modify animal throws.

52
00:03:12,530 --> 00:03:17,920
And this method is going to be called when everybody use it actually changes the number of U.S. options.

53
00:03:17,960 --> 00:03:22,730
And here as you can see for example when I went over here we have to get options right.

54
00:03:22,730 --> 00:03:26,530
We have actually four I guess options and we have to guess Stroh's as you can see.

55
00:03:26,540 --> 00:03:31,580
So now we want to have sex I guess options and I want to have yes rules.

56
00:03:31,700 --> 00:03:37,120
So I just clicked on the sex here and when I click on dispatch button here as you can see the news is

57
00:03:37,130 --> 00:03:37,950
reset.

58
00:03:38,180 --> 00:03:41,290
And now as you can see we have six options.

59
00:03:41,450 --> 00:03:45,110
So we're able to for example change the number of just options.

60
00:03:45,110 --> 00:03:49,160
First I need to actually delete the previous guest options.

61
00:03:49,160 --> 00:03:54,000
So as again as you can see here now you have six gives options and I want to have for example to get

62
00:03:54,020 --> 00:03:55,770
options right now.

63
00:03:55,790 --> 00:03:59,950
First of all I need to actually delete the previous guest options.

64
00:04:00,020 --> 00:04:06,410
So that's what this for loop here is doing for linear out horizontally nearly out as you can see here.

65
00:04:06,410 --> 00:04:13,040
Now you want to actually to either iterate or the values of this are 8 rows of just spottiness in animalcules.

66
00:04:13,040 --> 00:04:18,680
So this it actually holds those linear layouts that we have inside the Cousteau's horizontal linearly

67
00:04:18,680 --> 00:04:20,970
outs that actually contain buttons.

68
00:04:21,200 --> 00:04:26,780
So horizontal linearly out inside the rows of just buttons in Animal cookies.

69
00:04:27,080 --> 00:04:33,470
And now as you can see here this fall here is going to be executed for each linearly out that we have

70
00:04:33,470 --> 00:04:36,610
inside these eight rows of spottiness in animalcules.

71
00:04:36,620 --> 00:04:42,770
So if you actually scroll to the top here as you can see we actually initialized these rows of just

72
00:04:42,770 --> 00:04:45,350
buttons in animalcules inside the uncreate view.

73
00:04:45,530 --> 00:04:46,190
Right.

74
00:04:46,190 --> 00:04:50,430
So now we are sure that this was like a spottiness is actually initialized.

75
00:04:50,450 --> 00:04:56,600
And when I referred to these rows I guess what as in animal quiz we can actually be sure 100 percent

76
00:04:56,900 --> 00:04:59,200
that this idea is actually initialized.

77
00:04:59,360 --> 00:05:02,550
And then I want to eat right over the values of this grape.

78
00:05:02,570 --> 00:05:09,770
Now I can actually say that horizontal linearly out that set with a visibility view that's gone.

79
00:05:10,040 --> 00:05:17,960
So when I say view that God is going to actually eliminate all those linearly outs that we had in the

80
00:05:17,960 --> 00:05:24,460
previous actually in the previous version in the previous settings right.

81
00:05:24,500 --> 00:05:30,500
So now this is actually updated the number of options now is updated.

82
00:05:30,720 --> 00:05:37,560
But when I actually want to change the number of guest options I need to eliminate all those linear

83
00:05:37,570 --> 00:05:40,890
layouts that had buttons just buttons inside them.

84
00:05:40,890 --> 00:05:46,060
I need to eliminate all of all of those linearly outs and then I can add the new.

85
00:05:46,100 --> 00:05:47,310
I took the options.

86
00:05:47,310 --> 00:05:49,260
Then you asked linearly out.

87
00:05:49,440 --> 00:05:55,430
So first I need to eliminate all those previous layouts so linearly or horizontal linearly out either

88
00:05:55,430 --> 00:05:59,570
right over to the values of these rows of spottiness in any McAleese.

89
00:05:59,730 --> 00:06:03,790
So these are other linearly out of the search visibility view that's gone right.

90
00:06:05,070 --> 00:06:10,890
And then as you can see we have another for loop so this for loop is going to actually put the newest

91
00:06:11,490 --> 00:06:15,530
horizontal linearly out then US guest options into our quiz.

92
00:06:15,570 --> 00:06:17,380
So four in a row.

93
00:06:17,400 --> 00:06:19,240
So as you can see here the row is zero.

94
00:06:19,470 --> 00:06:24,570
And here we created a condition that specifies that how many times this for loop here is going to be

95
00:06:24,570 --> 00:06:25,350
executed.

96
00:06:25,470 --> 00:06:30,800
So until the value of this row is less than the value of this a number of animals guess throws.

97
00:06:30,820 --> 00:06:34,850
So this variable is going to hold the number of throws that we have inside the.

98
00:06:34,860 --> 00:06:35,330
Right.

99
00:06:35,460 --> 00:06:41,130
As you can see we assign a value to this right here but here so low plus plus So here we are saying

100
00:06:41,130 --> 00:06:46,200
that after each execution of this for loop it's going to actually it's going to increment that the value

101
00:06:46,200 --> 00:06:47,920
of this sort of valuable by 1.

102
00:06:48,150 --> 00:06:53,170
So let's actually go inside the curly braces of this for a loop here and let's see what's going on here.

103
00:06:53,340 --> 00:06:56,940
So rows of guess spottiness in animal quiz.

104
00:06:56,970 --> 00:07:03,930
So I am referring to these three rows of buttons in animalcules sup row as you can see here rows of

105
00:07:04,040 --> 00:07:09,270
spot and in animal Sabratha for the first time that this group is going to be executed the value of

106
00:07:09,270 --> 00:07:10,160
this rule is zero.

107
00:07:10,170 --> 00:07:10,760
Right.

108
00:07:10,770 --> 00:07:15,220
So when I say rolls I've just put in as in animalcules Sobero is going actually it's going to go inside

109
00:07:15,240 --> 00:07:21,800
the inside this area and it's going to go inside the first index of this Aure inside index zero of this

110
00:07:21,850 --> 00:07:27,610
array and it's going to call this method and that's a value that is inside of the index 0 of this at

111
00:07:27,610 --> 00:07:32,140
a set visibility view that's visible as you can see here.

112
00:07:32,160 --> 00:07:35,600
Now as you can see this linearly out here is actually visible.

113
00:07:36,940 --> 00:07:40,590
So now hopefully you can understand what that what's going on here.

114
00:07:40,670 --> 00:07:46,720
First we're actually getting the number of guest options that we have inside our activity as you can

115
00:07:46,720 --> 00:07:47,080
see here.

116
00:07:47,080 --> 00:07:51,360
For example two four or six foot now I want to actually for example choose fourth.

117
00:07:51,610 --> 00:07:56,480
And then as you can see here we are actually dividing that value by two.

118
00:07:56,590 --> 00:07:59,550
First I am actually converting that value to an integer value.

119
00:07:59,560 --> 00:08:06,030
And then I am dividing that value by two in order to specify the number of actually gets throws.

120
00:08:06,070 --> 00:08:10,060
So and then we can actually assign that value to this number of animals just throws.

121
00:08:10,090 --> 00:08:18,160
So this variable now holds the number of animals gets ROSS Right and then so four divided by two is

122
00:08:18,190 --> 00:08:20,010
actually two right.

123
00:08:20,100 --> 00:08:24,130
And now this means that the value of this number of animals gastos is two.

124
00:08:24,130 --> 00:08:27,410
So this means that we are going to have to guess rules as you can see here.

125
00:08:27,790 --> 00:08:28,560
Right.

126
00:08:28,630 --> 00:08:33,710
And then first I need to actually eliminate the previous guest options.

127
00:08:33,820 --> 00:08:39,300
So for linearly out horizontal linearly out it's going to iterate over the values of this Aure rows

128
00:08:39,310 --> 00:08:41,700
of good spottiness in Animal cookies.

129
00:08:41,800 --> 00:08:47,380
And then it's going to actually set the visibility of those linear layouts to view that gun.

130
00:08:47,470 --> 00:08:50,240
Right so it's going to actually eliminate all of those.

131
00:08:50,300 --> 00:08:53,230
So just notice that we have viewed that invisible.

132
00:08:53,680 --> 00:08:55,520
And we have view that gun.

133
00:08:55,660 --> 00:09:00,270
When I say view that gun is going I should eliminate all those components inside to use an interface.

134
00:09:00,430 --> 00:09:06,220
And when I say that invisible those components are going to be dead inside that use an interface.

135
00:09:06,220 --> 00:09:08,410
But the user cannot see them.

136
00:09:08,410 --> 00:09:16,030
And when I say view that gun is going to eliminate all those user interfaces all those actually components

137
00:09:16,030 --> 00:09:17,390
inside the user interface.

138
00:09:17,530 --> 00:09:18,120
Right.

139
00:09:18,130 --> 00:09:19,580
So horizontally nearly out.

140
00:09:19,710 --> 00:09:26,600
That said visibility review that's gone and then it's going to actually put the newest linearly out

141
00:09:26,600 --> 00:09:28,880
to the USGS options into the screen.

142
00:09:28,930 --> 00:09:34,870
So for in throw until the value of this throw is less than the number of animals gets close and then

143
00:09:34,870 --> 00:09:39,090
it's going to actually add one value to the value of this row after each execution of this fall.

144
00:09:39,220 --> 00:09:43,700
And then we call this Arev rules of guess spottiness in animalcules Sobero.

145
00:09:43,900 --> 00:09:45,890
That a visibility view that visible.

146
00:09:46,120 --> 00:09:47,240
Right.

147
00:09:47,260 --> 00:09:49,630
So hopefully that makes sense.

148
00:09:49,630 --> 00:09:56,080
And now as you can see this is our Actually method for modifying the guests rose.

149
00:09:56,130 --> 00:10:00,370
We need to actually call other methods for example as you can see if I go inside the settings activity

150
00:10:00,630 --> 00:10:04,380
we need to actually provide a logic for this option for this item.

151
00:10:04,420 --> 00:10:07,500
Animals the type of the animals that we want to have inside the crease.

152
00:10:07,690 --> 00:10:12,590
So now let's actually create a method for that here inside this class.

