1
00:00:00,640 --> 00:00:01,450
Welcome back.

2
00:00:01,720 --> 00:00:08,320
Now that you know how to create a board, it's time to also display the board and in order to do that,

3
00:00:08,320 --> 00:00:13,410
we will need to create a recital of you for here.

4
00:00:13,450 --> 00:00:18,730
As you can see, we have this whole world text currently as the only content of this page, but we want

5
00:00:18,730 --> 00:00:19,300
to changed it.

6
00:00:19,570 --> 00:00:22,420
So we will need to create a recital of you.

7
00:00:22,420 --> 00:00:27,730
And therefore, we, of course, need to create an adapter and we will need to create an individual

8
00:00:27,730 --> 00:00:35,440
row inside of that recital of you, as well as the overall page that can see your overall activity XML

9
00:00:35,440 --> 00:00:35,840
file.

10
00:00:36,370 --> 00:00:36,730
All right.

11
00:00:36,730 --> 00:00:38,760
So let's go ahead and start with that.

12
00:00:39,160 --> 00:00:44,680
Therefore, what I'm going to start with is with the content main or in my case, I think I called the

13
00:00:44,680 --> 00:00:45,670
main content.

14
00:00:47,350 --> 00:00:53,290
So here in I lay out I called the main content, even though it should have been content on the screen,

15
00:00:54,100 --> 00:00:56,050
but let's go ahead and start with that.

16
00:00:57,910 --> 00:01:03,550
So first of all, what I will start with is that I want to use a linear layout here.

17
00:01:05,600 --> 00:01:11,450
Then let's add a background so here background.

18
00:01:12,890 --> 00:01:22,490
Should be there in the background as well as the gravity should be a center and the orientation should

19
00:01:22,490 --> 00:01:23,180
be vertical.

20
00:01:25,070 --> 00:01:32,660
And then I will add some padding, and for that I will use 16 DPI, even though, of course, we could

21
00:01:32,660 --> 00:01:34,210
go to the dimensions.

22
00:01:34,220 --> 00:01:41,570
So here in the Values Dimond's, if you want to stay consistent, let's just create some more dimensions

23
00:01:41,570 --> 00:01:41,900
in here.

24
00:01:41,900 --> 00:01:43,340
And I'm going to do that real quick.

25
00:01:45,170 --> 00:01:51,290
So these are the new dimensions that I want to use, so main screen content padding, no boards available,

26
00:01:51,290 --> 00:01:57,440
text size, item, board content, margin, bottom item, board content, padding, image size image,

27
00:01:57,440 --> 00:01:59,780
circular border with and so forth.

28
00:01:59,930 --> 00:02:00,290
All right.

29
00:02:00,300 --> 00:02:02,360
So a bunch of new dimensions.

30
00:02:02,360 --> 00:02:05,660
You can, of course, download the dimensions file from this chapter.

31
00:02:05,780 --> 00:02:10,699
And these are going to be the dimensions that they're going to use in our main content, but also in

32
00:02:10,699 --> 00:02:16,040
another XML file, which will be our individual role inside of our recycler of you.

33
00:02:17,920 --> 00:02:25,330
Then I will do something that I think we haven't used before, and that is to lay out behavior, so

34
00:02:25,330 --> 00:02:27,290
lay out on the score behavior.

35
00:02:29,080 --> 00:02:31,300
This one here and there.

36
00:02:31,420 --> 00:02:35,220
I want to use the APA scrolling of you behavior.

37
00:02:35,860 --> 00:02:36,190
All right.

38
00:02:36,220 --> 00:02:38,320
So this already exists and.

39
00:02:39,320 --> 00:02:41,150
If you look at it, it's here.

40
00:02:42,300 --> 00:02:47,820
Inside of the values example, and these are not necessarily strengths that we have created, but it's

41
00:02:48,120 --> 00:02:56,240
the ones that are directly available by Android or made available by Android and the layout behavior,

42
00:02:56,250 --> 00:03:02,370
what it does is the class name of a behavior class defining special runtime behavior for this child,

43
00:03:02,370 --> 00:03:02,670
for you.

44
00:03:03,210 --> 00:03:10,370
So what we will do is we will make the bar where we will use the app, our scrolling view behavior.

45
00:03:10,830 --> 00:03:16,890
So the idea is, do you want to leave the app open or do you want to get rid of it when you want to

46
00:03:16,890 --> 00:03:17,350
scroll?

47
00:03:17,370 --> 00:03:21,270
So these are these are the things that you can change in the layout behavior.

48
00:03:22,840 --> 00:03:31,780
All right, and then what I want to have is a layout that allows me to put something inside of it and

49
00:03:31,780 --> 00:03:32,740
that it looks good.

50
00:03:32,750 --> 00:03:34,770
So I'm just going to use a cart view.

51
00:03:35,200 --> 00:03:35,640
All right.

52
00:03:35,650 --> 00:03:40,300
So, of course, I could use multiple different things to fit that description.

53
00:03:40,300 --> 00:03:45,790
But basically, I'm just going to use a cart for you here, which matches the parent in both directions.

54
00:03:45,790 --> 00:03:47,920
And I want to have a white background.

55
00:03:47,920 --> 00:03:55,300
So I'm just going to use add color or actually Android's color.

56
00:03:57,040 --> 00:04:04,360
White, all right, then, a little bit of elevation for our car to you so that it creates a little

57
00:04:04,360 --> 00:04:09,940
shadow and here I'm going to use elevation.

58
00:04:09,940 --> 00:04:12,640
So here, Carthew elevation.

59
00:04:14,700 --> 00:04:22,320
As well as a little radius for the corner, so that it's rounded, so that we get a rounded radius,

60
00:04:22,320 --> 00:04:27,700
so card corner radius and here cards view corner radius.

61
00:04:27,720 --> 00:04:28,320
This one here.

62
00:04:30,310 --> 00:04:35,530
OK, so inside of this card for you, I want to have a recital of you.

63
00:04:36,120 --> 00:04:36,490
All right.

64
00:04:36,520 --> 00:04:39,280
So this is where our review view comes into play.

65
00:04:39,430 --> 00:04:40,930
Recycler of you.

66
00:04:42,350 --> 00:04:53,330
And it was not this one free sky color view, this one here with a whiff of match parent and a height

67
00:04:53,330 --> 00:04:54,140
of match parent.

68
00:04:54,620 --> 00:04:57,860
Now, this one is going to get an ID so that it can communicate with it.

69
00:04:58,220 --> 00:05:02,780
And I will use the RV underscore bords list here.

70
00:05:04,400 --> 00:05:09,080
So this will be the name of standing for all of you and will be the board's list.

71
00:05:09,710 --> 00:05:14,960
And then finally, I'm going to set the visibility to go on for now.

72
00:05:15,780 --> 00:05:18,170
OK, so it should be invisible for the beginning.

73
00:05:19,430 --> 00:05:21,560
And underneath that, I would like to have a text to you.

74
00:05:21,560 --> 00:05:25,190
So I'm just going to use the text that we had before, what we just said, Hello World.

75
00:05:25,670 --> 00:05:30,230
And I'm going to use that so you can see we have those two inside of our cart view.

76
00:05:30,410 --> 00:05:35,420
And at the beginning, we just want to display a text view which says no cards available.

77
00:05:35,420 --> 00:05:37,220
Please create one or something like that.

78
00:05:37,580 --> 00:05:38,180
And.

79
00:05:39,590 --> 00:05:42,050
I'm going to call this one on TV, No.

80
00:05:43,880 --> 00:05:51,740
It's available so that it's a little more descriptive, it should match to parents.

81
00:05:52,870 --> 00:05:54,160
In both directions.

82
00:05:57,120 --> 00:06:02,910
And the text should be something like no bars available, so let's go ahead to districts and create

83
00:06:02,910 --> 00:06:04,160
a new string here as well.

84
00:06:06,170 --> 00:06:07,760
So string's.

85
00:06:12,720 --> 00:06:18,450
So it's just going to be the string here, no boards are available and the text will just be no boards

86
00:06:18,450 --> 00:06:19,110
are available.

87
00:06:19,890 --> 00:06:22,230
Exclamation mark, exclamation mark, exclamation mark.

88
00:06:22,560 --> 00:06:24,960
So now we can use that instead here.

89
00:06:25,350 --> 00:06:26,970
So heartstring.

90
00:06:28,270 --> 00:06:32,580
Or actually, Eliseo's no boards are available, that's easier this way.

91
00:06:33,520 --> 00:06:38,680
We don't need to use all of this constraint layout stuff because we are using a linear layout.

92
00:06:38,950 --> 00:06:40,090
So let's get rid of that.

93
00:06:42,690 --> 00:06:50,700
The tax should be centered, so adjust the gravity to center so that it's beautifully centered, their

94
00:06:51,330 --> 00:06:52,240
tax color.

95
00:06:53,100 --> 00:07:02,010
Well, let's use the secondary tax color that we have prepared and then the text size should be text

96
00:07:02,010 --> 00:07:03,420
size for.

97
00:07:04,480 --> 00:07:05,290
What is it?

98
00:07:05,560 --> 00:07:07,660
Oh, boards are available, text us.

99
00:07:07,690 --> 00:07:08,320
This one here.

100
00:07:11,400 --> 00:07:15,360
All right, so these are the dimensions, the main content, the strings.

101
00:07:15,410 --> 00:07:21,510
Now let's add one color here that I want to have, and that is going to be my divided color.

102
00:07:21,510 --> 00:07:26,250
So I will create a little divider and I will use this color here.

103
00:07:26,250 --> 00:07:31,250
So EAA and I don't mean the video game company here.

104
00:07:31,260 --> 00:07:33,670
Of course, it's just this color that we are using here.

105
00:07:34,290 --> 00:07:34,770
All right.

106
00:07:35,340 --> 00:07:35,790
So.

107
00:07:37,090 --> 00:07:43,450
Let's design every individual board that we want to display, so it's just going to be a list view,

108
00:07:43,450 --> 00:07:46,160
elements of list view item that we want to design.

109
00:07:46,480 --> 00:07:54,070
So let's go ahead and create a new XML file for our layout, new layout.

110
00:07:54,580 --> 00:07:56,920
And I'm going to call this one item bought.

111
00:08:01,040 --> 00:08:08,960
And how I wanted to look like is on the left side, I want like to have an image and then a title and

112
00:08:08,960 --> 00:08:12,020
then also underneath it, who created this board?

113
00:08:12,440 --> 00:08:12,800
All right.

114
00:08:12,800 --> 00:08:15,860
So that's basically it not too complicated.

115
00:08:16,030 --> 00:08:18,140
Of course, you can adjust it to your liking.

116
00:08:18,140 --> 00:08:22,220
You could add to created the date and so forth.

117
00:08:22,230 --> 00:08:23,880
So a lot of information that you can get.

118
00:08:24,460 --> 00:08:28,340
OK, so instead of a constraint out, I'm going to use a linear layout here again.

119
00:08:29,690 --> 00:08:40,490
The width should be much apparent, but the height should be only Øvrebø content, so only the content

120
00:08:40,490 --> 00:08:43,880
height, then the background.

121
00:08:45,740 --> 00:08:56,870
Should be attributes, selectable item background, as you can see, so there is one by default.

122
00:08:57,260 --> 00:09:00,470
This one here, selectable item background.

123
00:09:01,710 --> 00:09:08,430
Which is a style that may be applied to buttons or other selectable items that should react to pressed

124
00:09:08,850 --> 00:09:10,410
focus states and so forth.

125
00:09:11,200 --> 00:09:13,260
OK, so this is the one that I want to use.

126
00:09:16,280 --> 00:09:25,310
Then the orientation will be vertical as well as I want to have a little margin towards the bottom for

127
00:09:25,310 --> 00:09:28,680
this whole thing of margin.

128
00:09:30,020 --> 00:09:31,820
And this one is called.

129
00:09:33,630 --> 00:09:37,470
Item board content, margin bottom, this one here.

130
00:09:39,210 --> 00:09:43,600
All right, so this is the linear layout inside of that linear layout.

131
00:09:43,620 --> 00:09:50,160
I want to have another linear layout which puts things next to each other and then one where things

132
00:09:50,160 --> 00:09:51,900
are put on top of each other.

133
00:09:52,100 --> 00:09:55,080
OK, so we have multiple linear layouts here.

134
00:09:55,440 --> 00:09:59,710
So let's create another one, which will be very similar.

135
00:09:59,730 --> 00:10:02,490
So let's go ahead and.

136
00:10:03,980 --> 00:10:08,250
Close this linear layout, so this is the linear thought that I want to use.

137
00:10:08,650 --> 00:10:13,810
Apparent Web content orientation horizontal so that elements are next to each other and the padding

138
00:10:13,830 --> 00:10:15,630
should be item board content padding.

139
00:10:15,960 --> 00:10:19,260
And then I want to use the circle image of you.

140
00:10:20,350 --> 00:10:28,800
So this one here, I'm going to call this one, I've bought image and the width should be Eitam board

141
00:10:28,810 --> 00:10:32,230
image size, which is 60 density pixels.

142
00:10:34,050 --> 00:10:40,650
As well as the heart and soul in both directions, 60 density pistils, then we have a content description.

143
00:10:40,660 --> 00:10:45,960
We have a source which is our ABC board placeholder in case we don't have an image for it.

144
00:10:45,960 --> 00:10:46,270
Right.

145
00:10:46,770 --> 00:10:53,310
And then I would like to use the safe border color of color, primary text color.

146
00:10:53,580 --> 00:10:57,480
And in order to do so, I need to create the namespace for app.

147
00:10:58,530 --> 00:11:00,720
OK, so it's editor at the top.

148
00:11:01,110 --> 00:11:02,250
A new namespace.

149
00:11:06,480 --> 00:11:13,050
So this will put the image here, as you can see, and now I would like to have a text and then another

150
00:11:13,050 --> 00:11:14,030
text underneath it.

151
00:11:14,340 --> 00:11:16,620
So the top text should be our title.

152
00:11:17,790 --> 00:11:25,030
So what we will need is another a linear layout so that things can be top put on top of each other.

153
00:11:25,380 --> 00:11:28,780
So this time the orientation will be vertical.

154
00:11:29,190 --> 00:11:35,860
So here orientation vertical margin start will be item, board name, layout margin in my case.

155
00:11:35,880 --> 00:11:37,890
So this is the dimension that I created.

156
00:11:38,340 --> 00:11:41,700
But internally it's just going to be 10 density pixels.

157
00:11:42,900 --> 00:11:47,660
Then this linear layout has to of course, be close at one point.

158
00:11:47,670 --> 00:11:50,770
And here we can now create our two textures.

159
00:11:51,240 --> 00:11:53,450
OK, so I'm just going to paste him in here.

160
00:11:55,390 --> 00:11:57,790
So that we have them director here.

161
00:11:59,360 --> 00:12:00,250
So you.

162
00:12:00,350 --> 00:12:07,970
No one will be TV name match, parent web content, as usual, we take the whole with, but only the

163
00:12:07,970 --> 00:12:09,050
height that is necessary.

164
00:12:11,480 --> 00:12:18,710
Then we set the text color as the primary text color, textiles as important in textiles, then in tools.

165
00:12:18,950 --> 00:12:21,230
I'm going to add this namespace as well and tools.

166
00:12:21,230 --> 00:12:25,730
I want to call this one board name, as you can see now in tools is called board name.

167
00:12:26,000 --> 00:12:32,150
And underneath I had this created by and that will then later on, of course, be replaced by created

168
00:12:32,150 --> 00:12:33,440
by the user name.

169
00:12:33,450 --> 00:12:38,660
So it's going to add the user name here to the text itself because he we're just using the tools text

170
00:12:38,660 --> 00:12:43,610
so that we see something in the design, but we're not actually setting the text specifically.

171
00:12:44,690 --> 00:12:45,140
All right.

172
00:12:45,170 --> 00:12:50,060
Now let's go ahead and create the adapter so we will need to create a new class.

173
00:12:51,510 --> 00:12:52,970
So let's go ahead.

174
00:12:54,040 --> 00:13:01,210
And I'm going to put that into a new directory, so let's go ahead and create a new path here, new

175
00:13:01,960 --> 00:13:06,100
package, and I'm going to call this one add up Turse.

176
00:13:07,740 --> 00:13:10,140
And here, let's go ahead and create a new.

177
00:13:11,070 --> 00:13:18,640
Glascott then file, and I'm going to call this one Bought Items Adapter.

178
00:13:20,240 --> 00:13:25,170
OK, so each time we work with recyclable use, we of course need to have an adapter and I'm going to

179
00:13:25,170 --> 00:13:28,290
make this one open so that I can inherit from it.

180
00:13:28,890 --> 00:13:29,700
And here.

181
00:13:32,260 --> 00:13:34,090
I will directly add a constructor.

182
00:13:34,540 --> 00:13:35,350
All right, so.

183
00:13:36,500 --> 00:13:43,970
I'm going to say that I want to have the context and.

184
00:13:45,190 --> 00:13:53,470
The list that I need to display, which will be an array list of Borz.

185
00:13:55,090 --> 00:13:59,320
OK, so nothing new, we have used this approach multiple times already.

186
00:13:59,770 --> 00:14:03,370
Of course, we need to import context as well as Boort.

187
00:14:07,540 --> 00:14:16,990
And then we can add the recital of you text here, so we need to have a recital of you or we need to

188
00:14:17,170 --> 00:14:21,980
inherit from recital of you thought adapter.

189
00:14:23,290 --> 00:14:26,220
And here we will create a new view, hold a class.

190
00:14:26,230 --> 00:14:29,950
So I'm just going to say recycler view dot.

191
00:14:29,950 --> 00:14:31,240
View holder.

192
00:14:33,510 --> 00:14:34,050
All right.

193
00:14:38,610 --> 00:14:44,910
So that's important sector of you, and now let's create our own view Holder and here implement the

194
00:14:44,910 --> 00:14:48,780
members that are necessary, so let's implement all of them, select all.

195
00:14:49,350 --> 00:14:52,380
And it created the ones that we need in here.

196
00:14:54,170 --> 00:14:58,430
And, of course, let's go ahead and create this private class.

197
00:14:59,090 --> 00:15:03,710
My view holder here where we pass in The View.

198
00:15:06,130 --> 00:15:06,760
And.

199
00:15:08,180 --> 00:15:09,500
It's a result of you.

200
00:15:10,780 --> 00:15:11,980
Todd, you hold the.

201
00:15:15,870 --> 00:15:17,010
Where we pass in The View.

202
00:15:19,590 --> 00:15:25,620
So if this is a little too quick for you, check out the demo on recycled views, OK, because we're

203
00:15:25,620 --> 00:15:27,800
not doing anything fancy or new here.

204
00:15:27,810 --> 00:15:30,210
It's the same that we have used before.

205
00:15:30,330 --> 00:15:31,470
The same code, pretty much.

206
00:15:33,110 --> 00:15:35,700
So let's start with uncreate view, Holder.

207
00:15:35,720 --> 00:15:36,980
What do we want to do in here?

208
00:15:37,520 --> 00:15:45,290
Well, we will return my view, Holder, which we then can pass on the view that we want to display,

209
00:15:45,560 --> 00:15:53,870
while the view that we want to display is coming from lay out inflator from context inflate.

210
00:15:55,010 --> 00:16:00,800
And then we used to lay out that we want to inflate and to lay out to be prepared just for this was

211
00:16:00,800 --> 00:16:03,530
called item on the scoreboard.

212
00:16:05,430 --> 00:16:12,690
And we need to pass on the parents as well as the stipend for attached to root.

213
00:16:12,870 --> 00:16:14,580
OK, now let's import our.

214
00:16:16,890 --> 00:16:22,770
OK, and that seemed to work, that's fine, so let's go ahead and put it in a different.

215
00:16:24,260 --> 00:16:28,760
Line here, so it's a little more readable, so we return our viewer holder here.

216
00:16:30,470 --> 00:16:40,940
With the parents and those settings, as you can see, then let's go to our own Pind view Holder here.

217
00:16:41,430 --> 00:16:47,330
What we want to do is we want to, first of all, use the model, which will be our list.

218
00:16:47,640 --> 00:16:51,040
OK, so list at the position.

219
00:16:51,770 --> 00:16:52,220
So.

220
00:16:53,500 --> 00:17:02,550
Our class bought items adapter gets a list of Bortz, so a single board should be our model.

221
00:17:03,190 --> 00:17:07,750
So we're using this model here in order to then check.

222
00:17:08,079 --> 00:17:17,829
If the holder is my view holder, then we can use Glide in order to display an image.

223
00:17:18,490 --> 00:17:24,040
And the image that we want to display is, of course, the image of the board that we have used.

224
00:17:24,890 --> 00:17:31,180
So I'm just going to use with context and context is the variable that is given to our adapter, which

225
00:17:31,180 --> 00:17:34,830
will be the class in which this recycler will be displayed.

226
00:17:34,840 --> 00:17:39,400
Of course, in our case, it's the main activity, then it's going to be model image.

227
00:17:39,400 --> 00:17:45,310
And by the way, model, of course, will be our last position, which means it will be the board itself.

228
00:17:45,310 --> 00:17:52,060
So it's going to be Dysport and it's going to give us this image, OK, because that's what we are passing

229
00:17:52,060 --> 00:17:54,500
to this class, to the sport items adapter.

230
00:17:54,970 --> 00:17:55,330
All right.

231
00:17:55,330 --> 00:17:57,940
So we get the image of the board.

232
00:17:58,150 --> 00:18:00,310
We sent across it as a placeholder.

233
00:18:00,310 --> 00:18:05,680
We use ICEE board placeholder and then we put that into the holder item view.

234
00:18:05,920 --> 00:18:13,800
I've bought image and I've bought images inside of item on the school board XML, this SERPELL image

235
00:18:13,810 --> 00:18:18,740
view that we have prepared just a couple of minutes ago, and I called it I've bought image.

236
00:18:20,680 --> 00:18:26,350
Now, if we look at this item board, we of course also need to set the board name and created by.

237
00:18:26,380 --> 00:18:30,690
All right, so let's just do that inside of this unbind view holder.

238
00:18:31,180 --> 00:18:32,770
So now we have the image.

239
00:18:33,190 --> 00:18:35,190
Now it's time to set the item.

240
00:18:35,200 --> 00:18:35,410
You.

241
00:18:36,370 --> 00:18:46,690
Take TV name, text, so here, hold her thought item, view, dot TV on the screen name, that text

242
00:18:46,900 --> 00:18:56,590
will be model dot name and then we have holder dot item, view, dot TV underscore created by text.

243
00:18:56,710 --> 00:19:01,990
Should be for now created by.

244
00:19:06,480 --> 00:19:13,980
And then we get that info from the model, so model DOT created.

245
00:19:15,130 --> 00:19:15,520
By.

246
00:19:17,730 --> 00:19:18,230
OK.

247
00:19:20,220 --> 00:19:26,790
Now, of course, every single holder should have an unclick listener, so every single one of those

248
00:19:27,330 --> 00:19:32,640
boards should be clickable because then you get into the board and you see the board details with all

249
00:19:32,640 --> 00:19:35,830
of those cards and all of those list items that you have there.

250
00:19:35,850 --> 00:19:39,000
So all of the tasks that have to be finished.

251
00:19:39,480 --> 00:19:39,870
All right.

252
00:19:39,880 --> 00:19:47,400
So what we'll do is we'll say holder dot item view that set on Click Listener.

253
00:19:47,700 --> 00:19:49,480
So we add an unclick listener.

254
00:19:50,520 --> 00:19:50,990
All right.

255
00:19:51,000 --> 00:19:55,950
So then what I want to prepare as well is an anklet listener.

256
00:19:55,960 --> 00:20:02,910
So I'm going to create my own interface here, which will be an on click listener, which will then

257
00:20:02,910 --> 00:20:11,160
have a function on Click with a position where it was clicked, which will be an integer and the model

258
00:20:12,000 --> 00:20:13,130
that it was pretty much clicked.

259
00:20:13,140 --> 00:20:20,190
So when we click onto one of those list elements, it's always at a specific position and there is a

260
00:20:20,190 --> 00:20:21,270
board in the background.

261
00:20:21,270 --> 00:20:21,540
Right.

262
00:20:21,900 --> 00:20:25,020
So I want to use this on Click Listener here.

263
00:20:25,560 --> 00:20:31,350
But the thing is, we, of course, need to create an object or an instance of that one click listener.

264
00:20:31,350 --> 00:20:35,340
And I'm just going to create it up here at the beginning of the class.

265
00:20:37,320 --> 00:20:45,090
So for now, I'm just going to say private var on click Listen, there should be an on click listener

266
00:20:45,090 --> 00:20:47,520
nullable, which I'm going to assign null to.

267
00:20:48,330 --> 00:20:56,160
And then later on and to be specific, when we assign an omelet listener to our holder item, which

268
00:20:56,160 --> 00:21:02,770
means to our list item, at that point I want to assign an unclick event.

269
00:21:03,210 --> 00:21:17,270
So here if the on click listener has not now then the unclick listener on Click with the position and

270
00:21:17,580 --> 00:21:20,460
model because we get both right.

271
00:21:20,490 --> 00:21:21,270
So in this.

272
00:21:22,320 --> 00:21:28,200
Unbind view holder, that's where we get it, right, where we get the holder, we get the position,

273
00:21:28,560 --> 00:21:35,400
and then based on the position, we can find out the model and we can then pass both to the UNCLICK

274
00:21:35,400 --> 00:21:40,680
event, which is, of course, this unclick that will then be executed.

275
00:21:42,630 --> 00:21:44,430
Now, let's do the get item count.

276
00:21:44,430 --> 00:21:49,230
I think that's the easiest one where we just return the amount of items.

277
00:21:49,620 --> 00:21:53,540
So here, return list that size.

278
00:21:54,000 --> 00:21:58,790
And by the way, the list is the one that we get past when we create this adapter.

279
00:21:59,130 --> 00:22:05,790
So depending on how many list items we have in our database, that's the amount of items that we want

280
00:22:05,790 --> 00:22:07,080
to have and get item count.

281
00:22:08,640 --> 00:22:09,310
All right.

282
00:22:09,330 --> 00:22:16,080
And at this point, we have prepared our bought items and your item adapter, of course, we still need

283
00:22:16,080 --> 00:22:21,440
to add a recycler view, but that's what we will do in the main activity and in the next video.

284
00:22:21,450 --> 00:22:27,170
So unfortunately, this is not the point where we can test it yet, but we will do so in the next video.

285
00:22:27,180 --> 00:22:33,690
So this was just a preparation to prepare to board items and to prepare the adapter, the UI and everything.

286
00:22:33,870 --> 00:22:39,300
But at this point, we can now go ahead and implement the final parts of this to finally then test it.

287
00:22:39,300 --> 00:22:46,710
So to load the data from the database, load it into our app, then load it into our recycler view and

288
00:22:46,710 --> 00:22:49,260
display the different boards that we have.

289
00:22:49,620 --> 00:22:50,850
So see you in the next video.

