1
00:00:00,240 --> 00:00:03,750
OK the specific value that is inside of this specific position.

2
00:00:03,820 --> 00:00:04,430
OK.

3
00:00:04,680 --> 00:00:07,370
So the next method is get an ID ID.

4
00:00:07,410 --> 00:00:14,030
So as you can see here are the return type of this method is long and the name of this method is gets

5
00:00:14,080 --> 00:00:19,450
either an ID and if it actually accepts an argument of type position as you can see here.

6
00:00:19,570 --> 00:00:29,250
So the item id of our objects would be that the position of our values inside of our arms for example

7
00:00:29,250 --> 00:00:34,740
this animal images array for example at the position of this value as you can see here is zero.

8
00:00:34,740 --> 00:00:35,190
OK.

9
00:00:35,340 --> 00:00:37,460
So this would be the item ID.

10
00:00:37,530 --> 00:00:37,960
OK.

11
00:00:38,100 --> 00:00:41,910
So I can just return this position here.

12
00:00:42,120 --> 00:00:46,940
OK and as you can see here we have good view of it.

13
00:00:46,950 --> 00:00:53,270
So this effort is going to be called up on every iteration of our values inside of the literalist view

14
00:00:53,280 --> 00:00:53,780
OK.

15
00:00:53,910 --> 00:01:00,090
Whenever we actually scroll down or up or dismiss this if it is going to be called in order to actually

16
00:01:00,840 --> 00:01:05,040
put our objects and values to the list the list view.

17
00:01:05,040 --> 00:01:05,400
OK.

18
00:01:05,400 --> 00:01:07,300
So this is very important.

19
00:01:07,440 --> 00:01:12,660
And as you can see it isn't if it actually returns a value of type view and the name of this and if

20
00:01:12,660 --> 00:01:13,630
it is good view.

21
00:01:13,770 --> 00:01:14,430
OK.

22
00:01:14,760 --> 00:01:20,820
And as you can see this in fact accepts the arguments the first argument is in position the position

23
00:01:20,850 --> 00:01:23,910
of objects inside of the list view.

24
00:01:24,030 --> 00:01:24,530
OK.

25
00:01:24,780 --> 00:01:29,230
And this of you as you can see here this is another argument kind of interview.

26
00:01:29,250 --> 00:01:33,320
So just change the name of this argument to view.

27
00:01:33,670 --> 00:01:39,760
OK so this argument is the view of objects in the list view.

28
00:01:39,840 --> 00:01:40,380
OK.

29
00:01:40,620 --> 00:01:44,360
And we have a view Group parent OK.

30
00:01:44,880 --> 00:01:47,720
And this would be for example the list itself.

31
00:01:47,760 --> 00:01:48,700
OK.

32
00:01:49,380 --> 00:01:54,540
Now let's actually delete this line of quote here and then we're going to actually put in our own implementations

33
00:01:54,870 --> 00:01:56,710
inside of the Smurfette here.

34
00:01:56,790 --> 00:02:02,010
So now I'm going to actually paste in some lines of code here inside of this method and then I'm going

35
00:02:02,010 --> 00:02:03,550
to explain to you what's going on here.

36
00:02:03,600 --> 00:02:08,860
So as you can see here these are the lines of code that you actually paste that here inside of this

37
00:02:09,210 --> 00:02:09,930
view Smurfette.

38
00:02:09,990 --> 00:02:10,570
OK.

39
00:02:10,860 --> 00:02:18,900
First of all in line 57 as you can see here I actually try to assign a value to this view object that

40
00:02:18,900 --> 00:02:22,630
we actually receive as an argument from the same if it gets V.

41
00:02:22,680 --> 00:02:23,280
OK.

42
00:02:23,400 --> 00:02:28,490
So I just referred to the name of this argument view assignment operator.

43
00:02:28,680 --> 00:02:34,980
And then I actually have referred to this layout inflator object that I actually declared in line 17

44
00:02:35,100 --> 00:02:38,600
in in our customized view class.

45
00:02:38,600 --> 00:02:45,590
And as you can see here inside of this constructor of this customized this view class I actually instantiated

46
00:02:45,600 --> 00:02:46,230
this object.

47
00:02:46,230 --> 00:02:46,840
OK.

48
00:02:47,220 --> 00:02:52,220
So as you can see here I referred to the name of that object out inflator dot.

49
00:02:52,410 --> 00:02:55,990
And here I am actually calling this inflates Mefford on this object.

50
00:02:56,010 --> 00:02:56,730
OK.

51
00:02:57,300 --> 00:02:59,840
And this MF it actually exits to arguments.

52
00:03:00,030 --> 00:03:04,750
The first argument is actually the customize the list view.

53
00:03:04,770 --> 00:03:10,620
OK we need to put our own customized list view that we actually created in our project.

54
00:03:10,630 --> 00:03:14,050
OK so this is our customized this view that XML file.

55
00:03:14,280 --> 00:03:21,210
So for the first argument I needed to assign that value here or that layout that customized this view

56
00:03:21,210 --> 00:03:21,790
OK.

57
00:03:22,050 --> 00:03:24,920
And it's like such an argument is of for The Root.

58
00:03:25,050 --> 00:03:28,380
So we don't need that value here.

59
00:03:28,380 --> 00:03:33,770
So I just nod here and here as you can see in line 59.

60
00:03:34,230 --> 00:03:38,680
I actually created an object of type image view.

61
00:03:38,880 --> 00:03:41,650
So the name of this image is our empty animal.

62
00:03:41,760 --> 00:03:42,240
OK.

63
00:03:42,450 --> 00:03:48,180
As you can see here in our customized underline list underlined view that image here as you can see

64
00:03:48,180 --> 00:03:52,780
this is our image view and the idea of this image is I m g.

65
00:03:52,830 --> 00:03:53,560
OK.

66
00:03:54,000 --> 00:04:00,990
And here I assigned the value I am the animal for the name of my image view assignment operator and

67
00:04:00,990 --> 00:04:06,540
as you can see here I am actually casting this object to art to an image view object.

68
00:04:06,540 --> 00:04:10,230
And here as you can see I referred to the name of this view here.

69
00:04:10,230 --> 00:04:10,690
OK.

70
00:04:10,860 --> 00:04:17,310
So this view actually has this customized underline list underline view inside it.

71
00:04:17,310 --> 00:04:17,880
OK.

72
00:04:17,880 --> 00:04:24,210
So I needed to actually first to this view here in order to access these components inside of these

73
00:04:24,420 --> 00:04:25,840
customized to this view here.

74
00:04:25,860 --> 00:04:26,660
OK.

75
00:04:27,060 --> 00:04:34,440
And here I refer to this view here Dot find the view by ID or that ID that I enjoy.

76
00:04:34,830 --> 00:04:36,280
And I do the same here.

77
00:04:36,530 --> 00:04:40,900
I actually declared this takes view as final.

78
00:04:41,340 --> 00:04:41,910
OK.

79
00:04:42,240 --> 00:04:46,880
And as you know final means that this object is actually constant.

80
00:04:47,040 --> 00:04:47,760
OK.

81
00:04:48,180 --> 00:04:54,930
And as you can see type of My object is a text view the name of my object is the animal name assignment

82
00:04:54,960 --> 00:05:02,970
operator and then here I actually cast this object to our text view object view that find view by ID

83
00:05:03,030 --> 00:05:06,330
or thought Id taught the animal name.

84
00:05:06,660 --> 00:05:12,900
And I did the same job here takes few takes the animal power and then I actually cast the object to

85
00:05:12,900 --> 00:05:20,280
a text view object view that find view by ID or the idea that the animal power as you can see here.

86
00:05:20,490 --> 00:05:26,610
So if we have to use the animal name and we have to use the animal power here and here as you can see

87
00:05:26,670 --> 00:05:36,150
we have the animal speed view find view by id our ID that the animal speed and here I actually created

88
00:05:36,390 --> 00:05:38,240
to String objects OK.

89
00:05:38,400 --> 00:05:40,650
Stream all the animal power.

90
00:05:40,840 --> 00:05:41,360
OK.

91
00:05:41,610 --> 00:05:46,200
As you can see here the unempowered that gettext that Stream.

92
00:05:46,540 --> 00:05:53,950
And I actually created another string object that old RTX the animal speed the animal speed that get

93
00:05:54,180 --> 00:05:55,430
text that was strange.

94
00:05:55,500 --> 00:06:02,080
OK so now I want to actually output some images to the image views on the screen.

95
00:06:02,080 --> 00:06:05,260
OK so as you can see here these are the addresses of our images.

96
00:06:05,260 --> 00:06:05,770
OK.

97
00:06:06,070 --> 00:06:07,380
So here are.

98
00:06:07,690 --> 00:06:15,070
I just need to refer to the name of these are UMG animals that set image resource.

99
00:06:15,310 --> 00:06:15,960
OK.

100
00:06:16,450 --> 00:06:22,990
And here as you can see this if it actually accepts as you can see at say enjoyable resource this refers

101
00:06:23,230 --> 00:06:26,880
to the triable folder ain't there ID as you can see here.

102
00:06:27,180 --> 00:06:27,740
OK.

103
00:06:27,970 --> 00:06:36,910
So here I need to actually refer to the rest ID resources ID of my images inside the tribal folder.

104
00:06:36,910 --> 00:06:37,570
OK.

105
00:06:37,570 --> 00:06:40,780
So these are the addresses that are inside of this animal images.

106
00:06:40,810 --> 00:06:47,170
So I can't just refer to the name of that every animal images Suppe position.

107
00:06:47,800 --> 00:06:52,780
So as you can see here we have this position as an argument to disprove it and we can use this position

108
00:06:52,900 --> 00:06:53,960
here in RMF.

109
00:06:54,010 --> 00:06:59,520
So as you can see here I just referred to this opposition here that we see as an argument.

110
00:06:59,740 --> 00:07:06,580
So this position knows of the specific value that is inside of that specific position of this tree.

111
00:07:06,760 --> 00:07:12,760
So if we could just refer to that position and here we can actually access this specific image that

112
00:07:12,760 --> 00:07:16,050
is inside of this specific position of these Adli.

113
00:07:16,070 --> 00:07:22,920
OK so now let's actually go back and say this main activity double file here.

114
00:07:22,930 --> 00:07:28,960
Now let's actually create an object from these customized list view class here.

115
00:07:29,200 --> 00:07:32,840
So I just need to refer to the name of this class customize the list view.

116
00:07:33,240 --> 00:07:37,860
And I would prefer to name this object adapter.

117
00:07:38,100 --> 00:07:38,410
OK.

118
00:07:38,410 --> 00:07:44,300
Because as you can see this customized to this view extends base adapter class.

119
00:07:44,320 --> 00:07:48,010
OK so there is and is our relationship between these two classes.

120
00:07:48,010 --> 00:07:48,520
OK.

121
00:07:48,790 --> 00:07:54,870
So I can call the object that I actually create from this customize this view as adapter.

122
00:07:54,960 --> 00:07:55,220
OK.

123
00:07:55,240 --> 00:07:59,410
Assignment operator and then I just put in the new convert.

124
00:07:59,560 --> 00:08:04,150
And here again I referred to the name of this customized and this view class.

125
00:08:04,150 --> 00:08:10,600
So as you can see here are the constructor of this class actually accepts a value of type context as

126
00:08:10,600 --> 00:08:11,900
you can see here.

127
00:08:11,990 --> 00:08:15,200
And we created the constructor of this class.

128
00:08:15,240 --> 00:08:21,340
You specify that this class actually sets an argument of that context.

129
00:08:21,430 --> 00:08:29,020
And here we initialized this context of valuable instance value but that we created inside of this class

130
00:08:29,680 --> 00:08:35,220
and then we initialized this layout inflator object that we created inside of this class.

131
00:08:35,320 --> 00:08:35,890
OK.

132
00:08:36,220 --> 00:08:43,190
So here I just need to put in a context so the context would be this class.

133
00:08:43,210 --> 00:08:44,580
Ok main activity class.

134
00:08:44,650 --> 00:08:51,280
So I can just type in main activity that this and then I need to put in the semicolon at the end of

135
00:08:51,280 --> 00:08:52,460
my statement.

136
00:08:52,930 --> 00:08:57,110
So as you can see if you have an adapter here and we have also a list view.

137
00:08:57,130 --> 00:09:00,860
OK that is inside of this content underline mean that example.

138
00:09:00,880 --> 00:09:08,650
So now I want to actually inflate these or customize the list view here that we created on these content

139
00:09:08,680 --> 00:09:10,870
underline mean that segment on this list view here.

140
00:09:10,900 --> 00:09:11,370
OK.

141
00:09:11,530 --> 00:09:19,480
So in order to do that I can just type in LSD list and it's the view that set adapter.

142
00:09:20,050 --> 00:09:20,790
OK.

143
00:09:20,950 --> 00:09:26,740
And here we need to putting the adapter inside of this Apprentice's so I can just refer to the name

144
00:09:26,740 --> 00:09:34,900
of this adapter object as you can see here and it's done both but you have an arrow inside of this customized

145
00:09:34,960 --> 00:09:37,030
at view that job offer it here.

146
00:09:37,390 --> 00:09:44,260
As you can see here inside of these gates view it as you can see of you needed to actually return an

147
00:09:44,260 --> 00:09:45,860
object of type view.

148
00:09:46,030 --> 00:09:47,160
As you can see here it is.

149
00:09:47,170 --> 00:09:51,630
And if it actually returns a value of view so I can just return to that view here.

150
00:09:51,730 --> 00:09:52,150
OK.

151
00:09:52,300 --> 00:09:57,700
The view that we receive as an argument and as you can see in line 57 I assigned this value to that

152
00:09:58,000 --> 00:09:58,850
of you object.

153
00:09:58,870 --> 00:09:59,370
OK.

154
00:09:59,380 --> 00:10:01,660
Lay out inflators that inflate.

155
00:10:01,660 --> 00:10:03,660
These are customized to this view.

156
00:10:03,700 --> 00:10:04,340
OK.

157
00:10:04,660 --> 00:10:07,290
And as you can see the second argument is not OK.

158
00:10:07,510 --> 00:10:10,840
And then we assign that value to this object.

159
00:10:10,930 --> 00:10:15,490
And here I can just pretend that value return view semi-colon.

