1
00:00:00,600 --> 00:00:06,570
So now I'm going to paste in some lines of code here and then I'm going to explain to you what's going

2
00:00:06,570 --> 00:00:07,640
on here.

3
00:00:08,130 --> 00:00:12,590
So as you can see here these are the lines of code that I pasted here.

4
00:00:12,660 --> 00:00:16,220
Right now I'm going to explain to you what's going on here.

5
00:00:16,320 --> 00:00:17,290
Exactly.

6
00:00:17,490 --> 00:00:23,280
So now let's actually look at RMF at here as you can see if we have actually a method and the access

7
00:00:23,280 --> 00:00:29,670
modifiers of the Smurfette is public the return type of this method is void and the name of the Smurfette

8
00:00:29,670 --> 00:00:31,770
is modified by different colored.

9
00:00:31,770 --> 00:00:32,360
Right.

10
00:00:32,640 --> 00:00:38,700
And as you can see this method accepts one argument of type shared preferences and the name of this

11
00:00:38,700 --> 00:00:41,030
argument is shared preferences.

12
00:00:41,070 --> 00:00:46,380
So let's actually go inside the curly braces of the Smurfette And let's see what's going on here.

13
00:00:46,770 --> 00:00:53,130
So in line number four hundred and seventy three as you can see if we have actually of the bell and

14
00:00:53,130 --> 00:00:59,460
the name of this variable is actually back in color and the date or type of this variable is string.

15
00:00:59,820 --> 00:01:06,630
And then I put an assignment operator here and then I referred to the name of this argument shared preferences

16
00:01:06,780 --> 00:01:08,820
that gets strange.

17
00:01:08,820 --> 00:01:12,120
So here I'm actually calling this method and this is shared preferences.

18
00:01:12,240 --> 00:01:16,900
Main activity does cuius underline it and underline color.

19
00:01:17,010 --> 00:01:22,530
So here I am actually calling this constant that we have inside the main activity our job.

20
00:01:22,710 --> 00:01:26,560
So now let's actually go inside the main activity that are filed here as you can see here.

21
00:01:26,580 --> 00:01:30,980
Inside this class main activity we have this key here right.

22
00:01:30,990 --> 00:01:35,660
Public static final sprint cuius on the line Bigler underline color.

23
00:01:35,670 --> 00:01:42,120
So this is actually a constant that holds this cheap as you can see here of actually assigned this value

24
00:01:42,120 --> 00:01:44,430
which is of types 3 into this constant.

25
00:01:44,430 --> 00:01:49,380
So this is the key settings underline quis Underland by going on on the line color.

26
00:01:49,380 --> 00:01:53,150
So if I actually go inside the class Underland preferences that is then on file.

27
00:01:53,220 --> 00:01:57,120
Now you can see that we have actually at least preference here.

28
00:01:57,240 --> 00:01:58,110
Right.

29
00:01:58,680 --> 00:02:02,250
And the entries is actually at site a slash colors.

30
00:02:02,370 --> 00:02:05,390
And if I actually hold the command key on my keyboard.

31
00:02:05,430 --> 00:02:09,930
So if you are using a Windows machine just hold the control on your keyboard and then click on this

32
00:02:10,230 --> 00:02:14,820
value here as you can see we have this stunning area here.

33
00:02:14,850 --> 00:02:16,690
So here we have the colors.

34
00:02:16,710 --> 00:02:21,190
So as you can see here this value is the value that we specify here as the entries.

35
00:02:21,210 --> 00:02:21,800
Right.

36
00:02:21,870 --> 00:02:27,090
So now as you can see we have these values and these are the values that we're going to show to the

37
00:02:27,090 --> 00:02:27,660
user.

38
00:02:27,870 --> 00:02:33,360
And if we actually show you the emulator here and if I actually click on these settings here now if

39
00:02:33,360 --> 00:02:39,180
I click on these two specular color as you can see we are actually showing these values white black

40
00:02:39,240 --> 00:02:43,500
green red blue yellow as the values that you want to show to the user.

41
00:02:43,590 --> 00:02:49,660
And now let's go back inside our quiz on the alleged preferences that exemplified and for the interest

42
00:02:49,730 --> 00:02:55,560
values the also refers to this value as sign is an a slash colors.

43
00:02:55,590 --> 00:03:00,600
So if we actually hold the comment on my keyboard and then click on this value here as you can see again

44
00:03:00,840 --> 00:03:07,710
we are again using these values as the actually exact values that we want to actually work with.

45
00:03:07,740 --> 00:03:08,230
Right.

46
00:03:08,370 --> 00:03:10,780
So we actually have these values.

47
00:03:10,830 --> 00:03:13,830
White black green red blue yellow.

48
00:03:14,190 --> 00:03:17,980
And let's actually go back into our quiz underline preferences that exemplified.

49
00:03:18,240 --> 00:03:24,700
And the key is settings underline quick underline Bagenal underline color and the title is this value

50
00:03:24,740 --> 00:03:25,620
to going on color.

51
00:03:25,620 --> 00:03:30,930
So if I actually hold the comment on my keyboard and if you are using a Windows machine just hold the

52
00:03:30,930 --> 00:03:35,730
control on your keyboard and then click on this value as you can see we have this value here too.

53
00:03:35,760 --> 00:03:37,110
Back at non-color.

54
00:03:37,170 --> 00:03:42,760
So let's go back into our quiz Underland preferences them and find if we have this summary.

55
00:03:42,840 --> 00:03:48,690
We have persistence which is actually true and the default value is a value that is specified inside

56
00:03:48,690 --> 00:03:50,650
this string that XML file.

57
00:03:50,820 --> 00:03:53,990
So now let's actually hold the Comanche on our keyboard.

58
00:03:54,000 --> 00:03:58,080
So if you are using a Windows machine just hold the control on your keyboard and then click on these

59
00:03:58,080 --> 00:04:00,420
different colored black as you can see.

60
00:04:00,420 --> 00:04:06,170
Now I actually created this string the source inside these strings that exemplified.

61
00:04:06,180 --> 00:04:09,890
And now you can see the value which is actually the black color right.

62
00:04:09,900 --> 00:04:15,300
So now if I go back into the squeeze underline preferences for example file you can see that we have

63
00:04:15,300 --> 00:04:21,810
this list preference here and we can actually interact with this preference by using this key here that

64
00:04:21,870 --> 00:04:23,380
you specify here right.

65
00:04:23,610 --> 00:04:26,910
So let's go back into our main activity fragment that of a file.

66
00:04:27,590 --> 00:04:35,310
And now you can see that we are actually getting these values shared preferences that get strange you

67
00:04:35,340 --> 00:04:40,680
are getting the value by using this key you are getting the value that is actually saved through the

68
00:04:40,680 --> 00:04:42,870
shared preference shares preferences.

69
00:04:42,870 --> 00:04:48,860
For example the value can be for example Blache the value can be white green red blue yellow.

70
00:04:48,990 --> 00:04:54,120
So if you are getting that value by using this key main activity that quiz Underland by an underlined

71
00:04:54,120 --> 00:05:01,440
color and for the default value of the past the value not because we actually actually specified a default

72
00:05:01,440 --> 00:05:05,400
value inside the squeeze preferences that examined file you can see this value here right.

73
00:05:05,520 --> 00:05:08,150
So we don't need to specify that value here.

74
00:05:08,220 --> 00:05:13,500
So we passed the value not for the second argument and here it can actually assign that value to the

75
00:05:13,560 --> 00:05:15,770
background color which is of type string.

76
00:05:16,050 --> 00:05:22,360
And now I actually created a switch statement and I want to actually switch between the values of respect

77
00:05:22,460 --> 00:05:23,750
and color.

78
00:05:23,760 --> 00:05:24,780
So sweet.

79
00:05:24,840 --> 00:05:29,040
And now let's actually go inside the curly braces of the switch statement and let's see what's going

80
00:05:29,040 --> 00:05:29,950
on here.

81
00:05:29,970 --> 00:05:32,340
So if you have subcase statements here.

82
00:05:32,340 --> 00:05:38,840
Here we are saying that case white and this means that if the value of this by green color valuable

83
00:05:38,850 --> 00:05:41,880
which is actually off the upstreams is white right.

84
00:05:41,910 --> 00:05:47,300
If the value of this Speigel uncolored is white then it's going to execute these lines of code here.

85
00:05:47,400 --> 00:05:53,610
First it's going to set a background color of the animalcules linearly out here to white.

86
00:05:53,610 --> 00:05:59,610
So animal Quizon initially out that set back in on color color that white and then here we are actually

87
00:05:59,610 --> 00:06:04,670
iterating over them actually over the bottoms that we have inside our cookies.

88
00:06:04,680 --> 00:06:08,940
So let me actually show you the emulator for example now if you want to change the background color

89
00:06:08,940 --> 00:06:12,540
to white right and now it says the new changes are applied.

90
00:06:12,670 --> 00:06:18,360
And if I click on the spike back button here at the top as you can see now the Paglen color is white

91
00:06:18,440 --> 00:06:19,050
right.

92
00:06:19,080 --> 00:06:24,420
So here we can see the Bagian and color of the buttons as you can see here is blue.

93
00:06:24,690 --> 00:06:29,550
So here and the text of the buttons is actually white.

94
00:06:29,640 --> 00:06:35,630
So now we are actually either over these buttons so linearly of all rows of just spottiness in animal

95
00:06:35,650 --> 00:06:41,100
cuius So it is actually either reading over the values of this trait which which actually holds the

96
00:06:41,100 --> 00:06:43,320
values of linearly out.

97
00:06:43,350 --> 00:06:46,050
And then here we have this for loop here.

98
00:06:46,290 --> 00:06:51,090
And it is actually again it's going to go inside the rows of those buttons and it's going to actually

99
00:06:51,090 --> 00:06:54,950
get the columns which is actually there at the bottom that we have here.

100
00:06:55,200 --> 00:07:01,140
So for columns 0 and this loop here is going to be executed until the value of this column is less than

101
00:07:01,140 --> 00:07:03,840
the value of the child count of that row.

102
00:07:03,900 --> 00:07:09,870
So as you can see here and it's going actually increments the value of this column by 1 each time.

103
00:07:09,950 --> 00:07:12,090
After each execution of this fall.

104
00:07:12,420 --> 00:07:16,130
So here as you can see we are actually getting the bottom inside that specific row.

105
00:07:16,260 --> 00:07:22,770
So Button button here we created our variable of type button and the name is button assignment operator.

106
00:07:23,430 --> 00:07:27,280
And then he realized we are actually testing this object a button object.

107
00:07:27,370 --> 00:07:31,730
And here we are referring to the row that get child at column.

108
00:07:31,890 --> 00:07:32,190
Right.

109
00:07:32,190 --> 00:07:35,850
So in this way we can actually access this button for example.

110
00:07:36,060 --> 00:07:40,980
And then it can actually set the background color of the button to color that blue as you can see.

111
00:07:40,980 --> 00:07:45,780
And here we are setting the text colored off that button to color that white.

112
00:07:45,780 --> 00:07:51,570
And here after this will appear as you can see after the ending curly brace of this world we are setting

113
00:07:51,570 --> 00:07:52,480
some other ideas.

114
00:07:52,570 --> 00:07:55,800
TH The answer that text the text color color that blue.

115
00:07:55,800 --> 00:07:59,430
So here if we actually just the name of this animal for example.

116
00:07:59,430 --> 00:08:03,620
And now as you can see the color is blue the color of the answer is blue right.

117
00:08:03,640 --> 00:08:09,510
To actually answer the text color color that blue she asks the question number the text color color

118
00:08:09,510 --> 00:08:10,920
that black light.

119
00:08:10,920 --> 00:08:14,070
So it can actually set the color actually.

120
00:08:14,070 --> 00:08:21,490
Question number two black and now it's going to have actually a break statement.

121
00:08:21,660 --> 00:08:23,590
And we have also this case black.

122
00:08:23,590 --> 00:08:29,520
So if the value of this valuable baculum color is actually black then it's going to execute this case

123
00:08:29,520 --> 00:08:30,200
statement.

124
00:08:30,190 --> 00:08:32,530
These lines of code inside this case statement.

125
00:08:32,880 --> 00:08:37,970
And now as you can see it's going to actually set the background color of this animal cuius linearly

126
00:08:37,970 --> 00:08:43,920
out to Blache as you can see animal quizz linearly out that set by different color colors that black.

127
00:08:44,160 --> 00:08:49,470
And that here again we actually created a for loop in order to eat right over the values or there actually

128
00:08:49,650 --> 00:08:52,060
values of these laws of spottiness in animal cuius.

129
00:08:52,080 --> 00:08:56,700
So it's going to eat right over them proteins that we have inside our crews as you can see here.

130
00:08:57,060 --> 00:09:01,590
And we actually created a for loop and inner for loop in order to access those buttons.

131
00:09:01,590 --> 00:09:06,090
So again we are actually accessing that button inside that specific row.

132
00:09:06,390 --> 00:09:09,060
And we are actually sitting in the back of the uncolored to yellow.

133
00:09:09,060 --> 00:09:11,740
So let's actually change that I get from color to black.

134
00:09:12,060 --> 00:09:16,450
So by your own color black and now it says new changes are applied.

135
00:09:16,470 --> 00:09:20,120
And if I actually click on the spike button here as you can see the back in uncolored is black.

136
00:09:20,120 --> 00:09:20,650
Right.

137
00:09:20,910 --> 00:09:25,920
So now I can actually set the background color of the buttons to yellow as you can see here.

138
00:09:25,920 --> 00:09:29,130
So a button that said Get on colored colored yellow.

139
00:09:29,490 --> 00:09:34,500
And as you can see if you are sitting there in cut the text color excuse me you are sitting just takes

140
00:09:34,500 --> 00:09:40,070
the color of this button to color that black as you can see here the text color of these buttons is

141
00:09:40,080 --> 00:09:42,070
actually a black right.

142
00:09:42,360 --> 00:09:47,490
And finally we are sitting there thinking the answer to color that white as you can see here.

143
00:09:47,520 --> 00:09:53,340
So if you take just the name of this animal here Dalfin now it says now as you can see here the text

144
00:09:53,340 --> 00:09:54,350
color is white.

145
00:09:54,630 --> 00:10:01,230
And of course that takes the question number and color to test the question number that takes color

146
00:10:01,230 --> 00:10:02,640
to color that white.

147
00:10:02,970 --> 00:10:08,420
And here we have a press statement and we hear we have chased green as you can see here.

148
00:10:08,420 --> 00:10:14,160
So if the value of it is valuable as you can see if the value of this by your own color rowdier is actually

149
00:10:14,160 --> 00:10:14,780
green.

150
00:10:15,090 --> 00:10:17,700
Now is going to execute these lines of code here.

151
00:10:18,030 --> 00:10:19,200
As you can see.

152
00:10:19,200 --> 00:10:23,400
So first it's going to actually set the background and color to green.

153
00:10:23,400 --> 00:10:27,680
So animal cuisine linearly out that set by green color color that's green.

154
00:10:27,680 --> 00:10:29,420
So now let me show you the emulator.

155
00:10:29,480 --> 00:10:31,660
Now let's get you to go inside the city's activity.

156
00:10:32,090 --> 00:10:35,230
And now let's actually go and select this truth.

157
00:10:35,240 --> 00:10:38,360
Back in color and just select green.

158
00:10:38,770 --> 00:10:44,570
Now liturgically can dispatch button here at the top as you can see now the background color is green.

159
00:10:44,610 --> 00:10:50,490
And here we have a full look and here it's going to either read all the values that we have inside these

160
00:10:50,730 --> 00:10:52,300
rows of just buttons in animal keys.

161
00:10:52,310 --> 00:10:55,780
So it's going to iterate over the laws that we have inside the squeeze.

162
00:10:56,040 --> 00:11:00,780
And here we have an inner for loop and this inner for loop is going to iterate over the columns that

163
00:11:00,780 --> 00:11:02,190
we have inside these rows.

164
00:11:02,340 --> 00:11:05,110
So these buttons are actually the columns right.

165
00:11:05,130 --> 00:11:11,970
So for in column and this for a of here is going to be executed until the value of this column is less

166
00:11:11,970 --> 00:11:14,310
than the value of the trial count of the throw.

167
00:11:14,580 --> 00:11:19,500
And it's going to add one value for the value of this color variable after each of each execution of

168
00:11:19,500 --> 00:11:20,380
this for loop.

169
00:11:20,400 --> 00:11:26,020
And here we are actually creating a reference to those buttons that we have here inside these rows.

170
00:11:26,040 --> 00:11:31,350
So bottom part in here we created read a bit of a button and then I put an assignment operator here

171
00:11:31,650 --> 00:11:36,630
and here you are casting this object a button object row that good child column.

172
00:11:36,780 --> 00:11:40,500
And here we are setting the background color to blue as you can see here the background and color of

173
00:11:40,500 --> 00:11:42,350
the buttons as you can see here is blue.

174
00:11:42,390 --> 00:11:48,030
And here we are setting the text color of the buttons to white color that actually white as you can

175
00:11:48,030 --> 00:11:48,380
see here.

176
00:11:48,390 --> 00:11:54,300
But in the text color color that white as you can see here and here finally we are sitting.

177
00:11:54,570 --> 00:11:58,110
Actually take the color of the text the answer to color that white.

178
00:11:58,110 --> 00:12:01,210
So now let me guess the name of this animal as you can see here.

179
00:12:01,290 --> 00:12:04,080
Th the answer colored is actually white right.

180
00:12:04,080 --> 00:12:09,960
Take the takes color of the states and is white and that here is the question number that takes color

181
00:12:09,960 --> 00:12:12,420
is actually color that yellow here is white.

182
00:12:12,420 --> 00:12:19,500
But for our for our own application I chose the value yellow and that I put a brave statement here and

183
00:12:19,500 --> 00:12:21,190
here we have case blue.

184
00:12:21,300 --> 00:12:26,160
So if the value of the background color is actually blue so that it may actually change the background

185
00:12:26,220 --> 00:12:33,060
color to blue here and choose Blue and if I click on this back button here as you can see now that back

186
00:12:33,060 --> 00:12:34,420
in uncolored is blue.

187
00:12:34,680 --> 00:12:40,940
And here we are sitting back in uncolored of this animal Chrisley out to actually blue and Quizon Quizon

188
00:12:41,150 --> 00:12:43,850
out that said back in uncolored color that blue.

189
00:12:44,160 --> 00:12:47,370
And here we created a for loop here as he conceived.

190
00:12:47,430 --> 00:12:52,380
So this fall of here is going to actually eat right over the values of this tree which actually holds

191
00:12:52,440 --> 00:12:55,640
values of probably nearly two rows of spottiness in animalcules.

192
00:12:55,740 --> 00:13:00,590
So it can actually hold the rows of spottiness that we have inside our quiz.

193
00:13:00,750 --> 00:13:05,380
Now it's going to overate even I should iterate over the values that we have in this.

194
00:13:05,640 --> 00:13:08,460
And we have an actually in a for loop.

195
00:13:08,490 --> 00:13:10,290
So again column 0.

196
00:13:10,320 --> 00:13:14,850
So it does fall of here is going to be executed until the value of this column is actually less than

197
00:13:14,850 --> 00:13:17,800
the value of the child count of this row.

198
00:13:18,450 --> 00:13:23,640
And then second I should increment the value of this column by 1 after each execution of this for loop.

199
00:13:23,640 --> 00:13:28,230
And here inside this full as you can see here we are actually creating a reference to the botanist that

200
00:13:28,230 --> 00:13:30,250
we have inside these rows.

201
00:13:30,270 --> 00:13:32,530
So button button assignment operator.

202
00:13:32,520 --> 00:13:37,660
Here we are testing this object a button object so that your child at Klallam.

203
00:13:37,830 --> 00:13:41,970
And here we are sitting back in uncolored of the spot and to read as you can see here the packet and

204
00:13:41,970 --> 00:13:43,710
color of these buttons is right.

205
00:13:43,710 --> 00:13:44,110
Right.

206
00:13:44,190 --> 00:13:44,700
Right.

207
00:13:44,910 --> 00:13:46,940
So button that text color color that white.

208
00:13:47,100 --> 00:13:50,800
And we're also setting the color of these buttons to white.

209
00:13:51,250 --> 00:13:52,340
And here we are sitting.

210
00:13:52,340 --> 00:13:55,440
That takes colored off this is the answer to color that white.

211
00:13:55,440 --> 00:14:00,000
So let me guess the name as you can see Lyon as you can see the back in uncolored.

212
00:14:00,030 --> 00:14:05,220
Actually the text color of the answer is white and if you are sitting at your request question number

213
00:14:05,220 --> 00:14:11,820
of this is to set the text color color that white right and via Here we be put a statement.

214
00:14:12,150 --> 00:14:15,590
And now let me talk about this case red as you can see here.

