1
00:00:00,650 --> 00:00:04,220
And now it's actually to go back inside these uncreate Smurfette here.

2
00:00:04,310 --> 00:00:08,870
So I'm going to actually paste in some lines of code here and then I'm going to explain to you what's

3
00:00:08,870 --> 00:00:09,700
going on here.

4
00:00:09,760 --> 00:00:11,440
And so it is on create method.

5
00:00:11,450 --> 00:00:12,400
OK.

6
00:00:12,410 --> 00:00:15,710
So as you can see here these are the lines of code that they actually paste that here.

7
00:00:15,710 --> 00:00:19,800
First of all in line for 56 as you can see here I called this method.

8
00:00:19,820 --> 00:00:23,010
Let's add the images to the view flipper as you can see here.

9
00:00:23,030 --> 00:00:28,710
I call this method and here is going to actually add the images to the view flipper as you can see inside

10
00:00:28,730 --> 00:00:32,960
this content on the underlined that minute minute example here you have this of your flipper.

11
00:00:32,960 --> 00:00:35,860
So if you want to actually add the images to this view flip it OK.

12
00:00:36,200 --> 00:00:41,450
And here in line for 87 I actually called Let's add the images to the view animator.

13
00:00:41,570 --> 00:00:42,000
OK.

14
00:00:42,070 --> 00:00:45,930
And I actually passed this animated object to the Smurfette.

15
00:00:46,040 --> 00:00:50,990
So inside this content underline minute example if you have this view animated and we want to actually

16
00:00:50,990 --> 00:00:52,910
look at the images to this view animator.

17
00:00:53,060 --> 00:00:58,400
So here I actually passed this animated object and here are for this method I actually passed this view

18
00:00:58,410 --> 00:00:59,550
flipper object.

19
00:00:59,560 --> 00:01:01,560
OK as you can see here you flipper.

20
00:01:01,790 --> 00:01:02,300
OK.

21
00:01:02,540 --> 00:01:05,870
And here in line 49 as you can see here.

22
00:01:05,900 --> 00:01:09,540
I actually called use animation for a view of view from people.

23
00:01:09,680 --> 00:01:11,780
And I actually passed this view of the object.

24
00:01:11,780 --> 00:01:17,270
So as you can see if you have this method here use animation for a view flippen and then you have these

25
00:01:17,360 --> 00:01:19,940
and other Mfat use animation for you animator.

26
00:01:20,090 --> 00:01:23,100
And then I passed this of your animated object to this method.

27
00:01:23,270 --> 00:01:30,650
OK so now let's actually make these buttons make these up between animal animal image next button and

28
00:01:30,650 --> 00:01:35,400
these are between an animal image previous button a listener to the clicks of the user.

29
00:01:35,450 --> 00:01:35,850
OK.

30
00:01:35,930 --> 00:01:42,820
So here I can just type in PETN and an image next that said unclick listener.

31
00:01:43,090 --> 00:01:43,770
OK.

32
00:01:43,820 --> 00:01:50,610
And here inside Apprentice's I need to actually pass the context of our application.

33
00:01:50,790 --> 00:01:52,940
So here I need to pass the context object.

34
00:01:52,940 --> 00:01:53,300
OK.

35
00:01:53,420 --> 00:02:03,040
So here I can just type in main activity that this OK and now are I need to actually implement the uncle

36
00:02:03,140 --> 00:02:05,030
listener here.

37
00:02:05,390 --> 00:02:07,950
So here I can just type in implement.

38
00:02:08,240 --> 00:02:11,900
So I need to implement the uncle Ikhlas and her interface.

39
00:02:11,960 --> 00:02:17,410
So here I am just typing on click listener.

40
00:02:17,630 --> 00:02:21,830
So he had a view that I can listen at and now it's going and it is natural and error.

41
00:02:21,860 --> 00:02:27,170
So if I asked you to hover my mouse pointer over the error area it says classman activity must either

42
00:02:27,170 --> 00:02:31,940
be declared abstract or implement abstract Meffert unclick in unclick listener.

43
00:02:31,940 --> 00:02:34,980
So here as you can see now this error is gone here.

44
00:02:35,030 --> 00:02:41,600
So here in this main activity class I need to actually call the actually the abstract method that we

45
00:02:41,600 --> 00:02:45,500
actually inherit from these unclick listener interface.

46
00:02:45,530 --> 00:02:51,170
OK so remember that because we are actually implementing this uncle class in an interface there is and

47
00:02:51,200 --> 00:02:57,480
actually is a relationship between this main activity class and this uncle class or interface.

48
00:02:57,500 --> 00:03:00,380
So here we need to actually implement that abstract method.

49
00:03:00,800 --> 00:03:03,630
Unclick Meffert on click.

50
00:03:03,760 --> 00:03:07,220
So here I just need to press on Enter key on my keyboard.

51
00:03:07,430 --> 00:03:11,770
So as you can see here this is the uncle Meffert And now as you can see the error is gone.

52
00:03:11,810 --> 00:03:12,470
OK.

53
00:03:12,750 --> 00:03:19,040
And now let's actually make this another button These are between an animal image and previous button

54
00:03:19,250 --> 00:03:21,050
are listening to the clicks of the user.

55
00:03:21,050 --> 00:03:26,830
So here I can just type in between animal image previous thought sets unclick listener.

56
00:03:27,170 --> 00:03:27,820
OK.

57
00:03:27,980 --> 00:03:29,990
And here I need to actually pass the context.

58
00:03:30,020 --> 00:03:36,220
So here I can just say the main activity that this OK and now inside is unclear.

59
00:03:36,290 --> 00:03:39,530
I need to actually differentiate between these two buttons.

60
00:03:39,530 --> 00:03:42,860
So whenever the user clicks on this bitty bitty animal image.

61
00:03:42,860 --> 00:03:45,250
Next up some lines of code.

62
00:03:45,250 --> 00:03:46,420
It's going to be executed.

63
00:03:46,580 --> 00:03:51,680
And when the user clicks on this between an animal image previous button some other lines of code is

64
00:03:51,680 --> 00:03:53,380
going to be executed here.

65
00:03:53,510 --> 00:03:57,220
We can actually we have this argument in on my fat uncle.

66
00:03:57,350 --> 00:04:02,080
And as you can see it is actually the first view so we can actually change this name to.

67
00:04:02,450 --> 00:04:08,510
And we have this view here as an argument so we can actually by using this object we can actually differentiate

68
00:04:08,900 --> 00:04:10,840
between these two buttons.

69
00:04:10,880 --> 00:04:11,420
OK.

70
00:04:11,510 --> 00:04:17,930
So here in say this if I can just typing a switch switch between view.

71
00:04:18,490 --> 00:04:22,270
OK that gets I-T OK.

72
00:04:22,460 --> 00:04:27,160
And now let's actually open and close the switch statement by using these curly braces.

73
00:04:27,350 --> 00:04:27,940
OK.

74
00:04:28,040 --> 00:04:36,890
So here I can just type in case our dad's ID that's pretty an image next.

75
00:04:37,120 --> 00:04:39,300
OK Blake.

76
00:04:39,900 --> 00:04:49,060
And now let's actually take in case our thought Id that between image previous Colin bridge.

77
00:04:49,530 --> 00:04:55,420
OK so here we are actually switching between the values of the ideas of this view object that we actually

78
00:04:55,420 --> 00:04:56,830
receive as an argument.

79
00:04:56,900 --> 00:04:57,290
OK.

80
00:04:57,390 --> 00:05:03,180
So this uncle actually can understand which type of object or the use that is actually clicking.

81
00:05:03,330 --> 00:05:03,710
OK.

82
00:05:03,750 --> 00:05:09,420
So we have this of you object as an argument and we can use that object in order to actually switch

83
00:05:09,420 --> 00:05:15,660
between the ideas of this object and then we can actually differentiate between these buttons and then

84
00:05:15,810 --> 00:05:22,650
we can actually execute the lines of code that are related to these specific objects to the specific

85
00:05:22,650 --> 00:05:24,800
components in our application.

86
00:05:24,860 --> 00:05:25,410
OK.

87
00:05:25,500 --> 00:05:31,290
So for this or an animal image next here as you can see for this type of a button of any use or click

88
00:05:31,290 --> 00:05:35,130
on that button here I want to actually create some lines of code are here.

89
00:05:35,130 --> 00:05:37,890
I want to ask a question from myself.

90
00:05:38,050 --> 00:05:42,490
OK what do I want to happen when the user clicks on this.

91
00:05:42,860 --> 00:05:44,800
Next Next button here.

92
00:05:44,820 --> 00:05:45,520
As you can see here.

93
00:05:45,540 --> 00:05:45,990
OK.

94
00:05:46,170 --> 00:05:51,030
I want for example this of your flipper to actually show the next image to the user.

95
00:05:51,030 --> 00:05:51,510
OK.

96
00:05:51,510 --> 00:05:56,850
So when the user clicks on the next button as you can see here I want to give you flipper to show the

97
00:05:56,850 --> 00:05:59,080
next image to the user.

98
00:05:59,100 --> 00:06:06,600
So here inside this switch statement and for this case are that ID that's between an animal image next

99
00:06:07,050 --> 00:06:09,340
and just typing of view flipper.

100
00:06:09,550 --> 00:06:09,980
OK.

101
00:06:10,080 --> 00:06:11,810
So we have this view Flipper here.

102
00:06:11,820 --> 00:06:16,680
We actually did declare it inside this class so we can actually refer to the name of that of your flipper

103
00:06:16,710 --> 00:06:18,580
object inside this and click Mefford.

104
00:06:18,600 --> 00:06:21,530
So if you put that show next.

105
00:06:21,780 --> 00:06:25,230
So this is going to show the next image to the user.

106
00:06:25,470 --> 00:06:26,000
OK.

107
00:06:26,250 --> 00:06:29,520
And what other kinds of things.

108
00:06:29,570 --> 00:06:31,770
I want to I want to happen.

109
00:06:31,780 --> 00:06:35,450
When you when the user clicks on this next image I want this view animated.

110
00:06:35,450 --> 00:06:38,200
Also should the next image to the user.

111
00:06:38,400 --> 00:06:44,620
So here again just again refer to the name of that object if you animator that show next.

112
00:06:44,850 --> 00:06:45,430
OK.

113
00:06:45,600 --> 00:06:51,270
So if I actually click on this next button here as you can see now we can see these images actually

114
00:06:51,390 --> 00:06:51,880
change.

115
00:06:51,900 --> 00:06:52,580
OK.

116
00:06:53,040 --> 00:06:56,270
And now let's actually here.

117
00:06:56,310 --> 00:07:01,670
In this case a statement case or that I did that between animate image previous.

118
00:07:01,680 --> 00:07:08,280
So when the user clicks on the previous button here I want this of you flip here to show the previous

119
00:07:08,280 --> 00:07:10,680
image to the user as you can see here.

120
00:07:10,680 --> 00:07:17,420
So here again just typing a view flipper that show previous.

121
00:07:17,490 --> 00:07:18,350
OK.

122
00:07:18,360 --> 00:07:24,570
And again as I can see it when the user clicks on the previous button I want this of you animated to

123
00:07:24,570 --> 00:07:28,800
actually show the previous image to the user.

124
00:07:28,800 --> 00:07:34,620
So here I can just refer to the name of that object view animator that show previous.

125
00:07:34,770 --> 00:07:35,610
OK.

126
00:07:35,910 --> 00:07:41,760
So as you can see if I click on the previous button here now you can see that these two components actually

127
00:07:41,760 --> 00:07:43,580
show the previous image.

128
00:07:43,600 --> 00:07:50,600
OK so now let's actually run our project and see what happens.

129
00:07:51,450 --> 00:07:56,480
So now as you can see here our application is actually running on this emulator here.

130
00:07:56,580 --> 00:07:58,820
And if I actually click on this next button here.

131
00:07:58,920 --> 00:08:01,630
Now as you can see this image changed.

132
00:08:01,920 --> 00:08:05,590
And if you actually click on this or previous one and now you can see this.

133
00:08:05,650 --> 00:08:07,640
These images actually are changing.

134
00:08:07,830 --> 00:08:10,180
And here this is our view animator.

135
00:08:10,410 --> 00:08:13,450
And here you can see that these images actually change.

136
00:08:13,650 --> 00:08:14,390
OK.

137
00:08:14,700 --> 00:08:18,170
So I think that's enough for this application.

138
00:08:18,240 --> 00:08:19,180
OK.

139
00:08:19,530 --> 00:08:23,850
And if you have any questions please post the discussion in the course and then I'll do my best to answer

140
00:08:23,940 --> 00:08:25,110
all of your questions.

141
00:08:25,350 --> 00:08:29,220
Thank you very much for watching and I'll see you in the next tutorial.

