1
00:00:00,660 --> 00:00:06,570
So now in case the value of the bike in uncolored is red then it's going to actually execute these lines

2
00:00:06,570 --> 00:00:07,250
of code here.

3
00:00:07,260 --> 00:00:08,040
As you can see.

4
00:00:08,190 --> 00:00:13,730
So first it's going to actually set the background color to read and increase linearly out that set

5
00:00:13,740 --> 00:00:15,630
by your own color color that red.

6
00:00:15,750 --> 00:00:17,870
So now let me show you the emulator.

7
00:00:18,030 --> 00:00:21,890
So now as you can see here our application is running on this emulator.

8
00:00:22,050 --> 00:00:27,510
And now let's actually go inside the setting activity and here let's actually change the background

9
00:00:27,510 --> 00:00:31,790
color to red and now it says new changes are applied.

10
00:00:31,800 --> 00:00:36,630
And if I click on the spike bash button here at the top as you can see the background color is now red

11
00:00:37,370 --> 00:00:40,380
and here is when I try to execute this for loop here.

12
00:00:40,380 --> 00:00:45,820
So it's got it right over the values of these rows of spottiness in animal cuius as you can see here.

13
00:00:46,140 --> 00:00:48,420
And then it's going I should put this inner for loop.

14
00:00:48,480 --> 00:00:52,220
So in Cullom 0 and then it's going to execute this.

15
00:00:52,260 --> 00:00:58,530
Actually it is a follow up until the value of this column is less than the value of the child count

16
00:00:58,890 --> 00:01:00,090
of this row.

17
00:01:00,450 --> 00:01:05,220
And then it's going actually that adds one value to the value of this column variable after each execution

18
00:01:05,220 --> 00:01:06,100
of this war.

19
00:01:06,450 --> 00:01:11,430
So as you can see here here we are actually creating a reference to these buttons as you can see.

20
00:01:11,430 --> 00:01:15,720
And then here we are actually sitting back and uncolored of these buttons two colors that's blue.

21
00:01:15,990 --> 00:01:22,500
So the back in uncolored of these buttons is by actually blue and button that takes color the color

22
00:01:22,500 --> 00:01:23,340
that white.

23
00:01:23,460 --> 00:01:28,870
So as you can see it actually takes Colored of these buttons is actually white right.

24
00:01:28,890 --> 00:01:34,770
So now we are setting the color of the answers to colors that white.

25
00:01:34,770 --> 00:01:40,290
So now if we actually choose elephant here as you can see now the color of this the X the answer is

26
00:01:40,290 --> 00:01:41,020
white.

27
00:01:41,460 --> 00:01:45,390
And here we are sitting that here is the question number two color dot white.

28
00:01:45,390 --> 00:01:51,750
So as you can see the truly the color of this asks the question number is white and he had finally you

29
00:01:51,750 --> 00:01:57,650
can see this brave statement and now we have this case statement as you can see.

30
00:01:57,750 --> 00:02:02,760
So in case the value of the bike and color is actually yellow.

31
00:02:02,910 --> 00:02:06,140
So now let me actually go to the settings activity.

32
00:02:06,240 --> 00:02:10,870
And now let me change the background color to yellow as you can see here.

33
00:02:10,990 --> 00:02:13,900
And now if we click on dispatch button here at the top.

34
00:02:14,010 --> 00:02:19,380
Now as you can see here the Paglen colored is yellow soap and it will quickly lay out that set back

35
00:02:19,380 --> 00:02:21,830
in and color color that yellow.

36
00:02:22,410 --> 00:02:28,120
And here again we have the for loop in order to try to iterate over the buttons that we have here inside

37
00:02:28,130 --> 00:02:28,720
the squeeze.

38
00:02:28,920 --> 00:02:32,250
And we're going to actually set the back in uncolored of the spot into black.

39
00:02:32,430 --> 00:02:38,000
So let's actually look at this for loop here linearly out row and here and here is going to iterate

40
00:02:38,040 --> 00:02:45,000
over the values of these rows of guess spottiness in and Im always Aure And here is can actually execute

41
00:02:45,000 --> 00:02:46,830
this inner for loop.

42
00:02:46,830 --> 00:02:51,340
So for int column and the value of this column is 0 initially.

43
00:02:51,720 --> 00:02:57,060
And here it's going to execute this for loop until the value of this column variable is less than the

44
00:02:57,060 --> 00:03:00,110
value of this child count of this throw.

45
00:03:00,480 --> 00:03:06,390
And then actually it's going to increment the value of this column by one after each execution of this

46
00:03:06,390 --> 00:03:07,260
for loop.

47
00:03:07,650 --> 00:03:12,240
And here we have actually these lines of code so here you are actually creating a reference to these

48
00:03:12,240 --> 00:03:12,980
buttons.

49
00:03:13,290 --> 00:03:18,180
And here as you can see you're setting the background color of this button to color that black.

50
00:03:18,390 --> 00:03:21,490
So the background color of these buttons is actually black.

51
00:03:21,840 --> 00:03:25,550
And here we are starting the text color of this button to color that white.

52
00:03:25,560 --> 00:03:29,300
So as you can see the text color of these buttons is actually watched.

53
00:03:29,730 --> 00:03:35,930
And finally we are certain that the answer that takes color as you can see here to color that black.

54
00:03:36,060 --> 00:03:43,500
So now let me address the animal beard and here as you can see that the answer colored is black A.S.C.

55
00:03:43,560 --> 00:03:46,490
question number that takes colored colored That black.

56
00:03:46,500 --> 00:03:52,110
So as you can see here the color of this takes the question up question number is actually black.

57
00:03:52,470 --> 00:03:55,090
And finally we have this black statement.

58
00:03:55,320 --> 00:04:00,920
So now so now that we have these Moffats here inside this main activity fragment of a fight literally

59
00:04:01,020 --> 00:04:06,450
to go inside say this main activity main activity or double file here and now literally go inside this

60
00:04:06,450 --> 00:04:07,780
man with the class.

61
00:04:08,160 --> 00:04:14,940
And here we're going to actually put some lines of code inside this on shared preference changed method.

62
00:04:15,090 --> 00:04:21,060
So remember that I told you this if it is going to be executed every time we actually change the settings

63
00:04:21,240 --> 00:04:25,990
of this application so I can see for example when I change the number of guesses here.

64
00:04:26,060 --> 00:04:31,440
Does class this mean activity classes actually a listener and this class is going to be notified of

65
00:04:31,440 --> 00:04:32,430
these changes.

66
00:04:32,430 --> 00:04:37,090
So for example if I change the background color This class is going to be notified of those changes.

67
00:04:37,260 --> 00:04:44,040
And every Actually every change that I make to these settings this class here this man computer class

68
00:04:44,280 --> 00:04:50,390
is going to be notified because I actually make it make this class a listener to those changes.

69
00:04:50,490 --> 00:04:55,940
As you can see here if you look at this line of code here preference manager that gets the file sharing

70
00:04:55,950 --> 00:04:56,720
preferences.

71
00:04:56,880 --> 00:05:02,290
First we pass this context in order to specify that this class is going to be the listener.

72
00:05:02,590 --> 00:05:07,070
And here we are calling this method on this actually on this object.

73
00:05:07,240 --> 00:05:12,400
So that register on shares through friends change listener settings change listeners.

74
00:05:12,460 --> 00:05:15,290
This is the name of this listener that we specify in this class.

75
00:05:15,460 --> 00:05:20,890
And as you can see here I actually created this listener here inside this class and here we need to

76
00:05:20,890 --> 00:05:24,490
actually provide an implementation for this method.

77
00:05:24,520 --> 00:05:25,310
Right.

78
00:05:25,390 --> 00:05:28,310
So analysis actually I'm going to paste in some lines of code here.

79
00:05:28,310 --> 00:05:32,480
Inside this method and then I'm going to explain to you what's going on here.

