1
00:00:00,670 --> 00:00:06,700
All right, so now let's take care of all of that coming together to finally be available in the card

2
00:00:06,700 --> 00:00:14,170
details activity so that we can then actually select a color and see it here on the label color view.

3
00:00:14,650 --> 00:00:15,160
All right.

4
00:00:15,190 --> 00:00:21,310
So in order to do so, we will need to have a function which will return a color list.

5
00:00:21,320 --> 00:00:25,170
So I'm going to create a new function inside of card details activity.

6
00:00:25,450 --> 00:00:26,950
So here, fun.

7
00:00:27,400 --> 00:00:29,380
And actually we can make it private as well.

8
00:00:29,830 --> 00:00:38,410
So Private Fun Colors list, which will return an array list of.

9
00:00:39,350 --> 00:00:39,890
Strength's.

10
00:00:43,240 --> 00:00:49,750
All right, so first of all, I'm going to create a new list of colors so colors list, which will be

11
00:00:49,750 --> 00:00:52,060
an array list of strings.

12
00:00:53,570 --> 00:00:57,560
And I'm going to say why I'm going to create an object of a realist here.

13
00:00:57,980 --> 00:01:03,890
Now I can go ahead and add to the list and I'm just going to show you the different colors that I want

14
00:01:03,890 --> 00:01:05,349
to use here.

15
00:01:05,630 --> 00:01:07,830
So it's those colors that you can see here.

16
00:01:08,180 --> 00:01:10,790
So I just add a bunch of colors here.

17
00:01:11,060 --> 00:01:11,780
You can.

18
00:01:13,000 --> 00:01:20,640
Like different colors, if you want to, it's free for you to decide and then I can return the colors

19
00:01:20,640 --> 00:01:21,030
list.

20
00:01:21,030 --> 00:01:23,970
By the way, you can also return a different amount of colors.

21
00:01:24,540 --> 00:01:27,620
You are completely free to choose whatever you want here.

22
00:01:29,830 --> 00:01:38,560
All right, then we will need a function which will set the color so private fund set color and that

23
00:01:38,560 --> 00:01:44,230
one will basically set the TV selected color.

24
00:01:46,100 --> 00:01:53,810
This one here on TV, selected label color text to be empty, because in our case currently, if we

25
00:01:53,810 --> 00:01:56,000
look at it, it says Select Color.

26
00:01:56,150 --> 00:02:02,060
So this is the text that we currently have and we want this to be an empty string.

27
00:02:02,150 --> 00:02:03,910
So no text at all.

28
00:02:04,160 --> 00:02:07,070
And instead we want to change the background of it.

29
00:02:07,310 --> 00:02:08,000
So here.

30
00:02:09,639 --> 00:02:13,450
Said background color, which will be.

31
00:02:14,360 --> 00:02:16,220
Color thought DPAs.

32
00:02:19,430 --> 00:02:24,620
And colors, but color pass color.

33
00:02:26,130 --> 00:02:33,260
With selected color now, by the way, we, of course, need to create this and select color variable,

34
00:02:33,900 --> 00:02:41,880
so this global variable and also let's import color here from Google Graphics and here let's create

35
00:02:41,880 --> 00:02:44,550
this global variable at the very top.

36
00:02:45,780 --> 00:02:46,650
So here.

37
00:02:50,540 --> 00:02:54,020
Private var m selected color.

38
00:02:56,300 --> 00:02:58,370
Which will for now be an empty string.

39
00:03:00,900 --> 00:03:06,630
All right, and now we need a function to actually trigger our dialogue.

40
00:03:07,020 --> 00:03:15,540
All right, so let's create one private fun label colors list dialogue.

41
00:03:16,930 --> 00:03:20,990
All right, so what are the details that we need from labor colored dialogue?

42
00:03:21,040 --> 00:03:25,210
Well, we need to context the list, the title and deselected color.

43
00:03:25,420 --> 00:03:29,070
So let's prepare all of those Sobell colors.

44
00:03:29,080 --> 00:03:33,400
A list should be an array list of strings.

45
00:03:34,450 --> 00:03:42,980
Which will be a colors list, or we'll just use the colors list function to get all of the colors.

46
00:03:43,270 --> 00:03:43,740
All right.

47
00:03:44,140 --> 00:03:49,630
And then now that we have those colors, we can go ahead and prepare the.

48
00:03:50,650 --> 00:03:59,140
This dialogue, so vollies, the dialogue will be subject, label, color.

49
00:04:00,630 --> 00:04:03,210
This dialogue, which now needs, of course.

50
00:04:04,460 --> 00:04:15,650
The context, then the list, then the text that we want to display and here I want to use the resources

51
00:04:15,650 --> 00:04:21,230
that we prepared, which means it will be the string, string, select label color, which is going

52
00:04:21,230 --> 00:04:23,300
to be this string here, OK?

53
00:04:24,600 --> 00:04:27,690
So that's the one that I want to use here.

54
00:04:31,810 --> 00:04:32,500
And now.

55
00:04:33,560 --> 00:04:41,810
We can define the code of it, so we can now go ahead and say, for example, by the way, I miss a

56
00:04:42,650 --> 00:04:43,390
bracket here.

57
00:04:43,760 --> 00:04:48,680
So here we need to implement the on item selected because if we look at it.

58
00:04:51,010 --> 00:04:58,720
We have this abstract function on it and select it, so if you use a label color dialogue, you need

59
00:04:58,720 --> 00:05:00,230
to implement its members.

60
00:05:00,250 --> 00:05:03,410
So to see that, implement the member on item selected.

61
00:05:03,850 --> 00:05:05,310
Now, we have a little to do here.

62
00:05:05,320 --> 00:05:08,140
So what do you want to do once we selected an item?

63
00:05:08,620 --> 00:05:10,090
Well, then we.

64
00:05:11,900 --> 00:05:16,760
Get the color right and we want to set that color to be the selected color.

65
00:05:18,250 --> 00:05:25,150
And also, we want to then call select color or said color, which is dysfunction, which will then

66
00:05:25,150 --> 00:05:31,790
set the current color as the new background of their set label.

67
00:05:31,810 --> 00:05:34,000
So if this select color label here.

68
00:05:35,880 --> 00:05:41,310
Now, of course, we need to trigger all of that, and in order to trigger it, we will add an unclick

69
00:05:41,310 --> 00:05:43,680
listener for this text you.

70
00:05:44,130 --> 00:05:47,640
OK, so in our uncreate function.

71
00:05:49,220 --> 00:05:56,060
Here we can give our TV selected label, Color and Outlook listener.

72
00:05:57,070 --> 00:05:59,080
On Click, listen, there will be.

73
00:06:00,120 --> 00:06:04,250
Calling labor colors, this dialogue, which is dysfunctional, we just created.

74
00:06:04,290 --> 00:06:05,940
So it should go ahead and use that.

75
00:06:08,290 --> 00:06:14,870
Now, of course, once we created this little dialogue here, we need to show at some point as well.

76
00:06:15,040 --> 00:06:17,830
Otherwise it will be not worth it created.

77
00:06:17,830 --> 00:06:18,090
Right.

78
00:06:18,400 --> 00:06:20,140
So that's the whole idea behind this label.

79
00:06:20,140 --> 00:06:21,210
Collarless dialogue.

80
00:06:21,490 --> 00:06:25,240
You could even call this one show liberalist color dialogue.

81
00:06:25,810 --> 00:06:31,780
So this function, you could call it differently, but I think it does what it should do.

82
00:06:31,780 --> 00:06:34,630
So it should now display the list dialogue.

83
00:06:36,450 --> 00:06:42,300
OK, that by itself is already pretty cool, but what I want to do is, of course, I want to not only

84
00:06:42,300 --> 00:06:46,530
display the color, but I also want to pass it to my card.

85
00:06:46,540 --> 00:06:55,650
So the card later on, when we reload the page or discard it, should know that we actually want to.

86
00:06:56,790 --> 00:06:59,710
Display a certain color because otherwise it won't know.

87
00:07:00,060 --> 00:07:03,360
So our card currently doesn't know anything about colors.

88
00:07:03,930 --> 00:07:05,130
That's what we need to change.

89
00:07:06,090 --> 00:07:09,530
So let's go over to discard and we can see now it works.

90
00:07:09,570 --> 00:07:16,590
So now we can select a color and you can also see that it even goes into the.

91
00:07:17,770 --> 00:07:22,690
Fields right here, but of course, the cart, as I said, doesn't know anything about that.

92
00:07:22,690 --> 00:07:25,420
So let's go to our cart.

93
00:07:26,740 --> 00:07:35,200
Model and it's adjusted a little bit because if we look at it here, the card, what it knows is the

94
00:07:35,200 --> 00:07:40,020
name who created it and who is assigned to it, but it knows nothing about its color.

95
00:07:40,510 --> 00:07:49,330
So I'm just going to add a field here, which will be evol label color, which will be a string that

96
00:07:49,330 --> 00:07:50,800
is empty by default.

97
00:07:54,780 --> 00:07:58,680
And now we can, of course, update the card details.

98
00:07:59,340 --> 00:08:05,370
All right, so we have this function here, update card details here.

99
00:08:05,380 --> 00:08:08,310
We, of course, also now need to pass on the color.

100
00:08:08,760 --> 00:08:11,130
And luckily enough, we have the color here.

101
00:08:12,000 --> 00:08:17,550
As we can just go ahead and add a new entry called Selected Color.

102
00:08:19,170 --> 00:08:22,290
OK, so for all it's going to look like this.

103
00:08:23,610 --> 00:08:27,520
So we create a cart now, and this cart also has a color.

104
00:08:27,990 --> 00:08:32,130
So now we will store that color in the database as well.

105
00:08:32,760 --> 00:08:34,520
Of course, we're not loading it yet.

106
00:08:36,220 --> 00:08:38,500
Or do we let's look at the uncreate.

107
00:08:40,179 --> 00:08:46,570
We're not actually loading it yet, but at least we're passing it to the database, so let's see if

108
00:08:46,570 --> 00:08:47,640
that's actually the case.

109
00:08:48,740 --> 00:08:50,870
Because once we click update.

110
00:08:53,130 --> 00:08:55,500
And they create function.

111
00:08:56,490 --> 00:08:58,530
We update the card details.

112
00:08:59,880 --> 00:09:00,870
All right, so let's see.

113
00:09:05,650 --> 00:09:12,190
Let's go to court one and listen to the selective color, for example, the screen, let's click on

114
00:09:12,190 --> 00:09:12,700
update.

115
00:09:15,070 --> 00:09:17,220
All right, now let's go to the back end.

116
00:09:19,070 --> 00:09:20,470
Let's check our list to here.

117
00:09:22,210 --> 00:09:24,130
So it's as card one.

118
00:09:26,490 --> 00:09:29,880
And that's actually the wrong list, so here, listen to.

119
00:09:34,360 --> 00:09:38,950
Has the card here, which has discolor, so let's see if that is actually the right color.

120
00:09:40,120 --> 00:09:41,740
And you can see the screen here.

121
00:09:42,900 --> 00:09:47,340
And that looks a lot like the green that I have selected here.

122
00:09:48,350 --> 00:09:55,490
All right, so that seems to work OK, and that's it for this video and the next one, we will, of

123
00:09:55,490 --> 00:09:59,420
course, also want to read to color to display it and so forth.

124
00:09:59,720 --> 00:10:01,040
So see you in the next one.

