Welcome back.
Now that we are at the point where we can select the color and put the color in here, we so need to
add this little checkbox here, which indicates which color we currently are using as we have prepared
that image for you.
Right.
So it makes sense to also use at one point.
And then we also need to take care of the members here.
So we need to pass in the members from our board to our task lists, green to this one here and then
to the card screen so that we can select members that are assigned to the board to a specific card.
And also, even though we selected the color, let's select one, for example, here, when we come
back to the screen, it's not there anymore, right?
So we still need to reselected.
So that's something that we need to fix now.
So let's get started, first of all, in the cards, details screen in uncreate.
That's where we can basically just do that.
Right.
So let's go ahead and add a line here, which will take care of that.
So we need to use them.
Selected color, which is a global variable.
That created and we get it from M. board details.
The task list.
At the end, this position.
Then Cartes position and basically the color, right?
So this part here guards position that labor color.
All right, at this point, we can check if the select color is not empty because it could be empty
potentially, then set the color.
Which is our function here, where we just set the color right, and then we can pass the selected color
to show it has already selected with a tick I in the list.
So let's do that as well.
Therefore, in the label color list dialogue inside of our card details, we have this function called
labor color list dialogue.
And here, there we can now.
The following, so let's go ahead and adjust our analyst dialogue a little bit because we get the selected
color here, right?
But we are not using it here yet, so am selected color.
So I want to also pass on the select color to my label color list dialogue.
So here to select color.
And now, finally, we need to go to our car list items adapter.
Activity or adapt or not the activity, so let's go over to our adapters here.
List items that because that's where we have the actual list elements, right, and I want this a list
element here to have a little tick box here, which is our little icon that we had there.
And that's what we need to put into Unbind view Holder.
So here we can check if.
Model, not labor color dot is not empty.
If that's the case, then.
Use hold, so basically hold their item view that you underscore a label color visibility to.
View visible.
And then.
Also set the background said background, color to color, not pass color.
And here we need your person.
Our model, our labor color, Soheir model thought labor color.
OK, so let's put that into line so that we can read the whole quote here and then alternatively.
So in the case that the labor color is in fact, empty, we can set the visibility to con.
All right, now, at this point, I tested.
All right, so let's check out the board with image that we can see the cart now has the color.
So that is what we've done here.
By the way, this little color item, you color visibility and so forth.
So now we can see, OK, the color is green and inside of the cart.
Well, as it seems, the color is not selected yet.
So let's look into that a little because it still wasn't set there.
And after a bit of debugging, I found the error or the problem, and it is stored in our data class
card, we're not actually getting the constructor or we're not using our label color in the constructor.
So here we also need to read the string of our constructor.
And of course, we also need to write the string in our right to parcel.
So here we, of course, need also to use the label color because otherwise, of course, the color
will not be available.
Right.
All right.
And at that point, let's test it again.
And see if it actually is getting us the color here.
So bored with image, let's click on the cart and we can see the colors here.
All right.
So that's why it's super important to look at the detail sometimes.
Right?
OK, I think that we should make a break at this point.
So let's go ahead and look at the select members functionality here in the next video.
So I'll see you there.