1
00:00:00,360 --> 00:00:08,160
So here inside this article Mefford Let's actually create an if statement so if and then say The Apprentice

2
00:00:08,160 --> 00:00:08,840
is just typing.

3
00:00:08,840 --> 00:00:10,600
Here is storage.

4
00:00:10,620 --> 00:00:12,210
Permission granted.

5
00:00:12,450 --> 00:00:12,910
OK.

6
00:00:12,930 --> 00:00:18,600
I actually referred to the name of the Smurfette and then let's actually open and closed this if statement

7
00:00:18,630 --> 00:00:23,480
by using these curly braces and opening curly brace followed by our closing curly brace.

8
00:00:23,520 --> 00:00:29,270
So as you can see here I just created an if statement and here I'm saying that if it's stored it's permission

9
00:00:29,280 --> 00:00:38,960
Grant Granted if the user has access actually if the user is allowed to access the storage then we can

10
00:00:38,980 --> 00:00:43,030
actually execute the lines of code that are going to be inside this if statement.

11
00:00:43,110 --> 00:00:43,500
OK.

12
00:00:43,650 --> 00:00:49,590
So I told you that it is very important that you specify whether the user is actually allowed to access

13
00:00:49,720 --> 00:00:51,810
the storage or not.

14
00:00:51,810 --> 00:00:52,080
Right.

15
00:00:52,080 --> 00:00:55,220
So here we are actually asking that permission.

16
00:00:55,260 --> 00:01:00,510
So now inside this if statement I'm going to paste in some lines of code and then I'm going to explain

17
00:01:00,510 --> 00:01:02,830
to you what's going on here.

18
00:01:02,850 --> 00:01:08,030
So as you can see here these are the lines of code that I pasted here.

19
00:01:08,220 --> 00:01:12,560
So let's actually look at this line of code here in line number one hundred and fifty six.

20
00:01:12,570 --> 00:01:17,340
So here I actually referred to the name of this at a least file pathnames.

21
00:01:17,370 --> 00:01:17,970
Right.

22
00:01:18,240 --> 00:01:24,530
And then I put an assignment operator here and then I put the new keyword and an endless in here.

23
00:01:24,540 --> 00:01:32,490
So here I am actually creating an empty arii that actually that can actually hold values of types 3.

24
00:01:32,610 --> 00:01:33,360
Right.

25
00:01:33,360 --> 00:01:36,820
So I actually initialized this at a file pathnames.

26
00:01:36,840 --> 00:01:37,410
OK.

27
00:01:37,560 --> 00:01:44,340
These are a list and then as you can see inside the angle brackets I specified that the values that

28
00:01:44,340 --> 00:01:49,750
are going to be assigned to this flight path names here can only be of types 3.

29
00:01:50,280 --> 00:01:57,850
And then in line number of 157 as you can see I created actually a variable of type fight.

30
00:01:57,990 --> 00:01:58,910
Right.

31
00:01:58,920 --> 00:02:05,460
So remember that I told you variabilis are placeholders that can actually hold the values of a specific

32
00:02:05,460 --> 00:02:05,990
type.

33
00:02:06,000 --> 00:02:12,180
So here when I actually just put this Q-Bot here filed with capital F here I am specifying that the

34
00:02:12,180 --> 00:02:17,540
values that are going to be assigned to this variable are going to be of type file.

35
00:02:17,850 --> 00:02:19,600
So file file path.

36
00:02:19,620 --> 00:02:24,130
So the name of this variable is flightpath which is actually like Foyt right.

37
00:02:24,540 --> 00:02:29,210
And then I put an assignment operator here and then I put this new keyboard.

38
00:02:29,250 --> 00:02:36,390
So here I want to actually create an object of type find and I want to assign that object to this file

39
00:02:36,390 --> 00:02:36,950
path.

40
00:02:37,200 --> 00:02:43,890
So new file here I want to create an object of type find and an inside the apprentice's as you can see

41
00:02:43,890 --> 00:02:44,120
here.

42
00:02:44,120 --> 00:02:50,780
First of all I need to specify a directory environment that get external storage public directories

43
00:02:50,790 --> 00:02:58,050
so here we need to specify that up which path you want to access able to access the external storage

44
00:02:58,050 --> 00:02:59,150
public directory.

45
00:02:59,180 --> 00:03:02,410
OK the public directed that can be accessed by the user.

46
00:03:02,670 --> 00:03:08,610
So and that inside the apprentice is here first of all I specified that I'm on to access the pictures

47
00:03:08,610 --> 00:03:13,140
directory so environment that directs to the underlying pictures.

48
00:03:13,140 --> 00:03:16,250
Now let me show you the Android device monitor as you can see here.

49
00:03:16,260 --> 00:03:22,190
This is our Android device monitor and inside this emulated there inside this fall there is zero.

50
00:03:22,410 --> 00:03:25,340
As you can see we have these pictures here pictures folder.

51
00:03:25,350 --> 00:03:28,200
So here I am accessing these pictures there.

52
00:03:28,320 --> 00:03:35,100
And then here as you can see for this second argument here I am actually specifying the name of the

53
00:03:35,110 --> 00:03:37,340
folder that are able to access.

54
00:03:37,350 --> 00:03:42,330
So as you can see here inside this is the directory we have this for all their animal images.

55
00:03:42,330 --> 00:03:42,970
Right.

56
00:03:42,990 --> 00:03:48,500
So I want I need to actually specify the exact name of that folder.

57
00:03:48,510 --> 00:03:51,770
So as you can see the exact name is animal images.

58
00:03:51,870 --> 00:03:53,630
So I just put this value here.

59
00:03:53,730 --> 00:03:56,620
Animal images are right inside the goats.

60
00:03:56,910 --> 00:04:02,530
And now with this foil Pamphila have now actually contains the address of these animal images they're

61
00:04:02,580 --> 00:04:05,000
inside the directory say the pictures directory.

62
00:04:05,070 --> 00:04:05,840
Right.

63
00:04:06,270 --> 00:04:09,360
And then here as you can see we have another IIF statement.

64
00:04:09,360 --> 00:04:11,500
So if file path.

65
00:04:11,520 --> 00:04:17,980
So here I am referring to is a variable that holds the the address of these animal images folder.

66
00:04:18,000 --> 00:04:19,980
So a file path that is directory.

67
00:04:19,980 --> 00:04:22,300
So it is if it is actually a directory.

68
00:04:22,500 --> 00:04:28,350
So as you can see here inside this Android device monitor here we are accessing the pictures directory

69
00:04:28,350 --> 00:04:28,610
right.

70
00:04:28,620 --> 00:04:30,330
So it is actually a directory.

71
00:04:30,330 --> 00:04:31,580
Here we are checking that.

72
00:04:31,620 --> 00:04:33,310
It is actually a directory or not.

73
00:04:33,330 --> 00:04:33,960
Right.

74
00:04:33,960 --> 00:04:40,710
If flightpath that is directory at as you can see here you can see these and logical operator.

75
00:04:41,010 --> 00:04:45,540
And if these file path is not equal to null.

76
00:04:45,630 --> 00:04:46,150
OK.

77
00:04:46,230 --> 00:04:52,470
If this file path is not equal to or not and if it is actually our real directory that we can access

78
00:04:52,800 --> 00:04:57,390
in that case we're going to go ahead inside the curly braces of this if statement and we're going to

79
00:04:57,390 --> 00:04:59,420
execute the lines of code here.

80
00:04:59,750 --> 00:05:05,770
First of all inside this statement as you can see I actually referred to these files right here.

81
00:05:05,780 --> 00:05:09,100
So as you can see I actually created these files are a.

82
00:05:09,130 --> 00:05:11,620
Here there's actually the scroll to the top.

83
00:05:11,660 --> 00:05:16,390
I actually created this at a file here in line number 62.

84
00:05:16,400 --> 00:05:17,380
I just declare this.

85
00:05:17,380 --> 00:05:19,560
I looked at a here and there is.

86
00:05:19,760 --> 00:05:24,030
Let's actually go inside our Smurfette on click here.

87
00:05:24,050 --> 00:05:25,900
I am actually initializing these arii.

88
00:05:26,000 --> 00:05:29,190
So fi's assignment operator flightpath.

89
00:05:29,210 --> 00:05:32,730
So here I am actually failing to find power here which is of type file.

90
00:05:32,750 --> 00:05:33,370
Right.

91
00:05:33,380 --> 00:05:35,010
That list files.

92
00:05:35,210 --> 00:05:44,570
So here I am actually getting the images that are inside of these that are inside of this folder.

93
00:05:44,570 --> 00:05:45,460
Animal images.

94
00:05:45,560 --> 00:05:50,440
These are actually files as you can see here right with the P.A. format.

95
00:05:50,480 --> 00:05:58,250
So now I actually created a file is great and here are going to actually get at least FAE's least files

96
00:05:58,250 --> 00:05:58,530
means.

97
00:05:58,550 --> 00:06:04,610
These are actually images these files that are inside these animal images by actually calling the Smurf

98
00:06:04,610 --> 00:06:10,700
at least Foyles we can access these files that are inside of this folder and we can actually assigned

99
00:06:10,700 --> 00:06:12,110
these files to these files.

100
00:06:12,120 --> 00:06:12,570
Great.

101
00:06:12,710 --> 00:06:20,740
So now these are a files actually holds these files here that are inside of these animal images.

102
00:06:20,780 --> 00:06:23,890
And then here we actually created a for loop here.

103
00:06:23,900 --> 00:06:28,740
So for each index is actually equal to zero.

104
00:06:28,760 --> 00:06:34,810
So here initially I actually created a body of type integer and then I assigned the value zero to the

105
00:06:34,850 --> 00:06:35,540
index.

106
00:06:35,780 --> 00:06:42,260
And here I am specifying that if that does follow up here is going to be executed until the value of

107
00:06:42,260 --> 00:06:46,030
this index is less than the value of the length of these flights.

108
00:06:46,070 --> 00:06:46,750
Right.

109
00:06:47,000 --> 00:06:51,830
And then here I am specifying that if after each execution of this for loop we're going to actually

110
00:06:51,920 --> 00:06:54,490
add one value to the index variable.

111
00:06:54,680 --> 00:06:58,280
So let's actually go inside this for a loop here and let's see what's going on here.

112
00:06:58,400 --> 00:07:07,260
As you can see in line number of sixty five I actually referred to the name of this at a here file path

113
00:07:07,250 --> 00:07:13,470
names as you can see this is actually an alias right file path names dot at.

114
00:07:13,520 --> 00:07:18,370
So here I want to add some files to this file pathnames which is actually an Aurelia's.

115
00:07:18,560 --> 00:07:23,850
And as you can see here I just referred to the name of this at a Foy's sub index.

116
00:07:23,900 --> 00:07:30,350
So I want to get the specific value that is inside of the specific index of this tree that gets absolute

117
00:07:30,350 --> 00:07:39,120
path and in this way we can actually get the absolute path of these files that are inside of these animal

118
00:07:39,150 --> 00:07:40,530
images.

119
00:07:40,530 --> 00:07:41,130
Right.

120
00:07:41,190 --> 00:07:47,490
So here because we want to actually show these images through the user it is very important that we

121
00:07:47,490 --> 00:07:51,500
actually access the absolute path of these files.

122
00:07:51,540 --> 00:07:51,920
Right.

123
00:07:51,930 --> 00:07:58,390
So that's why we actually created this for loop in order to access or in order to get the absolute path

124
00:07:58,620 --> 00:08:03,720
and then to actually assign that absolute path to this file pathnames Aurelia's.

125
00:08:03,890 --> 00:08:05,980
So file pathnames that add.

126
00:08:06,210 --> 00:08:11,790
And then I refer to the name of this Aure sub index dot get absolute path.

127
00:08:11,790 --> 00:08:15,930
So for example initially the value of this index variable is zero.

128
00:08:15,930 --> 00:08:21,030
So Foyle's sub zero as you can see here is when I try to go inside of this at a Foyle's and it's going

129
00:08:21,030 --> 00:08:26,620
to actually get the first value that is inside of the index zero of this era.

130
00:08:26,910 --> 00:08:30,370
And it's going to call this method and that's why you get absolute path.

131
00:08:30,370 --> 00:08:34,180
So for example the absolute path of these imit image bear.

132
00:08:34,410 --> 00:08:38,240
So this bear is inside of the index zero of this at a.

133
00:08:38,670 --> 00:08:43,220
And then it's going to actually add that value to this Aurelia's file pathnames.

134
00:08:43,590 --> 00:08:49,470
And it's going to continue executing this for loop until it reaches to the last image right Tiger that

135
00:08:49,470 --> 00:08:50,580
PAGG.

136
00:08:50,760 --> 00:08:55,360
So now as you can see after the end uncurl curly brace of this if statement.

137
00:08:55,380 --> 00:09:01,060
Now I'm going to actually pasting some more lines of code here inside this if statement is stored is

138
00:09:01,170 --> 00:09:06,750
Permission granted and when actually pasting some lines of code here and then I'm going to explain to

139
00:09:06,750 --> 00:09:08,480
you what's going on here.

140
00:09:08,490 --> 00:09:15,660
So as you can see here these are the lines of code that I pasted here and now I'm going to explain to

141
00:09:15,660 --> 00:09:17,050
you what's going on here.

142
00:09:17,070 --> 00:09:18,140
Exactly.

143
00:09:18,360 --> 00:09:20,430
So here we have a for loop right.

144
00:09:20,670 --> 00:09:26,790
And initially as you can see we created a variable of type integer and the name of this variable is

145
00:09:26,790 --> 00:09:27,400
index.

146
00:09:27,480 --> 00:09:32,850
And then I assigned the values zero to this variable right index.

147
00:09:33,060 --> 00:09:39,540
And then here we actually created a condition that determines how many times this for loop is going

148
00:09:39,540 --> 00:09:40,840
to be executed.

149
00:09:41,130 --> 00:09:47,790
So this for a loop here is going to be executed until the value of this index is actually less than

150
00:09:48,000 --> 00:09:52,320
the value of the size of this file path names are a list.

151
00:09:52,380 --> 00:09:52,910
Right.

152
00:09:52,950 --> 00:09:58,710
So here we as you can see this is actually an Aurelie slight file pathnames that size and this for loop

153
00:09:58,710 --> 00:10:04,610
here is going to be executed until the value of this index is actually less than the size of this Aurelia's

154
00:10:04,680 --> 00:10:06,300
file pathnames.

155
00:10:06,300 --> 00:10:10,920
And then here if you are saying that after each execution of this for loop it's going to actually execute

156
00:10:10,920 --> 00:10:15,740
this is going to actually add one value to the value of this index variable.

157
00:10:15,930 --> 00:10:21,210
So now let's actually go inside the curly braces of this for a loop and let's see what's going on here

158
00:10:21,490 --> 00:10:28,620
in line number 172 as you can see we have actually a final variable which is of type image view.

159
00:10:28,650 --> 00:10:29,670
Right.

160
00:10:29,760 --> 00:10:36,230
So here we have a final which is actually a constant right image view and the name of this rowdier bill

161
00:10:36,240 --> 00:10:36,920
is in his view.

162
00:10:36,930 --> 00:10:43,590
And then I put an assignment operator here and as you can see I am actually creating a new object of

163
00:10:43,590 --> 00:10:45,170
type image view here.

164
00:10:45,330 --> 00:10:50,560
And I want to actually assign that object to this variable which is a fine image view right.

165
00:10:50,610 --> 00:10:53,560
So assignment operator new image view.

166
00:10:53,700 --> 00:11:00,810
And here for the for the argument of these constructor as you can see here we need to pass this context

167
00:11:00,990 --> 00:11:08,080
main activity that this and then here I referred to the name of this object image view that said E-Myth

168
00:11:08,110 --> 00:11:09,100
you are.

169
00:11:09,370 --> 00:11:09,980
OK.

170
00:11:10,200 --> 00:11:12,130
Image view that set image you are.

171
00:11:12,450 --> 00:11:16,160
And inside Apprentice's as you can see I refered to the name of this class.

172
00:11:16,200 --> 00:11:16,740
You are.

173
00:11:16,750 --> 00:11:20,980
That parts I want to actually parse something right.

174
00:11:21,000 --> 00:11:24,760
So inside Apprentice's I need to specify the value that I want to parse.

175
00:11:24,780 --> 00:11:25,040
Right.

176
00:11:25,080 --> 00:11:25,680
Right.

177
00:11:25,680 --> 00:11:32,100
So you or I that parse file pathnames Slahi it as you can see it is this Aurelia's the file pathnames

178
00:11:32,400 --> 00:11:36,320
actually contains these files these images.

179
00:11:36,330 --> 00:11:38,920
So now let me show you the.

180
00:11:39,470 --> 00:11:41,130
The Android device monitor.

181
00:11:41,130 --> 00:11:45,990
So just click on Tools Android Android device monitor.

182
00:11:45,990 --> 00:11:50,760
So now let's actually wait and let's see our Android device monitor here.

183
00:11:50,760 --> 00:11:54,860
So inside these thought this folder inside is emulated.

184
00:11:55,080 --> 00:12:01,890
And inside is a folder zero as you can see if you have these pictures directory right inside these pictures

185
00:12:01,930 --> 00:12:06,900
directory as you can see we have these animal images folder and inside this animal images folder we

186
00:12:06,900 --> 00:12:08,400
have these images.

187
00:12:08,400 --> 00:12:08,850
Right.

188
00:12:08,880 --> 00:12:14,330
So these are the files that are actually inside of this file path names are a list.

189
00:12:14,370 --> 00:12:20,820
So I want to actually parse these addresses these Foy's and I want to actually assign them.

190
00:12:20,820 --> 00:12:27,930
I want to actually set that image that specific image to image view as you can see after each execution

191
00:12:27,960 --> 00:12:32,230
of this for loop you are actually creating our actually an image view.

192
00:12:32,250 --> 00:12:32,900
Right.

193
00:12:32,910 --> 00:12:38,730
Every time this fall here is actually is executed an image is actually created.

194
00:12:38,730 --> 00:12:44,370
And as you can see here these lines of code here is going to be executed every time this full loop is

195
00:12:44,370 --> 00:12:44,990
executed.

196
00:12:45,000 --> 00:12:45,600
Right.

197
00:12:45,600 --> 00:12:50,350
So for the first time that this is executed the value of this index is zero.

198
00:12:50,400 --> 00:12:51,100
Right.

199
00:12:51,570 --> 00:12:54,100
And it's going to actually look at this line of code here.

200
00:12:54,150 --> 00:13:00,500
You are either parce file pathnames So this is an early release that actually contains these images.

201
00:13:00,540 --> 00:13:01,280
Right.

202
00:13:01,320 --> 00:13:02,230
That's good.

203
00:13:02,250 --> 00:13:08,980
So if you want to get some value and we need to pass the index of that specific value so index the index

204
00:13:08,990 --> 00:13:10,200
is zero initially right.

205
00:13:10,200 --> 00:13:15,570
So it's going to actually get the beer as you can see here the beer here and it's going to actually

206
00:13:15,810 --> 00:13:19,590
set that beer image to this image here.

207
00:13:19,590 --> 00:13:25,870
So in order to actually parse that specific image that we have inside the SD card we need to actually

208
00:13:25,890 --> 00:13:32,010
use the image you or I used this method in order to access the images that are inside of your SD card.

209
00:13:32,130 --> 00:13:33,380
So that image you or I.

210
00:13:33,480 --> 00:13:39,290
You are either part file pathnames that get index right an image view.

211
00:13:39,330 --> 00:13:44,020
Let's look at this line of code here 174 image view that sets labeled products.

212
00:13:44,130 --> 00:13:50,250
And here you are specifying the layout problems that and the height of our image.

213
00:13:50,480 --> 00:13:55,940
OK so image view that certainly out perhaps new linearly out.

214
00:13:56,010 --> 00:14:02,580
So remember that I told you when you are specifying the layout problems inside the pantheists you must

215
00:14:02,580 --> 00:14:06,070
specify the parent of your image view.

216
00:14:06,150 --> 00:14:11,160
So our image view is going to be inside our linear layout.

217
00:14:11,160 --> 00:14:15,040
Right so that's why this linearly out here is the palette.

218
00:14:15,060 --> 00:14:23,190
So new linearly out that lay out plot arms and for the width I assign the value of five hundred and

219
00:14:23,190 --> 00:14:25,900
for the height I assigned to the value 500.

220
00:14:26,010 --> 00:14:26,460
Right.

221
00:14:26,520 --> 00:14:29,830
So it is going to be there width and the height of our image view.

222
00:14:29,910 --> 00:14:35,740
So here it is very important that you specify the parent of your image view.

223
00:14:35,820 --> 00:14:36,460
Right.

224
00:14:36,600 --> 00:14:45,090
So now let me show you the emulator as you me I actually opened the app for free.

225
00:14:45,240 --> 00:14:47,870
Now let me actually click on this button here.

226
00:14:47,870 --> 00:14:51,150
Allow access pictures in the cart as you can see.

227
00:14:51,260 --> 00:14:52,830
You can see these images right.

228
00:14:52,820 --> 00:14:57,630
So these images are actually inside a horizontal linearly out right.

229
00:14:57,650 --> 00:15:04,610
So because these images are actually inside the horizontal linear layout it is very important that you

230
00:15:04,670 --> 00:15:11,750
know that the parent of these image views as you can see here are actually inside or actually are linearly

231
00:15:11,750 --> 00:15:13,820
out like a linearly or horizontally.

232
00:15:13,910 --> 00:15:17,320
So that's why I said linear out that lay out perhaps.

233
00:15:17,360 --> 00:15:25,040
And I specified the beach at the height of my image view and now as you can see in line number 176 I

234
00:15:25,040 --> 00:15:27,880
created another constant which is of that integer.

235
00:15:27,890 --> 00:15:34,410
So final point and here I actually named this valuable as actually.

236
00:15:34,850 --> 00:15:37,440
And then I assigned to this index to this already.

237
00:15:37,490 --> 00:15:40,240
So here we actually get this index from this for loop.

238
00:15:40,250 --> 00:15:41,260
Right.

239
00:15:41,300 --> 00:15:45,930
So I actually assigned this index to this I.

240
00:15:46,280 --> 00:15:53,100
So now because I want to actually use these index inside are anonymous in a class.

241
00:15:53,150 --> 00:16:01,690
I need to I actually must provide an order constant in order to actually get the value of this index

242
00:16:01,700 --> 00:16:06,400
because I cannot access the value of this index in inside this anonymous class.

243
00:16:06,410 --> 00:16:10,060
So let's just actually look at these lines of code here and then it will make sense.

244
00:16:10,250 --> 00:16:15,650
So here as you can see I am actually referring to the name of this variable image view right which is

245
00:16:15,650 --> 00:16:22,430
of image view image view that said Uncle Clisson or so I am actually providing a lesson there for these

246
00:16:22,430 --> 00:16:23,630
images in his views.

247
00:16:23,630 --> 00:16:29,420
So for example when the user clicks and is cow here as he can see an image is appearing here right.

248
00:16:29,540 --> 00:16:36,050
So I am actually creating a listener for this image we use here so that something happens when the user

249
00:16:36,050 --> 00:16:37,790
clicks on these images.

250
00:16:37,790 --> 00:16:41,350
So now let's actually go back to our Android studio.

251
00:16:41,480 --> 00:16:47,600
So here as you can see image view that said Uncle listener new view that unclick listening.

252
00:16:47,630 --> 00:16:53,300
And as you can see here I am actually creating an anonymous inner class that actually is implant is

253
00:16:53,300 --> 00:16:55,690
implementing this uncle because an interface.

254
00:16:55,850 --> 00:17:03,410
And as a result this anonymous class must actually provide an implementation for this uncle Merfeld

255
00:17:03,650 --> 00:17:06,550
that we have inside this uncle class in an interface.

256
00:17:06,650 --> 00:17:09,910
So that's why you can see we're actually overwriting this method here.

257
00:17:10,160 --> 00:17:13,560
So Pablito void unclick view.

258
00:17:13,850 --> 00:17:19,680
And then inside the Smurfette as you can see I actually fear to this image to each other object.

259
00:17:19,730 --> 00:17:20,240
Right.

260
00:17:20,270 --> 00:17:26,480
So if I actually scroll to the top here as you can see we actually declared this variable which is of

261
00:17:26,480 --> 00:17:31,820
type image switcher as you can see here and the name of this variable is image creature and it inside

262
00:17:31,820 --> 00:17:35,660
these uncreate Smurfette you actually initialized this image.

263
00:17:35,660 --> 00:17:38,870
So each hour here in line number one hundred fifty six.

264
00:17:38,900 --> 00:17:39,900
So Image Sutor.

265
00:17:39,940 --> 00:17:45,300
Assignment operator and then here I am casting this image so we show to our imagery to object find view

266
00:17:45,500 --> 00:17:52,670
ID or ID that image switcher and that he and as you can see I am setting up a factory image suture that

267
00:17:52,670 --> 00:17:58,250
says back to the main activity that this and we must do this in order to create an animation as you

268
00:17:58,250 --> 00:17:58,960
can see here.

269
00:17:59,090 --> 00:18:00,950
So Image Tsui shirt that said animation.

270
00:18:00,950 --> 00:18:05,670
And here I am setting the animation as you can see here Art.

271
00:18:05,720 --> 00:18:13,400
And in that slide in lift and here set in animation right and then he in line number 143 here I am sitting

272
00:18:13,400 --> 00:18:15,160
there set out animation.

273
00:18:15,350 --> 00:18:21,910
So this happens when the image is going to be disappeared from the front the screen.

274
00:18:22,070 --> 00:18:22,490
Right.

275
00:18:22,550 --> 00:18:25,700
Image switcher that set out animation animation.

276
00:18:26,040 --> 00:18:27,220
That looked animation.

277
00:18:27,230 --> 00:18:33,280
And for the first argument I passed this human activity that this and for the second argument I passed

278
00:18:33,290 --> 00:18:35,880
this value Android that are that.

279
00:18:35,960 --> 00:18:37,340
And in that light out.

280
00:18:37,360 --> 00:18:38,360
Right.

281
00:18:38,630 --> 00:18:44,420
And then here inside our undercarriage method as you can see let's actually scroll to the top here.

282
00:18:44,540 --> 00:18:48,400
Inside our uncle Meffert inside this uncreate Smurfette as you can see here.

283
00:18:48,590 --> 00:18:53,000
As you can see here I am actually said the image you are on to this image switcher because you want

284
00:18:53,000 --> 00:18:55,370
to put the image we use inside.

285
00:18:55,830 --> 00:18:59,980
I want to actually put I want to show the imagery inside our image through it.

286
00:18:59,990 --> 00:19:05,200
So when the user clicks on this for example image or cat as you can see a cat appears here.

287
00:19:05,210 --> 00:19:07,160
Here we have an image switcher.

288
00:19:07,160 --> 00:19:08,150
Right.

289
00:19:08,150 --> 00:19:14,320
And here we have a horizontal linearly out that actually contains images image views of these animals.

290
00:19:14,360 --> 00:19:15,580
As you can see here.

291
00:19:16,120 --> 00:19:19,130
So image that set image you are right.

292
00:19:19,160 --> 00:19:25,410
So whenever the user clicks on these images as you can see here for example this appeared this unclear

293
00:19:25,470 --> 00:19:27,700
if it here is going to be executed image through it.

294
00:19:27,740 --> 00:19:33,700
That said as you are again we are parsing this image from the from the SD card.

295
00:19:33,740 --> 00:19:36,750
So we need to use the image set image you RMF it.

296
00:19:36,860 --> 00:19:39,500
So you are either to parse file pathnames.

297
00:19:39,500 --> 00:19:41,120
Here I am referring to the name of.

298
00:19:41,120 --> 00:19:47,350
These are a list file pathnames that get the image that it is that is inside of the index.

299
00:19:47,660 --> 00:19:52,940
So now you understand why we actually created this constant here which is of type Integer.

300
00:19:52,940 --> 00:19:56,420
I created this constant here because of that integer.

301
00:19:56,660 --> 00:19:59,310
And then I assigned this index here to this.

302
00:19:59,540 --> 00:20:08,690
Because we cannot actually access a variable outside of this uncle if it is Uncle method here needs

303
00:20:08,690 --> 00:20:11,670
to actually access a constant not valuable.

304
00:20:11,810 --> 00:20:16,780
So that's why we created a constant here and then we actually assigned this index to this.

305
00:20:17,000 --> 00:20:22,430
And here inside is anonymous in a class we can actually get the value of this ID right.

306
00:20:22,430 --> 00:20:24,740
As you can see file pathnames that gets by.

307
00:20:24,890 --> 00:20:29,450
And that's why you can see that when I click on this image image views as you can see here the specific

308
00:20:29,510 --> 00:20:32,070
image is actually appearing here.

309
00:20:32,510 --> 00:20:40,040
And finally after the ending curly brace or after the end in practice of this satanically listen and

310
00:20:40,040 --> 00:20:47,510
Minford as you can see here I am actually I think that image is linearly held horizontally that view

311
00:20:47,510 --> 00:20:53,900
image view right here we are saying that if that image is actually clicked then it's going to put that

312
00:20:53,930 --> 00:20:55,520
image inside this image through each other.

313
00:20:55,530 --> 00:21:01,220
But we must actually put this line of code here before the end in curly brace of this for a loop so

314
00:21:01,220 --> 00:21:08,740
that when ever that this fall if he's executed our image views are actually appearing here right on

315
00:21:08,960 --> 00:21:11,090
the image views are appeared here.

316
00:21:11,110 --> 00:21:13,930
One by one you can see these images one by one here.

317
00:21:14,090 --> 00:21:18,690
So I am actually we must actually put this line of code here linearly and horizontal.

318
00:21:18,690 --> 00:21:21,200
Here I am referring to the linearly are horizontal.

319
00:21:21,200 --> 00:21:25,050
That is the parent of these image views as you can see here.

320
00:21:25,160 --> 00:21:29,030
And then here I am adding this image to this linearly or horizontal.

321
00:21:29,030 --> 00:21:33,550
So that's why you can see that these image views are inside of this linearly horizontally.

322
00:21:33,650 --> 00:21:38,100
We must add them in here to this linearly outhaul is on.

323
00:21:38,260 --> 00:21:38,740
Right.

324
00:21:38,750 --> 00:21:42,520
So I think that's actually did on our project here.

325
00:21:42,720 --> 00:21:44,470
And let's see what happens.

326
00:21:44,480 --> 00:21:47,030
As you can see here at the port at the bottom we have this error.

327
00:21:47,120 --> 00:21:50,600
So we must close the Android device monitor first.

328
00:21:50,600 --> 00:21:52,460
Let's run our project again.

329
00:21:53,250 --> 00:21:56,760
So as you can see here our application is actually to restarted.

330
00:21:57,140 --> 00:22:06,020
And now let's actually close this application let's run our project again.

331
00:22:06,090 --> 00:22:09,760
So now as you can see here our application is running on the simulator.

332
00:22:09,810 --> 00:22:15,000
Now let me make this virtual keyboard keyboard he had disappeared.

333
00:22:15,100 --> 00:22:16,210
Let me scroll down here.

334
00:22:16,260 --> 00:22:19,790
Let's actually click on the spot and allow access pictures in SD card.

335
00:22:19,860 --> 00:22:24,580
And now you can I see this you can actually see that we have this image we use Enceladus linearly out

336
00:22:24,580 --> 00:22:25,440
horizontal.

337
00:22:25,470 --> 00:22:30,930
And if I actually click on one of these image views here as you can see we can see this image view inside

338
00:22:30,930 --> 00:22:32,590
this image suture.

339
00:22:32,610 --> 00:22:33,410
Right.

340
00:22:33,540 --> 00:22:38,520
You can see the actually the animation slide in and slide out.

341
00:22:38,610 --> 00:22:41,780
So I think that's enough for this application.

342
00:22:41,890 --> 00:22:48,060
And if you have any question as regards these concepts that I taught you in this in these tutorials

343
00:22:48,600 --> 00:22:53,360
please post the discussion in the course and then I do my best to answer all of your questions.

344
00:22:53,490 --> 00:22:57,260
Thank you very much for watching and I'll see you in the next few Tauriel.

