1
00:00:00,330 --> 00:00:02,760
And here I need to actually be called a Meffert on this.

2
00:00:02,760 --> 00:00:05,270
I am just so each other object so.

3
00:00:05,340 --> 00:00:09,990
So here I can just say I am just the future Dadds said factory.

4
00:00:10,520 --> 00:00:11,600
OK.

5
00:00:11,640 --> 00:00:14,810
And here we need to actually putting up defectively.

6
00:00:14,810 --> 00:00:15,130
OK.

7
00:00:15,150 --> 00:00:18,860
The class that actually is a factory blanks.

8
00:00:18,930 --> 00:00:19,520
OK.

9
00:00:19,530 --> 00:00:21,870
So we need to actually put in the context here.

10
00:00:21,870 --> 00:00:25,230
So main activity got this OK.

11
00:00:25,380 --> 00:00:29,480
It is actually like the uncle listener interface.

12
00:00:29,520 --> 00:00:30,040
OK.

13
00:00:30,120 --> 00:00:37,340
So here at the top here we need to actually implement these of this of your factory interface so here

14
00:00:37,350 --> 00:00:42,920
I can just type in view switcher OK DOD's view factory.

15
00:00:43,350 --> 00:00:44,050
So here we are.

16
00:00:44,060 --> 00:00:48,540
Actually you want to implement this of your factory interface.

17
00:00:48,750 --> 00:00:54,870
And if I actually hover my mouse pointer over the edge of the area it says class activity must either

18
00:00:54,870 --> 00:00:57,920
be declared abstract or implement abstract.

19
00:00:57,950 --> 00:01:04,810
If it makes you in view effectively so as you can see here we need to actually implement this.

20
00:01:04,860 --> 00:01:07,560
Make sure you abstract perfet.

21
00:01:07,580 --> 00:01:10,200
OK we need to implement this method here.

22
00:01:10,230 --> 00:01:15,090
And as you can see here this is our fifth and let's actually delete this line of code here and then

23
00:01:15,120 --> 00:01:21,660
we can actually put our own implementations in say the Smurfit So as you can see here this method actually

24
00:01:21,810 --> 00:01:24,350
returns an object of type view.

25
00:01:24,560 --> 00:01:24,950
OK.

26
00:01:24,960 --> 00:01:30,000
So now inside of these Smurfette I'm going actually pasting some lines of code and then I'm going to

27
00:01:30,000 --> 00:01:31,850
explain to you what's going on here.

28
00:01:32,220 --> 00:01:35,810
So as you can see here these are the lines of code that they actually paste that here.

29
00:01:35,820 --> 00:01:36,270
OK.

30
00:01:36,450 --> 00:01:42,810
So first of all in line of THIRTY-NINE I created an object of type image view and the name of this object

31
00:01:42,870 --> 00:01:48,900
is I enjoy a view and here as you can see I am actually instantiating this object and in say The Apprentice's

32
00:01:48,960 --> 00:01:52,580
I am putting the actually to put the context OK.

33
00:01:52,830 --> 00:01:54,700
And here in line are 40.

34
00:01:55,020 --> 00:01:58,090
I actually said this type of these are image view.

35
00:01:58,180 --> 00:02:04,660
OK I give you that cityscape scale type image view that scale type that fits underline Ex-White.

36
00:02:04,800 --> 00:02:05,330
OK.

37
00:02:05,430 --> 00:02:07,230
You can actually put in other values too.

38
00:02:07,230 --> 00:02:11,800
So if actually did it is that you can actually put these values here.

39
00:02:11,850 --> 00:02:12,210
OK.

40
00:02:12,240 --> 00:02:18,980
And as you can see here here I am actually sitting out part of this image view as you can see here.

41
00:02:19,010 --> 00:02:24,160
We want to actually set the image view of it and the image view height.

42
00:02:24,180 --> 00:02:24,720
OK.

43
00:02:24,840 --> 00:02:30,900
So I image of you that set sets out prompts me you so because our image views are going to be inside

44
00:02:30,900 --> 00:02:32,800
this image switcher.

45
00:02:32,850 --> 00:02:33,360
OK.

46
00:02:33,450 --> 00:02:39,440
Here we need to actually live within this class new image Swisher's that out poems.

47
00:02:39,480 --> 00:02:43,140
And here I want to actually put in the value of content.

48
00:02:43,140 --> 00:02:43,540
OK.

49
00:02:43,620 --> 00:02:49,040
View group layouts perhaps that wraps content you can actually change the value to other value.

50
00:02:49,040 --> 00:02:54,960
For example I can't delete this and if I actually put this data here I can actually choose.

51
00:02:54,960 --> 00:02:59,970
Match parent OK or feel padded but I prefer this lack of content.

52
00:03:00,300 --> 00:03:03,520
And here as you can see this is the value for the Wii.

53
00:03:03,570 --> 00:03:03,960
OK.

54
00:03:03,980 --> 00:03:05,370
DVDs of our image.

55
00:03:05,370 --> 00:03:09,770
And here we have this wrapped content for a height of this image.

56
00:03:09,870 --> 00:03:11,840
Ok for the height of this image view.

57
00:03:12,330 --> 00:03:17,490
And now here we are actually returning this image view as you can see image view is actually a subclass

58
00:03:17,490 --> 00:03:18,050
of view.

59
00:03:18,180 --> 00:03:20,760
So we can actually written this image view.

60
00:03:20,970 --> 00:03:28,350
And let's actually go back and say This creates Mefford and now I want to actually put in some lines

61
00:03:28,350 --> 00:03:29,060
of code here.

62
00:03:29,070 --> 00:03:33,840
But first let's actually create a method inside our class here.

63
00:03:33,870 --> 00:03:38,230
OK so I'm gonna paste this method here and then I'm going to explain to you what's going on here.

64
00:03:38,550 --> 00:03:44,730
So as you can see here this is Armathwaite and the name of this method is let's set layout prompts for

65
00:03:44,760 --> 00:03:45,480
image view.

66
00:03:45,660 --> 00:03:49,600
So let's actually change this letter to chapiter letter P.

67
00:03:49,670 --> 00:03:56,550
OK let's lay out perhaps for image view image view and here inside the method as you can see I am setting

68
00:03:56,550 --> 00:03:59,550
the image view as you can see this image is the argument.

69
00:03:59,560 --> 00:04:01,790
OK image view that set layout perhaps.

70
00:04:01,800 --> 00:04:06,310
So here I want to actually specify the beach and the height of my image view.

71
00:04:06,360 --> 00:04:06,800
OK.

72
00:04:06,930 --> 00:04:08,890
New linearly out OK.

73
00:04:08,970 --> 00:04:15,540
So if my view is actually inside it linearly out then we can actually specify the beats which is 1000

74
00:04:15,600 --> 00:04:17,590
and the height 1000 OK.

75
00:04:17,820 --> 00:04:21,370
So here inside is uncreate benefit.

76
00:04:21,450 --> 00:04:25,050
Now I'm going to paste in some lines of code here and then I'm going to explain to you what's going

77
00:04:25,050 --> 00:04:25,590
on here.

78
00:04:25,590 --> 00:04:30,810
So as you can see here these are the lines of code that they actually paste that here inside this uncreate

79
00:04:30,810 --> 00:04:31,560
method.

80
00:04:31,560 --> 00:04:33,540
So first of all I actually create a for loop.

81
00:04:33,660 --> 00:04:34,150
OK.

82
00:04:34,410 --> 00:04:40,450
And here inside the apprentice's I created a body of type integer and the name of this variable is indexed

83
00:04:40,890 --> 00:04:43,450
and I assigned a value 0 to this variable.

84
00:04:43,590 --> 00:04:49,020
And here I actually created a condition which determines how many times this fruit loop is going to

85
00:04:49,020 --> 00:04:50,150
be executed.

86
00:04:50,160 --> 00:04:56,060
So until the value of the index value is less than the value of the length of this animal images array

87
00:04:56,340 --> 00:05:00,600
that is inside of this animal class then this loop is going to be you Ted.

88
00:05:00,700 --> 00:05:06,160
And here it says that after each execution of this for loop the value of this Nixzmary is going to be

89
00:05:06,160 --> 00:05:07,670
incremented by 1.

90
00:05:07,720 --> 00:05:09,470
So he had to be created a constant.

91
00:05:09,490 --> 00:05:09,970
OK.

92
00:05:10,090 --> 00:05:12,850
Final int the name of this constant is I.

93
00:05:12,850 --> 00:05:19,200
And then I assigned the value of this index of idea about to this I here and here we are actually creating

94
00:05:19,270 --> 00:05:20,090
an image view.

95
00:05:20,110 --> 00:05:27,340
So Image view image view and here SPC I specify that our context of our application and and here I want

96
00:05:27,340 --> 00:05:32,740
to actually to set the image to this image view so animal that animate images.

97
00:05:32,800 --> 00:05:33,550
Index.

98
00:05:33,630 --> 00:05:34,300
OK.

99
00:05:34,600 --> 00:05:42,430
And then here you are actually doing the we are actually specifying the layout actually to the image

100
00:05:43,000 --> 00:05:46,290
and the image height of our image view as you can see here.

101
00:05:46,540 --> 00:05:52,180
So as you can see inside this content underline made that example we have this linearly out horizontal

102
00:05:52,180 --> 00:05:52,440
here.

103
00:05:52,450 --> 00:05:58,270
OK so if you're going to actually put this are put our images inside this linearly and horizontal and

104
00:05:58,270 --> 00:06:03,430
inside the main activity that of file here as you can see is Smurfette here as you can see of you are

105
00:06:03,430 --> 00:06:08,740
actually specifying the image view and the image view height.

106
00:06:08,770 --> 00:06:09,230
OK.

107
00:06:09,340 --> 00:06:12,320
So as you can see here I put this new keyboard linearly out.

108
00:06:12,340 --> 00:06:13,670
That leads to problems.

109
00:06:14,050 --> 00:06:20,110
So because our images are going to be inside this linear inside these linearly out here as you can see

110
00:06:20,680 --> 00:06:24,780
here we needed to actually inside this Mefford.

111
00:06:24,880 --> 00:06:29,540
Let's lay out perhaps for you here we needed to put this linearly out here.

112
00:06:29,560 --> 00:06:30,260
OK.

113
00:06:30,260 --> 00:06:32,520
Linear layout that lay out the bottoms.

114
00:06:32,660 --> 00:06:33,480
Okay.

115
00:06:34,030 --> 00:06:39,800
And then here as you can see of you have these Meffert as you can see here.

116
00:06:39,980 --> 00:06:44,640
And I assigned these image view to these lists that lay out perhaps for image view.

117
00:06:44,650 --> 00:06:50,890
I actually felt this image view and then here I am setting the pattern for this image view 100 for the

118
00:06:50,890 --> 00:06:56,930
left 100 for the top 100 for the right and 100 for the bottom.

119
00:06:57,220 --> 00:07:00,960
And then here I am making this image view and unclick listener.

120
00:07:00,970 --> 00:07:01,520
OK.

121
00:07:01,840 --> 00:07:04,980
So this really is going to actually listen to the clicks of the user.

122
00:07:05,170 --> 00:07:11,020
OK so you got to listen a new view that unclick listener and he had as you can see I am actually creating

123
00:07:11,290 --> 00:07:17,940
an anonymous class that actually implements this article listener interface so that you can see these

124
00:07:17,950 --> 00:07:18,920
are Mfat here.

125
00:07:18,940 --> 00:07:21,970
So it's to actually implement this method here.

126
00:07:22,330 --> 00:07:26,590
And inside this method I actually fit to this image switcher.

127
00:07:26,590 --> 00:07:31,120
So inside this content underlayment at XM and as you can see if you have this image switcher I am just

128
00:07:31,390 --> 00:07:34,420
inside this linearly out vertical here.

129
00:07:34,470 --> 00:07:37,840
OK so I referred to the object.

130
00:07:37,900 --> 00:07:40,280
I am just switch to set image resource.

131
00:07:40,420 --> 00:07:43,580
OK animal that animal images.

132
00:07:43,840 --> 00:07:49,840
OK so whenever the user clicks on the actually on this image as you can see here we have these images.

133
00:07:49,930 --> 00:07:54,070
So whenever the user clicks on this image as you can see we can see this image here.

134
00:07:54,070 --> 00:07:59,920
So here we have this image switcher and the images are going to be in sight and the images are actually

135
00:07:59,920 --> 00:08:02,980
going to be assigned to this image image switcher here.

136
00:08:02,980 --> 00:08:03,510
OK.

137
00:08:03,550 --> 00:08:08,430
So again if I click on this image now we can see this image inside this image switcher.

138
00:08:08,470 --> 00:08:09,260
OK.

139
00:08:09,640 --> 00:08:13,230
And so I have to say I am just had that set image resource animal.

140
00:08:13,240 --> 00:08:18,120
That animal is just an animal images some index as you can see here.

141
00:08:18,280 --> 00:08:21,120
So animal that animal images some of it.

142
00:08:21,260 --> 00:08:24,320
And he actually created a post here as you can see.

143
00:08:24,580 --> 00:08:28,300
So let me actually create a new line here and then you can see these values better.

144
00:08:28,510 --> 00:08:35,400
So toast that text and here for the first argument I actually specified the context of our activity.

145
00:08:35,450 --> 00:08:37,020
Main activity that this.

146
00:08:37,210 --> 00:08:41,000
And he had this is the text that is going to be to be shown to the user.

147
00:08:41,020 --> 00:08:44,690
This is our Plus animal names.

148
00:08:45,280 --> 00:08:50,590
As you can see here and here this is the duration of the taste that is going to be shown to the user

149
00:08:50,890 --> 00:08:52,020
data show.

150
00:08:52,390 --> 00:08:59,230
OK so now as you can see after this so thanklessness and a Meffert as you can see here we have these

151
00:08:59,470 --> 00:09:01,450
linearly out horizontal.

152
00:09:01,450 --> 00:09:06,550
So here I referred to this linearly out here as you can see inside this content underline minute example

153
00:09:06,740 --> 00:09:10,150
if you have this linearly out here in say this horizontal scroll view.

154
00:09:10,260 --> 00:09:10,690
OK.

155
00:09:10,840 --> 00:09:15,340
So linearly out horizontal that's at view image view.

156
00:09:15,340 --> 00:09:19,550
OK so now you are actually adding this image is linearly out horizontal.

157
00:09:19,580 --> 00:09:24,790
OK so now let's actually run our project and see what happens.

