1
00:00:00,510 --> 00:00:01,170
Welcome back.

2
00:00:01,410 --> 00:00:06,600
And this video, we are going to implement the feature that you can see here where you can see the images

3
00:00:06,600 --> 00:00:10,890
of the people who are assigned to a specific project cart.

4
00:00:11,070 --> 00:00:11,460
All right.

5
00:00:11,470 --> 00:00:14,060
So here within the task force, we have those different cards.

6
00:00:14,070 --> 00:00:21,450
And then if we have another person assigned to the project, except for the creator itself, then we

7
00:00:21,450 --> 00:00:25,340
will see the different people who are assigned to it.

8
00:00:25,350 --> 00:00:26,700
So the different users.

9
00:00:27,180 --> 00:00:27,530
All right.

10
00:00:27,540 --> 00:00:29,040
So let's implement this feature.

11
00:00:29,370 --> 00:00:34,340
In order to do that, we need to go to your task list activity, because that's where the magic happens.

12
00:00:34,350 --> 00:00:36,770
That's where we are on that screen.

13
00:00:36,780 --> 00:00:39,960
So let's go over your task list activity.

14
00:00:41,430 --> 00:00:48,150
And that is to, first of all, make this variable here so our assigned member details a list.

15
00:00:49,510 --> 00:00:57,400
To make it public so that we can access it from multiple spots and then we need to cut something out

16
00:00:57,400 --> 00:01:02,680
of the code, which means we need to go to our board detail function.

17
00:01:03,570 --> 00:01:05,680
So what details where is it?

18
00:01:05,700 --> 00:01:12,210
It's further down here, right, and there we need to cut a specific part of the code out.

19
00:01:12,390 --> 00:01:13,470
So here this one.

20
00:01:14,760 --> 00:01:18,760
All the way down to the point where we start to show the progress dialogue.

21
00:01:19,290 --> 00:01:19,650
All right.

22
00:01:19,660 --> 00:01:25,860
So from the set up action by virtue of the show progress dialogue, let's cut this piece out and paste

23
00:01:25,860 --> 00:01:27,900
it to our board members.

24
00:01:27,900 --> 00:01:29,160
Details list.

25
00:01:30,760 --> 00:01:36,430
Functio, so to this one here, just underneath hyd progress dialogue.

26
00:01:38,470 --> 00:01:43,420
Now, the board, of course, will be the global board details variable.

27
00:01:44,230 --> 00:01:50,220
All right, so what details task first, then the layout manager all stays the same.

28
00:01:50,230 --> 00:01:56,410
And of course, here, when it comes to the task list, we also need to use and board details here instead,

29
00:01:56,680 --> 00:02:02,350
because port was a variable that was past the function and this case, we get the board directly from

30
00:02:02,350 --> 00:02:05,320
the global variable that we created earlier on.

31
00:02:05,350 --> 00:02:08,410
So if you look at it, it's this one here, which is a board.

32
00:02:10,020 --> 00:02:18,870
All right, now we will be able to use that in that card list items adapter, so we have this adapter

33
00:02:18,870 --> 00:02:25,970
here, card list items adapter, and now we can use that global variable that we just prepared or the

34
00:02:25,980 --> 00:02:28,530
global variable that we made public.

35
00:02:28,530 --> 00:02:32,910
Now we can use it in here inside of our unbind view Holder.

36
00:02:35,090 --> 00:02:37,010
Just underneath this code here.

37
00:02:38,390 --> 00:02:47,420
We can go ahead and provide some additional code so we can check here if the context as a task list

38
00:02:48,260 --> 00:02:49,040
activity.

39
00:02:51,520 --> 00:02:55,780
Thought am a silent member details list.

40
00:02:56,740 --> 00:02:59,980
So now we used this global variable that we made public.

41
00:03:01,960 --> 00:03:02,800
That size.

42
00:03:04,320 --> 00:03:05,480
Is greater than zero.

43
00:03:07,740 --> 00:03:09,840
So let me put that into two lines.

44
00:03:10,130 --> 00:03:10,830
It's a real bomb.

45
00:03:12,530 --> 00:03:20,150
Then we want to have an instance of the selected members, so Paul selected members, a list should

46
00:03:20,150 --> 00:03:24,830
be an array list of selected members.

47
00:03:26,010 --> 00:03:27,810
Which is an array list.

48
00:03:29,920 --> 00:03:30,400
For now.

49
00:03:31,420 --> 00:03:35,650
And now just underneath it, we want to run a Falu.

50
00:03:36,520 --> 00:03:45,730
Where we check the eye in context that I'm assigned member details list thought indices.

51
00:03:47,440 --> 00:03:52,780
With another Falu where Jay in model thought assigned to.

52
00:03:54,610 --> 00:04:01,750
With the check where context Todd and assigned members details list at the position, I thought.

53
00:04:02,710 --> 00:04:05,020
Heidi equals Jay.

54
00:04:07,330 --> 00:04:09,010
So double equals sign, Jake.

55
00:04:11,550 --> 00:04:14,370
And then what do we want to do for these cases?

56
00:04:14,790 --> 00:04:18,959
Well, we want to add them to our selected members list.

57
00:04:19,560 --> 00:04:19,980
All right.

58
00:04:19,980 --> 00:04:26,850
So far, the elected member is a selected members object.

59
00:04:28,080 --> 00:04:32,360
Which contains the context that assigned details.

60
00:04:33,300 --> 00:04:34,590
No list I.

61
00:04:35,630 --> 00:04:45,220
I thought ID and context thought am assigned members details, I dot image.

62
00:04:46,630 --> 00:04:50,620
OK, because that's the information that a selected members object needs.

63
00:04:52,650 --> 00:04:56,190
And then we can go ahead and add that you are selected members list.

64
00:04:57,060 --> 00:04:57,420
All right.

65
00:04:57,420 --> 00:05:00,450
So here, add the selected members.

66
00:05:05,110 --> 00:05:09,240
All right, now that we have added that we can check if the list is empty or not.

67
00:05:09,550 --> 00:05:10,210
So if.

68
00:05:11,320 --> 00:05:17,890
The selected members list is greater than zero, so its size is greater than zero.

69
00:05:17,920 --> 00:05:23,290
We know that we have selected members and then we can check if the selected.

70
00:05:25,340 --> 00:05:30,830
Remember this list, that size is equal one and.

71
00:05:31,950 --> 00:05:39,060
The selected members list creator is the person who is currently locked in, then we don't want to display

72
00:05:39,060 --> 00:05:39,210
it.

73
00:05:39,390 --> 00:05:40,680
OK, so that's the idea.

74
00:05:40,860 --> 00:05:43,640
That's exactly what I told you as I tested the application.

75
00:05:43,980 --> 00:05:52,140
So here the I.D. at the first entry is modeled, not created by.

76
00:05:55,900 --> 00:05:56,350
Then.

77
00:05:57,830 --> 00:06:08,240
I want to make that recital of you gone, so Holder, that item you thought Arvi Carter selected members

78
00:06:08,540 --> 00:06:13,310
list, thought visibility view dot com.

79
00:06:14,660 --> 00:06:16,490
OK, so what is the point behind this?

80
00:06:17,860 --> 00:06:24,910
Well, the idea is, if you're the creator of this card here or of this whole board, then you don't

81
00:06:24,910 --> 00:06:27,040
need to see your image here all the time.

82
00:06:27,040 --> 00:06:27,960
It would be useless.

83
00:06:27,970 --> 00:06:34,060
You only want to see that if there are multiple people who are assigned to the project or if it's a

84
00:06:34,060 --> 00:06:36,110
person who is not you, OK?

85
00:06:36,550 --> 00:06:40,060
So at least that's the design, that philosophy that I have behind it.

86
00:06:40,060 --> 00:06:44,360
If you want to change that, you can of course, change it and make it the way you want it.

87
00:06:44,380 --> 00:06:51,490
But for example, here, if I get rid of this additional field and I am the only creator of this card,

88
00:06:51,490 --> 00:06:52,600
you can see it's not there.

89
00:06:52,610 --> 00:06:58,630
So the images are only there if it's not the creator itself who is a site.

90
00:06:59,320 --> 00:07:05,620
OK, so this check that and you can see the other person would then be visible, but the creator itself

91
00:07:05,620 --> 00:07:06,460
will not be visible.

92
00:07:06,740 --> 00:07:12,310
So you could see, OK, if you're not visible there or in a card is in a way that you're not visible

93
00:07:12,310 --> 00:07:13,240
there, then.

94
00:07:14,380 --> 00:07:16,540
It's someone else who is responsible.

95
00:07:16,840 --> 00:07:23,110
The idea really is that, for example, if you create those cards for yourself, you don't want to display

96
00:07:23,110 --> 00:07:26,590
all of these images because they would just add no value at all.

97
00:07:26,830 --> 00:07:31,690
They would just make the whole thing a lot bigger, like the whole list would be a lot more clumsy and

98
00:07:31,690 --> 00:07:34,300
not as easy to use, so to speak.

99
00:07:35,200 --> 00:07:38,230
And in all other cases, we want to display this.

100
00:07:38,440 --> 00:07:41,800
OK, so let's make it visible in those cases.

101
00:07:42,400 --> 00:07:44,710
So you got.

102
00:07:46,480 --> 00:07:46,960
Visible.

103
00:07:48,820 --> 00:07:58,990
OK, on top of that, what we want to do is we want to give this holder item view Davíð card selected

104
00:07:58,990 --> 00:08:01,360
members, list a layout manager.

105
00:08:02,140 --> 00:08:02,560
All right.

106
00:08:02,570 --> 00:08:08,920
So the layout manager that I want to use is a grid layout manager, which I need to pass in the context

107
00:08:08,920 --> 00:08:11,800
and the span count, which I'm going to settle for.

108
00:08:11,800 --> 00:08:18,340
So I just say, OK, due to the size of this image, I only want to be able to put four in here, not

109
00:08:18,340 --> 00:08:19,060
more than four.

110
00:08:19,720 --> 00:08:21,790
OK, so that's what I do with this spend count.

111
00:08:21,790 --> 00:08:24,580
At least in one line, only four can be added.

112
00:08:25,180 --> 00:08:26,480
OK, that's the idea here.

113
00:08:26,860 --> 00:08:28,090
Then we need an adapter.

114
00:08:28,120 --> 00:08:29,530
And which adapter should we use?

115
00:08:29,560 --> 00:08:38,260
Well, the card members list items adapter, which needs the context and then the selected members list.

116
00:08:39,280 --> 00:08:43,630
And then also, let's look at it, we have no further information here.

117
00:08:48,280 --> 00:08:50,080
And what I would like to add here.

118
00:08:50,970 --> 00:08:57,300
As a private VUL sign members said.

119
00:08:58,150 --> 00:09:00,040
Or it should be a boolean, right?

120
00:09:01,740 --> 00:09:11,370
And while we're here, let's also check that when we are inside of our own bond holder, so here I'm

121
00:09:11,370 --> 00:09:16,560
going to use it at the point where I check the position and fantasize.

122
00:09:16,890 --> 00:09:19,980
And here also each person assigned members.

123
00:09:22,020 --> 00:09:32,670
All right, so then we can go back to our card list items adapter here and now we need to pass in the

124
00:09:32,670 --> 00:09:34,020
information here as well.

125
00:09:34,020 --> 00:09:37,060
So but we want to assign members or not.

126
00:09:37,080 --> 00:09:39,420
And I'm going to say false here.

127
00:09:40,570 --> 00:09:47,260
All right, so this is how the editor is going to look like and how we can assign that adapter to the

128
00:09:47,260 --> 00:09:47,900
recital of you.

129
00:09:48,310 --> 00:09:48,730
All right.

130
00:09:48,740 --> 00:09:49,930
So here to discuss.

131
00:09:51,310 --> 00:09:52,240
Recyclable you.

132
00:09:53,620 --> 00:09:57,930
We can assign to adopt her, which will be the adapter that we just prepared.

133
00:10:01,400 --> 00:10:07,430
And now I'm going to add another listener here as well, so adapter dot set unclick Lessner.

134
00:10:08,590 --> 00:10:15,310
Which will be an object of card members, list item, adapter, unclick listeners, all of this.

135
00:10:17,380 --> 00:10:18,220
Interface there.

136
00:10:19,640 --> 00:10:24,590
All right, and now we need to, of course, implement it, so we need to have the unclick event here.

137
00:10:24,800 --> 00:10:26,450
So on Klick.

138
00:10:28,090 --> 00:10:30,670
And not a lesson there about the unclick event, so.

139
00:10:35,570 --> 00:10:38,420
Here on Kallick operated.

140
00:10:42,360 --> 00:10:45,390
And we may not forget who lost this year at the bottom.

141
00:10:45,420 --> 00:10:48,050
So this is our adaptive set on Click Listener.

142
00:10:48,080 --> 00:10:49,140
This is how is looking.

143
00:10:49,350 --> 00:10:52,750
And then we can now go ahead and implement their own click event.

144
00:10:52,780 --> 00:10:54,150
So what do you want to hear?

145
00:10:54,450 --> 00:10:57,450
Well, if there is an unclick listener.

146
00:10:59,330 --> 00:11:04,910
So if it's not Marle then used on Craigslist in the dot on click event.

147
00:11:06,960 --> 00:11:08,340
With the position.

148
00:11:10,330 --> 00:11:14,230
And as the unclick listen, there is a nullable we need to add the two exclamation marks here.

149
00:11:16,570 --> 00:11:22,900
All right, so all of that should happen if the selected members list size is greater than zero, what

150
00:11:22,900 --> 00:11:24,810
should happen if it's not greater than zero?

151
00:11:24,820 --> 00:11:32,170
So here towards the bottom, well, then I want to have an A-list blog here which uses our website reviews

152
00:11:32,920 --> 00:11:33,610
list here.

153
00:11:35,170 --> 00:11:40,420
And makes it invisible, so visibility said to view dot gone.

154
00:11:43,730 --> 00:11:44,390
All right.

155
00:11:50,780 --> 00:11:56,620
So at this point, we can test our application and see if it's actually visible in our app as well.

156
00:11:59,010 --> 00:12:06,180
And now, of course, as we have changed our cast member list items adductor and our card details activity,

157
00:12:06,450 --> 00:12:10,080
we get this every year because I didn't pass the.

158
00:12:11,300 --> 00:12:13,070
Pavilion here that we have added.

159
00:12:14,510 --> 00:12:18,860
Which is inside of our set up selected members, a list function.

160
00:12:22,120 --> 00:12:24,340
And here in this case, we assigned true.

161
00:12:25,470 --> 00:12:31,890
Because if we are in the car, details, activity, what we want to have us to guard members list items,

162
00:12:31,900 --> 00:12:36,000
adapters, assign members value is true.

163
00:12:38,350 --> 00:12:46,330
Because if you look at it, you only want to see I've had no, uh, this image, if there are any members

164
00:12:46,330 --> 00:12:49,480
to add, because if there is no one in the list, right.

165
00:12:49,480 --> 00:12:54,680
Except for you, the creator, then there's no reason to add someone to the list at that point.

166
00:12:55,330 --> 00:13:00,730
So you need to have multiple people assigned to the board for this to make sense, OK, or for this

167
00:13:00,730 --> 00:13:03,700
to make sense to make this appear.

168
00:13:03,700 --> 00:13:07,760
This I've at member, which is just a little plus icon there.

169
00:13:08,500 --> 00:13:08,950
All right.

170
00:13:08,950 --> 00:13:10,420
Now let's test our application.

171
00:13:12,000 --> 00:13:14,770
So let's go over to our board with image.

172
00:13:15,620 --> 00:13:17,810
OK, so here you could see nothing.

173
00:13:17,820 --> 00:13:19,840
That's because only we are assigned to the cart.

174
00:13:19,850 --> 00:13:21,600
Let's assign someone else to the cart.

175
00:13:23,250 --> 00:13:27,720
That we are now, we can see both now let's get rid of ourselves from the cart.

176
00:13:30,790 --> 00:13:37,000
And we could see the other person is still visible, which is part in this case and now the final case

177
00:13:37,000 --> 00:13:37,450
where.

178
00:13:38,750 --> 00:13:45,530
Well, we see all three cases already, right, so let's get rid of part and just have us there and

179
00:13:45,530 --> 00:13:47,870
we will see that the image disappears as well.

180
00:13:48,230 --> 00:13:48,650
All right.

181
00:13:48,650 --> 00:13:50,310
So this works as intended.

182
00:13:50,480 --> 00:13:50,870
Great.

183
00:13:52,830 --> 00:13:58,500
So I think this is a great moment to have another pause and let's go ahead with more features and the

184
00:13:58,500 --> 00:13:59,100
next video.

