1
00:00:00,870 --> 00:00:06,510
And this view object as you can see here began by using this view object we can actually differentiate

2
00:00:07,020 --> 00:00:09,270
between these two listeners.

3
00:00:09,270 --> 00:00:16,020
So here I can just typing switch and here I can just referred to the name of this object that as you

4
00:00:16,020 --> 00:00:18,340
can see this is an argument of this Smurfette.

5
00:00:18,360 --> 00:00:18,870
OK.

6
00:00:19,110 --> 00:00:21,180
So again just typing V.

7
00:00:21,890 --> 00:00:25,680
OK that's good idea.

8
00:00:26,250 --> 00:00:26,970
OK.

9
00:00:27,230 --> 00:00:32,090
And now I can actually switch between the IDs of my user interface components.

10
00:00:32,160 --> 00:00:38,000
OK so case are thought Id dot DXi value.

11
00:00:38,220 --> 00:00:39,570
OK colon.

12
00:00:39,780 --> 00:00:42,160
And then I can actually put this code here.

13
00:00:42,290 --> 00:00:45,480
OK I can cut this code and put pasted here.

14
00:00:45,510 --> 00:00:46,070
OK.

15
00:00:46,260 --> 00:00:49,510
And again just putting the previous statement here.

16
00:00:49,820 --> 00:00:50,450
OK.

17
00:00:50,880 --> 00:01:01,990
And I can't just put in another case here case or that Id dot EDT value colon.

18
00:01:02,190 --> 00:01:08,410
And here again just typing TXI the value that says text.

19
00:01:08,520 --> 00:01:09,120
OK.

20
00:01:09,450 --> 00:01:17,410
And here I can just up putting the value of these EDT value OK to these RTX the value object.

21
00:01:17,410 --> 00:01:20,710
OK so I can just type in EDT value.

22
00:01:21,050 --> 00:01:23,690
That's just text.

23
00:01:23,710 --> 00:01:26,780
And now let's actually run our project.

24
00:01:26,970 --> 00:01:29,430
But before that it's actually break here.

25
00:01:29,460 --> 00:01:33,630
Put the break statement and analysis actually on our project and see what happens.

26
00:01:33,680 --> 00:01:34,090
OK.

27
00:01:34,110 --> 00:01:39,450
So as you can see our application is running on this emulator here and now it's actually putting in

28
00:01:39,480 --> 00:01:42,130
some text here for example.

29
00:01:42,370 --> 00:01:43,250
Life.

30
00:01:43,620 --> 00:01:44,290
OK.

31
00:01:44,610 --> 00:01:48,570
And now as you can see I mean these are EDT value object.

32
00:01:48,600 --> 00:01:50,160
A listener to the clicks of the user.

33
00:01:50,160 --> 00:01:55,830
OK so here if I actually click on this Eddie takes here let's see what happens.

34
00:01:56,310 --> 00:01:59,790
And now as you can see the takes of these takes you actually changed.

35
00:01:59,790 --> 00:02:00,170
OK.

36
00:02:00,270 --> 00:02:03,640
And that's because of the execution of this line of yet.

37
00:02:03,660 --> 00:02:04,130
OK.

38
00:02:04,330 --> 00:02:10,730
I specified that when the user actually click on these text object.

39
00:02:10,820 --> 00:02:14,730
This line of thought is going to be executed TXI the value that said text.

40
00:02:14,730 --> 00:02:20,460
So as you can see this is the this is that the value object that set text editing value that get text.

41
00:02:20,490 --> 00:02:25,300
So it's going to actually put this text to these text view object here.

42
00:02:25,350 --> 00:02:25,970
OK.

43
00:02:26,200 --> 00:02:32,010
And let's actually turn this up takes me here and now as you can see the text of this text view the

44
00:02:32,010 --> 00:02:35,200
color of these attacks has actually changed to the red color.

45
00:02:35,280 --> 00:02:36,010
OK.

46
00:02:36,450 --> 00:02:38,030
So hopefully that makes sense.

47
00:02:38,030 --> 00:02:43,560
And and this is how you can actually differentiate between these are Uncle listeners.

48
00:02:43,560 --> 00:02:44,230
OK.

49
00:02:44,520 --> 00:02:48,080
So now let's actually put in some more lines of code here.

50
00:02:48,090 --> 00:02:49,690
Inside of this class.

51
00:02:49,710 --> 00:02:54,700
So now I haven't actually talked about about these autocomplete takes.

52
00:02:54,900 --> 00:02:57,450
And these are multi autocomplete text view.

53
00:02:57,570 --> 00:03:03,430
So as you can see here these two components are actually another kind of text objects.

54
00:03:03,510 --> 00:03:09,300
But before I actually teach you about how we can actually use these two components I need to actually

55
00:03:09,690 --> 00:03:12,300
teach you about the adapters and.

56
00:03:12,350 --> 00:03:12,900
OK.

57
00:03:13,170 --> 00:03:19,140
So adapters are the link between a set of data and the adapter view that displays the data.

58
00:03:19,140 --> 00:03:28,110
OK so what is an adapter view and adapter view actually after views our view groups that display tyed

59
00:03:28,140 --> 00:03:31,200
views given to it by an adapter or shape.

60
00:03:31,260 --> 00:03:37,790
Adapters also provide the child views that display the data in the adapter view.

61
00:03:38,000 --> 00:03:45,780
OK so adapters are actually responsible for supplying the data and then actually creating the views

62
00:03:46,020 --> 00:03:47,620
that are present in each of them.

63
00:03:47,640 --> 00:03:50,600
In this tutorial I want to talk about Aure adapter.

64
00:03:50,700 --> 00:03:57,280
So what is an hourly adapter an hourly adapter adaptor is an adapter backed by an array of objects.

65
00:03:57,420 --> 00:04:00,200
It links the ARII to the adapter view.

66
00:04:00,230 --> 00:04:06,290
OK so the default right arm adapter converts an array item into a string object.

67
00:04:06,300 --> 00:04:11,310
Putting it into a takes you the takes view is then displayed in the adapter view.

68
00:04:11,610 --> 00:04:19,740
OK so when you create the adapter you need to supply the layout for displaying each of the screen.

69
00:04:19,770 --> 00:04:20,130
OK.

70
00:04:20,130 --> 00:04:21,990
Let me actually show you an example.

71
00:04:21,990 --> 00:04:24,240
And then it's going to make sense to you.

72
00:04:24,570 --> 00:04:29,940
So first of all I'm going to actually pasting some lines of code inside of this class and then I'm going

73
00:04:29,940 --> 00:04:32,120
to actually explain to you what's going on here.

74
00:04:32,280 --> 00:04:32,820
OK.

75
00:04:32,820 --> 00:04:37,260
So here inside of this class I can actually paste in some lines of code and then I'm going to explain

76
00:04:37,260 --> 00:04:38,880
to you what's going on here.

77
00:04:38,970 --> 00:04:45,180
So here as you can see I actually created an array of string values and the name of this at a course

78
00:04:45,180 --> 00:04:50,800
names and here as you can see I actually assigned these these values to these of course names locate

79
00:04:51,310 --> 00:04:52,770
an inline 23.

80
00:04:52,920 --> 00:04:56,210
I actually declared an object of type.

81
00:04:56,210 --> 00:05:02,070
I wrote it after and I actually said that these are is going to actually hold string values.

82
00:05:02,440 --> 00:05:03,100
OK.

83
00:05:03,430 --> 00:05:08,870
So now our inside of these are uncreate Smurfette.

84
00:05:08,890 --> 00:05:13,190
I'm going to actually instead initiate these two.

85
00:05:13,420 --> 00:05:15,970
This actually does it at an object.

86
00:05:15,970 --> 00:05:16,460
OK.

87
00:05:16,510 --> 00:05:22,020
So here I can just type in my adapter assignment operator new.

88
00:05:22,530 --> 00:05:23,050
OK.

89
00:05:23,200 --> 00:05:27,700
And then again I need to reverse the name of this Arey it after a class.

90
00:05:27,700 --> 00:05:29,360
Ok I read it after.

91
00:05:29,840 --> 00:05:35,330
And inside the prentices as you can see we can use lots of actually constructors.

92
00:05:35,370 --> 00:05:38,400
OK as you can see a diskless has lots of constructors.

93
00:05:38,420 --> 00:05:45,970
So now let's actually go to the web browser in the Android documentation and then I'm going to explain

94
00:05:45,970 --> 00:05:48,300
to you what is actually an array adapter.

95
00:05:48,400 --> 00:05:48,980
OK.

96
00:05:49,270 --> 00:05:56,250
So let's actually open your browser and as you can see here we've got this great adapter here.

97
00:05:56,290 --> 00:06:03,940
And as you can see here it says our concrete base adapter that is backed by an array of arbitrary objects.

98
00:06:03,970 --> 00:06:04,250
OK.

99
00:06:04,270 --> 00:06:10,760
By default this class expects that it provided the resource ID reference as a single text view.

100
00:06:10,890 --> 00:06:11,430
OK.

101
00:06:11,740 --> 00:06:14,940
And here you can see some descriptions about this class.

102
00:06:14,950 --> 00:06:15,410
OK.

103
00:06:15,440 --> 00:06:21,390
And here as you can see we have this jobs that like object and the subclass of this class is for example.

104
00:06:21,400 --> 00:06:27,130
And with that widget that base it after Aunty's it that it actually inherits all of the features and

105
00:06:27,130 --> 00:06:29,160
behaviors that are inside of the space adapter.

106
00:06:29,170 --> 00:06:29,780
OK.

107
00:06:30,100 --> 00:06:35,710
And this class actually extends space adapter and implements of filter filter about our interface and

108
00:06:35,710 --> 00:06:37,270
these feed spinner adapter.

109
00:06:37,270 --> 00:06:37,950
OK.

110
00:06:37,990 --> 00:06:40,260
So here you can see some summary about this class.

111
00:06:40,300 --> 00:06:43,060
And these are the public constructors as you can see.

112
00:06:43,090 --> 00:06:48,290
You need to actually open your browser and enter this you are well and then you are going to be guided

113
00:06:48,340 --> 00:06:49,540
guided to this space here.

114
00:06:49,540 --> 00:06:50,090
OK.

115
00:06:50,200 --> 00:06:53,550
So we have lots of constructors here.

116
00:06:53,700 --> 00:06:54,070
OK.

117
00:06:54,160 --> 00:06:56,390
But we need to actually use this constructor here first.

118
00:06:56,470 --> 00:06:58,090
We need to specify the context.

119
00:06:58,240 --> 00:06:58,800
OK.

120
00:06:59,140 --> 00:07:07,510
And so the context is the class the current class ok and the resource is actually the view that we want

121
00:07:07,510 --> 00:07:14,260
to actually put these objects as you can see these objects are the first argument we want to actually

122
00:07:14,260 --> 00:07:16,520
put these objects through the view on the screen.

123
00:07:16,780 --> 00:07:21,910
So now let's actually go back to the Android studio and then I'm going to explain to you what's going

124
00:07:21,910 --> 00:07:22,590
on here.

125
00:07:22,780 --> 00:07:25,900
So here first of all I need to actually specify the context.

126
00:07:25,900 --> 00:07:28,210
So main activity does this.

127
00:07:28,480 --> 00:07:33,790
So now I just need to put in a comma here and then I need to actually the first one resource.

128
00:07:33,790 --> 00:07:39,950
So here I can just type in Android that are dot layouts.

129
00:07:40,450 --> 00:07:41,860
OK that's.

130
00:07:42,280 --> 00:07:46,530
And here we can actually select one of these simple items here.

131
00:07:46,630 --> 00:07:51,220
So I just select this simple list underline IDM underlined one here.

132
00:07:51,370 --> 00:07:51,810
OK.

133
00:07:52,000 --> 00:07:57,550
So this is going to be our view for putting are actually storing objects that we actually assigned to

134
00:07:57,550 --> 00:07:58,200
these arey.

135
00:07:58,270 --> 00:07:58,710
OK.

136
00:07:58,810 --> 00:08:02,120
So here again just typing course names.

137
00:08:02,140 --> 00:08:02,700
OK.

138
00:08:02,950 --> 00:08:05,770
And then I need to put in a semicolon at the end of my statement here.

139
00:08:06,040 --> 00:08:09,810
So here as you can see I created my ADD my editor here.

140
00:08:09,920 --> 00:08:12,890
And so what's the job of this.

141
00:08:13,080 --> 00:08:19,480
What's the job of these autocomplete takes to do this autocomplete takes who is actually like the Eadie

142
00:08:19,480 --> 00:08:20,570
takes object.

143
00:08:20,580 --> 00:08:21,190
OK.

144
00:08:21,470 --> 00:08:28,170
And is it is like other textfield there is a difference between this edit text and these edits.

145
00:08:28,250 --> 00:08:31,560
This autocomplete text you actually gives us some hints.

146
00:08:31,810 --> 00:08:32,360
OK.

147
00:08:32,650 --> 00:08:37,920
And we can actually provide those hints by actually creating an array.

148
00:08:37,930 --> 00:08:40,890
So these are values that they actually assigned to this.

149
00:08:40,890 --> 00:08:47,140
Are they all going to be the things that we are at this autocomplete takes view is going to actually

150
00:08:47,470 --> 00:08:48,400
give the user.

151
00:08:48,610 --> 00:08:49,260
OK.

152
00:08:49,510 --> 00:08:53,530
So that's why we need what we needed to actually create an array adapter object.

153
00:08:53,530 --> 00:08:54,560
OK.

154
00:08:54,700 --> 00:08:58,660
And Dan are here as you can see inside of these uncreate Meffert.

155
00:08:58,680 --> 00:09:05,230
I actually initialize this object by putting my adapter object assignment operator new Aure adapter.

156
00:09:05,380 --> 00:09:06,020
OK.

157
00:09:06,280 --> 00:09:09,280
And here I specify the context.

158
00:09:09,520 --> 00:09:12,250
And then here I actually refers to this simple list.

159
00:09:12,250 --> 00:09:15,730
I don't want this is going to be the view that we want to actually put in.

160
00:09:15,830 --> 00:09:17,210
This of course names with this view.

161
00:09:17,230 --> 00:09:17,680
OK.

162
00:09:17,770 --> 00:09:23,090
And then I need to actually bind this autocomplete with this adapter object.

163
00:09:23,110 --> 00:09:30,070
So here I can just typing autocomplete takes a view that sets adapter and then I need to revert to the

164
00:09:30,070 --> 00:09:32,160
name of this object my adapter.

165
00:09:32,440 --> 00:09:35,350
So now let's actually run unprotect and see what happens.

166
00:09:35,350 --> 00:09:39,950
So as you can see here our application is running on this emulator here.

167
00:09:40,000 --> 00:09:42,670
Now if I actually click on this autocomplete text view.

168
00:09:42,710 --> 00:09:48,850
So here if I want to actually type in Android and as as you can see here it going to give me this hint.

169
00:09:48,910 --> 00:09:54,070
So this view as you can see here this view that this android develop develop of course takes is actually

170
00:09:54,840 --> 00:09:55,700
inside it.

171
00:09:55,720 --> 00:09:59,600
This view is these are simple list items as you can see here.

172
00:09:59,740 --> 00:10:00,100
OK.

173
00:10:00,180 --> 00:10:03,640
So that's why we needed to actually put this list item here.

174
00:10:03,780 --> 00:10:04,450
OK.

175
00:10:04,710 --> 00:10:09,540
And through that art that lay out OK that simple list item one.

176
00:10:09,690 --> 00:10:10,440
OK.

177
00:10:10,860 --> 00:10:14,110
And as you can see here I could actually put in this text here.

178
00:10:14,340 --> 00:10:14,820
OK.

179
00:10:14,910 --> 00:10:18,410
Or I could actually put in other values for example Java.

180
00:10:18,930 --> 00:10:21,510
And as you can see here it's going to give me this hint here.

181
00:10:21,510 --> 00:10:22,870
Java developer of course.

182
00:10:23,190 --> 00:10:25,260
Or I could just they pin all us.

183
00:10:25,560 --> 00:10:28,440
And as you can see here it says our U.S. developer course.

184
00:10:28,590 --> 00:10:29,120
OK.

185
00:10:29,520 --> 00:10:36,140
So now it's not going to actually give me for example multi multiple Hinz.

186
00:10:36,140 --> 00:10:36,620
OK.

187
00:10:36,810 --> 00:10:40,270
For example multiple hints that are actually separated by cut by comma.

188
00:10:40,320 --> 00:10:44,490
So that's the job of these multi autocomplete takes to you as you can see here.

189
00:10:44,490 --> 00:10:49,410
So now let's actually go inside this main activity that double file here in order to see how we can

190
00:10:49,410 --> 00:10:53,210
actually use this multi autocomplete text view Arjay.

191
00:10:53,580 --> 00:10:59,520
And now as you can see here we already instantiated this my adapter object.

192
00:10:59,520 --> 00:11:00,130
OK.

193
00:11:00,450 --> 00:11:07,850
And here again just typing multi auto completists view that sits adapter.

194
00:11:08,420 --> 00:11:16,680
OK my adapter and for multi autocomplete text we want to actually call another method on this object

195
00:11:16,680 --> 00:11:17,210
here.

196
00:11:17,220 --> 00:11:22,300
So here I can just type in multi alter autocomplete takes few dot sets.

197
00:11:22,500 --> 00:11:24,130
Tokenizer OK.

198
00:11:24,330 --> 00:11:29,250
And as you can see here it is tokenize it actually accepts an argument of type tokenizer.

199
00:11:29,250 --> 00:11:37,340
So here I can just type in new multi autocomplete text view dot com on tokenizer.

200
00:11:37,380 --> 00:11:43,350
So as you can see here this set tokenized and if it is going to actually put these commas after each

201
00:11:43,440 --> 00:11:47,250
value that we've actually putting in inside this multi autocomplete takes three.

202
00:11:47,250 --> 00:11:47,740
OK.

203
00:11:47,820 --> 00:11:52,360
So a tokenizer new multi autocomplete takes few dot com or tokenizer.

204
00:11:52,530 --> 00:11:56,030
OK so it's going to separate these values by comma.

205
00:11:56,130 --> 00:11:56,800
OK.

206
00:11:57,090 --> 00:12:00,240
So let's actually run our project again and see what happens.

207
00:12:00,240 --> 00:12:04,890
So as you can see here our application is actually running on this emulator here.

208
00:12:05,130 --> 00:12:10,400
And if we actually select these multi autocomplete text view it's actually just typing in Android.

209
00:12:10,530 --> 00:12:13,090
And as you can see here it's going to give me this hint here.

210
00:12:13,260 --> 00:12:20,260
And as you can see it put this come here and then I can actually putting us on here as you can see it

211
00:12:20,280 --> 00:12:22,360
is actually giving me another hint.

212
00:12:22,650 --> 00:12:25,910
OK so that's the job of these multi autocomplete takes you.

213
00:12:26,220 --> 00:12:31,430
Or just another putting another value for example Java developer of course.

214
00:12:31,530 --> 00:12:32,380
OK.

215
00:12:32,940 --> 00:12:37,360
So hopefully that makes sense and I think that's enough for this story.

216
00:12:37,380 --> 00:12:43,350
And if you have any questions about these concepts that they actually talk to you in this tutorial please

217
00:12:43,350 --> 00:12:47,700
post the discussion in the course and then I'll do my best to answer all of your questions.

218
00:12:47,700 --> 00:12:50,800
Thank you very much for watching and I'll see you in the next year Tauriel.

