1
00:00:00,360 --> 00:00:07,740
So now that we know that we have this handler here and now we know that this hand really is actually

2
00:00:07,740 --> 00:00:10,890
initialized Let's actually scroll down here.

3
00:00:10,890 --> 00:00:13,310
Now let me show you this statement here.

4
00:00:13,320 --> 00:00:17,370
As you can see this is the part that is going to be executed right.

5
00:00:17,460 --> 00:00:19,980
So now let's look at this block of code here.

6
00:00:20,070 --> 00:00:26,580
As you can see inside the curly braces of this statement we have this handler we referred to this handler

7
00:00:26,880 --> 00:00:28,630
that post late.

8
00:00:28,680 --> 00:00:32,810
So now let me show you the emulator as you can see here.

9
00:00:32,820 --> 00:00:34,950
Now we have this eagle here.

10
00:00:34,950 --> 00:00:38,430
And now let me actually choose eagle here as you can see here.

11
00:00:38,430 --> 00:00:43,860
It weights about one or two seconds and then the next question appears here.

12
00:00:43,920 --> 00:00:44,700
Right.

13
00:00:44,760 --> 00:00:47,520
So now let's actually go back to our Android studio.

14
00:00:47,520 --> 00:00:51,860
So here I referred to his handler handler at that post delayed.

15
00:00:52,010 --> 00:00:56,400
So now when I tried to evade it and when I tried to create a delay here.

16
00:00:56,670 --> 00:00:58,510
And then the next question appears.

17
00:00:58,560 --> 00:01:00,580
So handler that post delayed.

18
00:01:00,720 --> 00:01:07,890
And then he had to create a new runnable object so new runnable and then inside the curly braces of

19
00:01:07,890 --> 00:01:14,430
this runnable here as you can see now I can actually write this run Meffert here and then it's going

20
00:01:14,430 --> 00:01:16,240
to run animate animalcules.

21
00:01:16,260 --> 00:01:17,770
True right.

22
00:01:17,880 --> 00:01:23,610
So for example here we have a cat and if we actually select this cat here it's going to wait about one

23
00:01:23,610 --> 00:01:28,790
or two seconds and then the next question appears here at the next image appears here.

24
00:01:28,800 --> 00:01:35,850
So inciter run if we need to actually put the lines of code that we want to actually execute after that

25
00:01:35,970 --> 00:01:38,170
amount of time that we specify here.

26
00:01:38,340 --> 00:01:44,580
So as you can see here after the end in praise of this actually posted a method as you can see here

27
00:01:45,030 --> 00:01:46,060
we have a comma.

28
00:01:46,170 --> 00:01:46,810
Right.

29
00:01:46,890 --> 00:01:51,560
And then here we need to specify the amount of time that we want to wait.

30
00:01:51,750 --> 00:01:54,990
And then we can actually execute this run method here.

31
00:01:55,260 --> 00:02:03,050
So for example here after one circuit as you can see here 1000 milliseconds as is actually for one second.

32
00:02:03,180 --> 00:02:09,420
For example 2000 two thousand milliseconds is actually four to six.

33
00:02:09,480 --> 00:02:14,930
As you can see here he actually created a comment and it says two thousand milliseconds for two second

34
00:02:14,940 --> 00:02:20,780
delay or for example three thousand milliseconds for free second delay.

35
00:02:21,020 --> 00:02:21,450
OK.

36
00:02:21,510 --> 00:02:27,600
So after this amount of time that we specify here the run method here is going to be executed.

37
00:02:27,600 --> 00:02:30,020
So that's the job of this handler here.

38
00:02:30,240 --> 00:02:35,910
And now let me specify that all these codes are actually executed in India.

39
00:02:35,910 --> 00:02:44,700
Actually if it is in the user interface in the GUI actually Fred in the User Interface Fred.

40
00:02:44,790 --> 00:02:45,280
OK.

41
00:02:45,450 --> 00:02:51,630
So for example here we have a snitch and effectually select a snake here about for example.

42
00:02:51,870 --> 00:02:53,070
Two seconds.

43
00:02:53,080 --> 00:02:57,310
It's it's going to evade and then it's going to execute the run method.

44
00:02:57,330 --> 00:03:02,910
As you can see here which is this Meffert animate animal cookies and then the next picture the next

45
00:03:02,910 --> 00:03:04,200
question appears.

46
00:03:04,500 --> 00:03:10,120
And then as you can see here we need to actually create this Meffert inside our class and this method

47
00:03:10,140 --> 00:03:12,150
accepts an argument of type Boolean.

48
00:03:12,180 --> 00:03:14,310
And here I assigned you to.

49
00:03:14,340 --> 00:03:15,810
So it's going to animate the squeeze.

50
00:03:15,840 --> 00:03:18,730
And then it's going to change that question.

51
00:03:18,840 --> 00:03:20,490
So let me explain here again.

52
00:03:20,520 --> 00:03:24,490
What's going on so now let me delete this comment here.

53
00:03:24,510 --> 00:03:27,230
Now let me explain this as a block of code here.

54
00:03:27,240 --> 00:03:31,230
Again here we have inside this Else statement.

55
00:03:31,260 --> 00:03:34,270
We have this handler that post delayed.

56
00:03:34,290 --> 00:03:39,420
So this method is going to actually do something and it's going to actually keep us an option in order

57
00:03:39,420 --> 00:03:42,190
to do something after an amount of time.

58
00:03:42,240 --> 00:03:49,380
So handler that post delayed new runnable So we need to create a reasonable object here and that here

59
00:03:49,410 --> 00:03:56,460
inside the curly braces as you can see I need to override the run method and then I can put the lines

60
00:03:56,460 --> 00:04:03,330
of code that you want to be executed after this amount of after this amount of time here as you can

61
00:04:03,330 --> 00:04:03,860
see here.

62
00:04:04,080 --> 00:04:05,780
After this a comma.

63
00:04:06,060 --> 00:04:06,630
Right.

64
00:04:06,840 --> 00:04:13,050
So you actually overwrite that on Mefford And then after the comma here as you can see if you can actually

65
00:04:13,050 --> 00:04:17,910
put the amount of time that you want to wait that after that it's going to actually execute this method

66
00:04:17,910 --> 00:04:18,650
here.

67
00:04:19,050 --> 00:04:24,840
So for our application I want to actually rate 1000 milliseconds which is actually even just for one

68
00:04:24,840 --> 00:04:25,870
second delay.

69
00:04:26,430 --> 00:04:29,160
So hopefully that makes sense.

70
00:04:29,160 --> 00:04:33,590
And now as you can see let's see what is the else statement here.

71
00:04:33,600 --> 00:04:34,640
So now let me actually.

72
00:04:34,640 --> 00:04:39,190
So before the end in curly brace here before this statement as you can see here we have this.

73
00:04:39,470 --> 00:04:45,480
And the curly brace and here you can just double click here in order to see to the lines of code that

74
00:04:45,510 --> 00:04:47,250
are inside of this block.

75
00:04:47,280 --> 00:04:54,060
So as you can see here we have this statement and it says if this value that equals and value and this

76
00:04:54,060 --> 00:04:59,220
means that if the user actually gets the animal right animal name right.

77
00:04:59,220 --> 00:05:05,500
For example here we have a horse and if we actually chose if we choose this horse here this means that

78
00:05:05,500 --> 00:05:13,210
here this block of this expression here evaluates to true if gets valued that equals and sell value.

79
00:05:13,210 --> 00:05:19,570
And if this means this means that the user has just the animal name it true right.

80
00:05:19,860 --> 00:05:22,930
OK then he's going to execute this if statement otherwise.

81
00:05:22,930 --> 00:05:29,720
So for example here we have a left leopard and he had used this horse here and here it says no right.

82
00:05:29,740 --> 00:05:35,560
So otherwise if this expedition here evaluates to false then it's going to actually execute this statement

83
00:05:35,560 --> 00:05:37,050
here at the bottom.

84
00:05:37,060 --> 00:05:42,670
So by double clicking here before the end in calibrates you can see the lines of code that are inside

85
00:05:42,670 --> 00:05:43,200
of this block.

86
00:05:43,210 --> 00:05:47,080
And then you can actually differentiate between your blocks of code here.

87
00:05:47,140 --> 00:05:48,190
Right.

88
00:05:48,190 --> 00:05:49,610
So hopefully that makes sense.

89
00:05:49,630 --> 00:05:54,700
And now it just means that if they use that if the users case is not right then it's going to execute

90
00:05:54,700 --> 00:05:59,890
this statement or any animal that starts the animation wrong answer animation.

91
00:05:59,890 --> 00:06:04,660
So as you can see here if it's actually de-select shark this is the wrong answer animation right.

92
00:06:04,660 --> 00:06:10,540
If I isolate goes wrong answer animation and then it's going to actually set a text to this.

93
00:06:10,560 --> 00:06:17,440
He actually answers so he actually answers that said text are streamed dot rant and Selma's message.

94
00:06:17,680 --> 00:06:19,390
So as you can see he had the wrong answer.

95
00:06:19,410 --> 00:06:20,600
Message is no.

96
00:06:20,800 --> 00:06:25,090
So let's actually copy disvalue here ran under a line and said underlying message.

97
00:06:25,180 --> 00:06:30,790
And now let's actually go inside these strings that exemplified and then he'll essentially create a

98
00:06:30,790 --> 00:06:36,140
string resource strange and let's paste this value here.

99
00:06:36,400 --> 00:06:38,120
And let's actually close this tag.

100
00:06:38,290 --> 00:06:40,310
And here I can just type in No.

101
00:06:40,990 --> 00:06:45,220
And now let's actually go back to our main activity fragment of a file and here as you can see here

102
00:06:45,460 --> 00:06:46,810
the error is gone.

103
00:06:46,960 --> 00:06:52,690
And now I actually referred to this between and just so between guess is the button that we actually

104
00:06:52,690 --> 00:06:53,350
touch.

105
00:06:53,350 --> 00:06:56,460
So between us that set in a set enabled false.

106
00:06:56,470 --> 00:06:59,330
So for example I touched this horse right.

107
00:06:59,350 --> 00:07:03,520
I can't again touch this button as you can see here.

108
00:07:03,520 --> 00:07:11,020
This button is actually disabled or I can't touch this shark here or can't touch this code but let's

109
00:07:11,200 --> 00:07:12,280
touch this snake.

110
00:07:12,520 --> 00:07:16,500
As you can see this right answer animation is actually occurring here.

111
00:07:16,510 --> 00:07:19,230
And again I can't touch this snake here.

112
00:07:19,240 --> 00:07:21,850
I can't actually press on this snake.

113
00:07:22,240 --> 00:07:24,820
So hopefully that makes sense.

114
00:07:24,850 --> 00:07:29,520
And now let's actually again look at our lines of code here.

115
00:07:29,530 --> 00:07:35,530
Inside this listener as you can see here we have some of these methods here that we need to actually

116
00:07:35,890 --> 00:07:36,300
create.

117
00:07:36,300 --> 00:07:41,030
For example we need to create this get the exact animal name it.

118
00:07:41,050 --> 00:07:43,820
So now let's actually scroll down here.

119
00:07:44,060 --> 00:07:50,050
And after the ending curly brace of this listener which is this ending brace which you need to put a

120
00:07:50,050 --> 00:07:51,500
semicolon here.

121
00:07:51,520 --> 00:07:56,890
Here let's actually create that method to get the exact get the exact name of the animal.

122
00:07:57,190 --> 00:08:03,070
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

123
00:08:03,070 --> 00:08:03,870
on here.

