1
00:00:00,630 --> 00:00:06,180
So now it's actually to go to the Android studio again and here as you can see it's showing us an error

2
00:00:06,300 --> 00:00:14,460
and it says that class customized list view must either be declared abstract or implement abstract method

3
00:00:14,560 --> 00:00:16,020
get count in adapter.

4
00:00:16,230 --> 00:00:21,450
So if you have some abstract methods that we need to actually implement in our class.

5
00:00:21,570 --> 00:00:25,950
But first of all it's actually adding some more lines of code here.

6
00:00:25,950 --> 00:00:31,270
So inside of this customized Lisp Violette's actually declare two objects.

7
00:00:31,350 --> 00:00:35,280
So I'm going to just paste two lines of code here and then I'm going to explain to you what's going

8
00:00:35,280 --> 00:00:35,920
on here.

9
00:00:36,210 --> 00:00:42,240
So as you can see here these are the two objects that I actually declared inside of these are customized

10
00:00:42,530 --> 00:00:43,700
to your class.

11
00:00:43,710 --> 00:00:48,440
So first of all about inline 12 I actually declared an object of type context.

12
00:00:48,480 --> 00:00:50,330
OK so what is in context.

13
00:00:50,340 --> 00:00:53,900
So let's actually go to the Android documentation in order to see what is a context.

14
00:00:53,940 --> 00:00:59,700
As you can see this is the context class and here it says interface to global interface.

15
00:00:59,730 --> 00:01:01,640
About an application environment.

16
00:01:01,770 --> 00:01:08,100
This is an abstract class whose implementation is provided by the Android system.

17
00:01:08,310 --> 00:01:12,930
It allows access to application specific resources and classes.

18
00:01:12,950 --> 00:01:18,690
Ok so if we can actually get access to the application specific resources and classes by using this

19
00:01:18,840 --> 00:01:26,400
context class okay as well as up calls for application level operations such as launching activities

20
00:01:26,790 --> 00:01:31,300
broadcasting and receiving intense intense et cetera.

21
00:01:31,320 --> 00:01:34,490
So now let's go to the Android studio.

22
00:01:34,530 --> 00:01:37,730
So here we needed to actually create an object of type context.

23
00:01:37,740 --> 00:01:42,480
So I just declared this object in inline 12 and inline 14.

24
00:01:42,500 --> 00:01:45,520
I declared an object of type lay out inflator.

25
00:01:45,710 --> 00:01:48,390
OK so what's the job of this layout.

26
00:01:48,390 --> 00:01:55,030
Inflator object the inflicted object is going to actually inflate this.

27
00:01:55,060 --> 00:02:00,090
Customize this view as you can see here is going to actually inflate this customize this view.

28
00:02:00,180 --> 00:02:06,190
And these are List view that we actually put inside of this content underline made that example.

29
00:02:06,210 --> 00:02:12,470
So let me explain again this layout inflator object is going to inflate.

30
00:02:12,560 --> 00:02:21,180
These are customized list view on this list view of object that you actually put inside of this content.

31
00:02:21,180 --> 00:02:22,600
Underline that example.

32
00:02:22,710 --> 00:02:23,450
OK.

33
00:02:23,760 --> 00:02:29,080
So here let's actually go inside this because customize the list view of a file.

34
00:02:29,220 --> 00:02:33,000
And here it's actually declared as some arrays here.

35
00:02:33,000 --> 00:02:37,650
Now I'm going to actually pasting the some lines of code here and then I'm going to explain to you what's

36
00:02:37,650 --> 00:02:38,360
going on here.

37
00:02:38,360 --> 00:02:38,930
OK.

38
00:02:39,330 --> 00:02:42,670
So as you can see here these are the lines of code that they actually pasted here.

39
00:02:42,750 --> 00:02:43,130
OK.

40
00:02:43,230 --> 00:02:51,150
First of all I created an array of integer values and as you can see here are the name of my art.

41
00:02:51,280 --> 00:02:53,160
Art is animal images.

42
00:02:53,270 --> 00:02:53,830
OK.

43
00:02:54,090 --> 00:02:57,900
Assignment operator and here I am actually instantiating this tree.

44
00:02:57,960 --> 00:02:58,490
OK.

45
00:02:58,710 --> 00:03:02,470
So inside of these curly braces I actually assigned some values.

46
00:03:02,490 --> 00:03:04,120
So what are these values.

47
00:03:04,260 --> 00:03:10,020
These values are actually are the ideas of the resources that we have in our project.

48
00:03:10,020 --> 00:03:14,000
So inside of this triable folder as you can see we have these images.

49
00:03:14,010 --> 00:03:14,590
OK.

50
00:03:14,820 --> 00:03:22,760
So in order to refresh these images I just typed in here are OK that triable.

51
00:03:22,860 --> 00:03:26,760
So he had referred to this tribal folder that's there.

52
00:03:26,970 --> 00:03:31,130
So I just referred to this bear that PNB image here OK.

53
00:03:31,140 --> 00:03:35,310
So it is actually an ID of this image inside of our project.

54
00:03:35,310 --> 00:03:35,970
OK.

55
00:03:36,330 --> 00:03:41,600
So that's why we actually created a valuable of our integer values.

56
00:03:41,610 --> 00:03:41,940
OK.

57
00:03:41,940 --> 00:03:44,010
An array of integer values.

58
00:03:44,010 --> 00:03:47,000
Ok so the type of our array is int.

59
00:03:47,130 --> 00:03:53,280
As you can see here and we have as you can see our trouble that beard here I am referring to this image

60
00:03:54,240 --> 00:04:00,750
we have our thoughts drawable that chance we have we are actually referring to this image here and we

61
00:04:00,750 --> 00:04:03,220
have our thought triable that ciao.

62
00:04:03,450 --> 00:04:05,440
And here I am referring to this image.

63
00:04:05,760 --> 00:04:14,360
Our thoughts are triable that Dalfin this image are Roybal that fish this image are that are triable

64
00:04:14,360 --> 00:04:16,640
that Fox this image.

65
00:04:16,830 --> 00:04:20,640
And here as you can see Artaud to throw a belt that holds this image.

66
00:04:20,670 --> 00:04:26,460
And as you can see we have two other images here are that triable that live in this image.

67
00:04:26,490 --> 00:04:30,000
And these are triable the tiger this image.

68
00:04:30,030 --> 00:04:30,950
OK.

69
00:04:31,290 --> 00:04:35,550
So now as you can see I am referring to the two those images in my project.

70
00:04:35,550 --> 00:04:36,170
OK.

71
00:04:36,540 --> 00:04:40,030
And here I created another array as you can see here.

72
00:04:40,170 --> 00:04:42,120
And this is actually of type.

73
00:04:42,150 --> 00:04:46,340
Strange as you can see I have an array of string values.

74
00:04:46,470 --> 00:04:49,090
The name of this area is animal names.

75
00:04:49,380 --> 00:04:52,460
And then I assigned somebody to this addy.

76
00:04:52,470 --> 00:04:53,960
OK so bear.

77
00:04:54,220 --> 00:04:55,230
Ok bear.

78
00:04:55,430 --> 00:04:57,200
Chad's a cow.

79
00:04:57,210 --> 00:04:58,890
So as you can see here.

80
00:04:59,850 --> 00:05:02,370
Order is important here.

81
00:05:02,620 --> 00:05:09,120
The other must be this must be the same as the order of these images of these ideas that are actually

82
00:05:09,120 --> 00:05:10,910
assigned to these images.

83
00:05:10,960 --> 00:05:12,120
Ari OK.

84
00:05:12,780 --> 00:05:21,210
And here as you can see I am I actually created an order of array of type integer values animals power.

85
00:05:21,360 --> 00:05:29,070
And these are the value of the power of these animals that are assigned to these arrays here as you

86
00:05:29,070 --> 00:05:29,740
can see.

87
00:05:29,910 --> 00:05:31,490
And I have another array.

88
00:05:31,480 --> 00:05:38,340
He had animals speech and he had as he can see these are the values that are related to these animals

89
00:05:38,340 --> 00:05:39,830
here that we have in our project.

90
00:05:39,840 --> 00:05:40,330
OK.

91
00:05:40,500 --> 00:05:43,680
These are as you can see the order is really important here.

92
00:05:43,680 --> 00:05:46,880
For example this number 50 is for this bear animal.

93
00:05:47,070 --> 00:05:50,080
This is for these a bird animal here.

94
00:05:50,100 --> 00:05:50,900
OK.

95
00:05:51,240 --> 00:05:56,250
So now let's actually adding some more lines of code in our our class.

96
00:05:56,330 --> 00:05:56,700
OK.

97
00:05:56,730 --> 00:06:01,230
So I'm gonna paste in some lines of code here and then I'm going to explain to you what's going on here.

98
00:06:01,230 --> 00:06:07,870
So now I want to actually create a constructor for this customized list your class here.

99
00:06:07,920 --> 00:06:10,650
So I'm just gonna paste it here.

100
00:06:11,070 --> 00:06:14,410
As you can see this is a constructor for this.

101
00:06:14,460 --> 00:06:16,780
A customized list for your class.

102
00:06:16,950 --> 00:06:22,230
And as you can see here this construct it actually accepts a value of type context.

103
00:06:22,230 --> 00:06:25,530
OK as you can see and the name of this argument is context.

104
00:06:25,530 --> 00:06:26,100
OK.

105
00:06:26,370 --> 00:06:33,690
And inside of this are constructed first of all I am actually instantiating this a constant object as

106
00:06:33,690 --> 00:06:40,260
you can see here that I actually declare it inside of this customized List View class destock context

107
00:06:40,590 --> 00:06:42,290
assignment operator context.

108
00:06:42,300 --> 00:06:42,910
OK.

109
00:06:43,170 --> 00:06:51,900
And then in line 29 I am actually instantiating this out inflated object so Layla's inflator assignment

110
00:06:51,930 --> 00:06:59,190
operator and here first of all I am actually casting this object to our left inflator on here I'm just

111
00:06:59,250 --> 00:07:07,470
referring to this context argument as you can see here context that gets system service OK.

112
00:07:07,560 --> 00:07:10,590
Context that lay out inflator service OK.

113
00:07:10,740 --> 00:07:12,990
So this is how you actually get the lay out.

114
00:07:12,990 --> 00:07:19,930
Inflator service and you can and then it can actually assigned that value to these inflated object here.

115
00:07:20,250 --> 00:07:27,810
So now because we are implementing this base adapter because we are actually extending this base adapter

116
00:07:27,810 --> 00:07:28,580
class.

117
00:07:28,650 --> 00:07:29,060
OK.

118
00:07:29,160 --> 00:07:32,810
So there is an ease of relationship between these two classes.

119
00:07:32,940 --> 00:07:36,800
So customized list view ease up base adapter.

120
00:07:36,890 --> 00:07:37,730
Okay.

121
00:07:38,130 --> 00:07:44,760
And now we need to actually implement some abstract methods because ideaspace it after class is actually

122
00:07:45,480 --> 00:07:46,770
an abstract class.

123
00:07:47,160 --> 00:07:52,780
And here inside of this customized list view we need to implement some abstract methods.

124
00:07:52,800 --> 00:07:53,300
OK.

125
00:07:53,610 --> 00:08:00,590
So here in order to implement those abstract benefits just right click inside of this class OK.

126
00:08:00,780 --> 00:08:06,700
Right click on it and click on generate and then click on implement Misfit's.

127
00:08:06,810 --> 00:08:07,150
OK.

128
00:08:07,170 --> 00:08:13,500
As you can see here and as you can see here these are the methods that we need to actually implement

129
00:08:14,140 --> 00:08:16,380
inside of the inside of our class.

130
00:08:16,440 --> 00:08:19,120
As you can see it says Android that widget that adapter.

131
00:08:19,350 --> 00:08:22,170
And these are the effects that we need to implement here.

132
00:08:22,170 --> 00:08:22,580
OK.

133
00:08:22,710 --> 00:08:26,720
So just select all of these methods and then click on OK.

134
00:08:27,270 --> 00:08:33,080
So as you can see here it's actually a pace that fits inside of this class.

135
00:08:33,120 --> 00:08:33,670
OK.

136
00:08:33,810 --> 00:08:36,170
The first is it gets out.

137
00:08:36,390 --> 00:08:40,270
The second is a as you can see gets id..

138
00:08:40,420 --> 00:08:42,670
Get MIT and get a view.

139
00:08:42,690 --> 00:08:49,190
OK so now let's actually go inside this guess counterfit and delete this line of code.

140
00:08:49,200 --> 00:08:53,100
And now we can actually put in our own implementations inside of this method.

141
00:08:53,130 --> 00:08:58,370
So this method as you can see here it wants are the count of our objects.

142
00:08:58,410 --> 00:08:58,970
OK.

143
00:08:59,150 --> 00:09:01,260
So we have a free arrays here.

144
00:09:01,320 --> 00:09:05,270
And the size of these free arrays is actually the same.

145
00:09:05,490 --> 00:09:11,550
Ok so now I can actually refer to the name of this animal images of a as you can see here inside of

146
00:09:11,610 --> 00:09:15,280
these counterfit animal images.

147
00:09:15,460 --> 00:09:22,190
That's learn and then I need to put in a semicolon here and here I need to return the right.

148
00:09:22,290 --> 00:09:26,030
Disvalue return animal images that live.

149
00:09:26,250 --> 00:09:28,810
So this would be the count of objects.

150
00:09:28,890 --> 00:09:29,330
OK.

151
00:09:29,380 --> 00:09:35,830
And as you can see here is the second Mefford is good item and the return type of this method is object.

152
00:09:35,850 --> 00:09:36,320
OK.

153
00:09:36,540 --> 00:09:39,600
So we need to actually return a value of type Object.

154
00:09:39,720 --> 00:09:40,220
OK.

155
00:09:40,440 --> 00:09:46,550
And this method actually accepts an argument of an integer and the name of this argument is position.

156
00:09:46,560 --> 00:09:55,180
So just delete this null here and now we know that at least if it wants this specific item in our array.

157
00:09:55,260 --> 00:09:59,500
OK so these are the values that are inside of our arrays as you can see here.

158
00:09:59,520 --> 00:10:02,890
So I could just refer to the name of this animal images array.

159
00:10:03,110 --> 00:10:03,620
OK.

160
00:10:03,780 --> 00:10:05,000
Animal images.

161
00:10:05,210 --> 00:10:05,620
OK.

162
00:10:05,770 --> 00:10:08,250
Sup position.

163
00:10:08,250 --> 00:10:12,400
So here it can actually go inside of our array for example this animal images are a.

164
00:10:12,600 --> 00:10:18,380
And then it's going to return the specific value that is inside of this position here.

165
00:10:18,420 --> 00:10:19,110
As you can see here.

