1
00:00:00,560 --> 00:00:07,790
All righty, welcome back and this video, we are going to set everything up so that our task list activity

2
00:00:08,360 --> 00:00:14,180
is going to be prepared, so to speak, so you can see here at the top we can see the board name.

3
00:00:14,360 --> 00:00:18,290
And then later on, we want to, of course, have the task list here.

4
00:00:18,500 --> 00:00:24,320
We will already see how we can create tasks, how we can load the tasks.

5
00:00:24,320 --> 00:00:27,790
But of course, we are not able to create tasks yet.

6
00:00:27,800 --> 00:00:29,960
And that's what we, of course, will do later on.

7
00:00:29,970 --> 00:00:33,220
But as you know, it's a huge project, so there's a lot to do.

8
00:00:33,470 --> 00:00:35,930
So let's go ahead and start with that first.

9
00:00:36,230 --> 00:00:43,250
So the first thing that I think makes sense to build is going to be a new model, which we will put

10
00:00:43,250 --> 00:00:47,360
into models here, of course, to create a new Coplan file.

11
00:00:47,510 --> 00:00:49,070
And it's going to be a class.

12
00:00:49,080 --> 00:00:51,020
So I'm just going to call this one task.

13
00:00:51,490 --> 00:00:56,810
So the idea here is that each board can have multiple tasks.

14
00:00:57,230 --> 00:00:57,730
All right.

15
00:00:57,740 --> 00:01:04,640
So here I'm just going to say that it should have a title, which will be a string.

16
00:01:04,819 --> 00:01:06,890
And by the way, this is going to be a data class.

17
00:01:06,890 --> 00:01:10,280
So I think it makes sense to add this here.

18
00:01:11,690 --> 00:01:12,380
And.

19
00:01:14,380 --> 00:01:22,330
But the VA title, and there should also be part of the bill, of course, so we'll need to do that

20
00:01:22,750 --> 00:01:30,430
and then created by all the EVOL because it will never change.

21
00:01:31,120 --> 00:01:34,570
OK, so each of them will be an empty string for now.

22
00:01:36,370 --> 00:01:37,430
And that is it.

23
00:01:37,840 --> 00:01:43,360
OK, so when we create a task for now, it will be empty, but later on we will add information in there

24
00:01:43,540 --> 00:01:45,820
and this one should be Passell Bo.

25
00:01:47,970 --> 00:01:50,940
And if we do that, we need to make.

26
00:01:52,480 --> 00:01:57,310
A change here, implement the members, let's add those two here.

27
00:01:59,380 --> 00:02:02,670
And let's also add the parts of the war.

28
00:02:03,910 --> 00:02:04,870
Implementation.

29
00:02:07,770 --> 00:02:14,760
So here, after the past, a little ball string, I need to add that and other than that.

30
00:02:16,690 --> 00:02:18,250
Should be pretty much good to go.

31
00:02:20,270 --> 00:02:25,350
I don't need to have these brackets here because we're not going to implement the constructor or do

32
00:02:25,350 --> 00:02:26,250
anything in their.

33
00:02:28,010 --> 00:02:30,440
By the way, right to Parslow well here.

34
00:02:31,690 --> 00:02:37,330
For some reason, it didn't work out for me as I intended it, so I'm just going to add the values here

35
00:02:37,330 --> 00:02:37,920
manually.

36
00:02:38,410 --> 00:02:46,360
So first of all, I will need to add with the destination or test, it's not the destination, but test.

37
00:02:47,500 --> 00:02:49,840
And then right to string's here.

38
00:02:52,480 --> 00:02:58,900
And then I'm going to get rid of this question mark here to make it simpler and describe contents will

39
00:02:58,900 --> 00:02:59,920
simply return.

40
00:03:00,920 --> 00:03:01,460
Zero.

41
00:03:05,330 --> 00:03:07,470
OK, and the rest can stay as it is.

42
00:03:08,330 --> 00:03:10,670
That is going to be our task class.

43
00:03:12,060 --> 00:03:14,490
Next, I'm going to go over to the board.

44
00:03:15,720 --> 00:03:22,950
And create a new entry here, because we don't only want to have document I.D., but, of course, also

45
00:03:22,950 --> 00:03:24,750
a task list.

46
00:03:25,580 --> 00:03:29,730
So here are a list of tasks.

47
00:03:30,570 --> 00:03:33,660
Should be an empty array list for now.

48
00:03:35,860 --> 00:03:42,430
And of course, accordingly, we have to make adjustments here as well, so the first thing is that

49
00:03:42,430 --> 00:03:44,550
we adjust the constructor here, OK?

50
00:03:44,890 --> 00:03:51,070
And what we will do is we will, first of all, add a comma here so that we have another entry.

51
00:03:51,340 --> 00:03:55,150
So parcel dot and here becomes a little more advanced.

52
00:03:55,160 --> 00:03:58,710
So we are using a typed array list here.

53
00:03:59,200 --> 00:04:04,000
So not a string array list as we have before, but this time we're using an own type, which is task.

54
00:04:04,300 --> 00:04:08,040
And when you do that, you also need to add a creator here.

55
00:04:08,050 --> 00:04:13,730
So when you hover over it, it will need some more details here.

56
00:04:14,170 --> 00:04:18,690
And what I'm going to do is I'm going to use task that creator.

57
00:04:19,149 --> 00:04:21,070
So what is this task creator?

58
00:04:23,610 --> 00:04:29,280
Well, if you look in our task class or to be more precise, if you look at the creator, you can see

59
00:04:29,280 --> 00:04:34,830
that we have this companion object, which is the creator, which is our possible creator of a task.

60
00:04:35,520 --> 00:04:41,160
So here we create a task from Pozole Lable were formed Passell itself.

61
00:04:43,090 --> 00:04:48,940
And that is what we need to pass in here, and it's a complaining, so let's add the two exclamation

62
00:04:48,940 --> 00:04:49,810
marks here as well.

63
00:04:50,170 --> 00:04:55,990
And then here we will also need to add something to our right to parcel, parcel, dot.

64
00:04:59,340 --> 00:05:02,190
Right, typed list.

65
00:05:03,260 --> 00:05:06,620
Where we then pass in our task list.

66
00:05:07,680 --> 00:05:14,940
Now, if you look at our project, you can see that this is The Watch Simpsons, so this is the title

67
00:05:14,940 --> 00:05:19,230
of our document and we want to pass the title over.

68
00:05:19,560 --> 00:05:26,070
But more specifically, we want to pass the document idea over so that we can get all of the information

69
00:05:26,070 --> 00:05:28,350
about this specific board.

70
00:05:29,070 --> 00:05:38,400
OK, so in order to do that, we will just go to our constants and first of all, create a new constant

71
00:05:39,420 --> 00:05:45,630
const Voll and this one will be the document ID type string.

72
00:05:47,070 --> 00:05:52,470
And I'm going to assign document Heidi here.

73
00:05:54,680 --> 00:05:56,330
And why would I even need that?

74
00:05:56,360 --> 00:06:04,430
Well, once we click on the board and I mean the main activity here, once we click on the board itself

75
00:06:04,430 --> 00:06:09,040
when clicking on the adapter, what we want to do is to start an activity here.

76
00:06:09,040 --> 00:06:09,340
Right.

77
00:06:09,620 --> 00:06:13,750
But what we want to also do is we want to pass some information here.

78
00:06:14,090 --> 00:06:19,670
So, for example, we would like to pass in details about the.

79
00:06:20,920 --> 00:06:29,590
Document that we want to open, so let's cut out the intent, let's create an intent here so VUL intent

80
00:06:29,830 --> 00:06:35,410
will be our intent that we had before from the main activity over to the task list activity.

81
00:06:36,750 --> 00:06:44,790
Class here and then this time we pass in some more information to our start activity, so we need to

82
00:06:45,120 --> 00:06:46,710
add this to the intent.

83
00:06:46,920 --> 00:06:50,200
So put extra and where do we want to put it?

84
00:06:50,220 --> 00:06:54,110
Well, and Constance Dot document it.

85
00:06:55,470 --> 00:06:57,750
And what kind of information do we want to pass in?

86
00:06:57,780 --> 00:07:01,160
Well, model dot, document ID.

87
00:07:01,500 --> 00:07:04,050
So this model is what we get from our unclick here.

88
00:07:04,170 --> 00:07:11,190
So we get the board, which is our model, and in the board class we have this document ID and now we

89
00:07:11,190 --> 00:07:18,630
use that in order to put it into the intent and pass it over when starting the activity.

90
00:07:19,650 --> 00:07:22,770
OK, so that's the idea of this change in the code here.

91
00:07:24,270 --> 00:07:33,270
Then we can get the details in our task list activity, because now we can catch it once we are in this

92
00:07:33,270 --> 00:07:43,140
view, we can just go ahead and say our board document I.D. is going to be an empty string and then

93
00:07:43,530 --> 00:07:45,790
we get the actual strength from the intent.

94
00:07:45,810 --> 00:07:50,910
So if the intent has some extra information at the position of Constance.

95
00:07:53,820 --> 00:07:54,930
Document ID.

96
00:07:56,580 --> 00:08:07,380
Then we want to use port document ID as equal to intent, get string extra at the position of constants

97
00:08:08,640 --> 00:08:10,260
that document ID.

98
00:08:12,530 --> 00:08:18,800
So we're basically just passing over the document ID from one activity to another and this activity,

99
00:08:18,810 --> 00:08:27,380
we catch it and then we have it here in our variable document ID and now we can load that document ID

100
00:08:27,380 --> 00:08:29,020
from our Firestar class.

101
00:08:29,390 --> 00:08:33,919
So first of all, let's show the progress dialogue real quick and then.

102
00:08:35,059 --> 00:08:40,640
In order to do that, we, of course, need to make sure that this class is inheriting from our base

103
00:08:40,640 --> 00:08:53,180
activity that we created, then we use our fire store class to get the board details and get board details

104
00:08:53,180 --> 00:08:55,280
as a function that we still need to create.

105
00:08:55,290 --> 00:09:00,860
So we pass in the activity and the board documents Heidi.

106
00:09:01,790 --> 00:09:05,930
OK, so let's create this function in our first class.

107
00:09:06,890 --> 00:09:12,740
So just go ahead and fun, get more details.

108
00:09:13,860 --> 00:09:24,150
Here, we need to pass on the activity and here it's our task list activity and then we need to document

109
00:09:24,150 --> 00:09:24,470
it.

110
00:09:26,660 --> 00:09:31,510
Which is of type strength, so document I.D., which is a strain.

111
00:09:32,450 --> 00:09:37,670
OK, so this is the information that we need to pass when we want to get the details and then we can

112
00:09:37,670 --> 00:09:42,950
go ahead and do the whole getting of data from the collection.

113
00:09:42,980 --> 00:09:45,750
So here it's very similar to that code.

114
00:09:45,780 --> 00:09:46,820
So let's copy it.

115
00:09:47,120 --> 00:09:51,380
So it is similar to our five story collection getting the Borz.

116
00:09:55,420 --> 00:10:00,880
But this time, we don't want to get it where the array contains a certain information, but we just

117
00:10:00,880 --> 00:10:07,270
want to get to document where the document ID is the same as the one that was passed to this function.

118
00:10:08,230 --> 00:10:08,700
OK.

119
00:10:09,670 --> 00:10:16,150
So then if we get that, we can now use that document to, first of all, lock something, so we are

120
00:10:16,150 --> 00:10:19,240
going to allow the document to string.

121
00:10:22,150 --> 00:10:24,610
Thought here to string.

122
00:10:27,170 --> 00:10:34,940
Then we can for now get rid of this whole code and also this part here.

123
00:10:36,770 --> 00:10:38,600
And now what we want to do is.

124
00:10:43,120 --> 00:10:50,080
Get board details, and these are the ones that we are going to, again do in the task list.

125
00:10:50,290 --> 00:10:52,870
So here we're going to create a new function.

126
00:10:54,630 --> 00:10:57,510
FON board details.

127
00:10:59,440 --> 00:11:00,820
Which needs a board.

128
00:11:03,160 --> 00:11:08,760
So here, I'm going to say has an aboard that's import port here.

129
00:11:11,070 --> 00:11:14,100
And here I am, first of all, going to highlight the progress dialogue.

130
00:11:15,330 --> 00:11:20,370
So then I want to set up the action bar and where would I get it from?

131
00:11:20,400 --> 00:11:25,650
Well, we can get it from the main activity, but we can also look at some other activities where we

132
00:11:26,280 --> 00:11:27,120
set that up.

133
00:11:27,120 --> 00:11:30,570
So let's look at the base activity that we set it up here.

134
00:11:30,570 --> 00:11:33,600
I think we didn't then in the.

135
00:11:34,830 --> 00:11:36,240
My profile.

136
00:11:37,770 --> 00:11:45,900
Activity, I think that we had a very sophisticated function here, which was set up Action Bar, so

137
00:11:45,900 --> 00:11:46,450
this one here.

138
00:11:46,740 --> 00:11:52,770
So what I'm going to do is I'm going to copy this one and I'm going to reuse it and my task list activity

139
00:11:52,770 --> 00:11:54,270
because it's going to be very similar.

140
00:11:54,570 --> 00:12:02,040
So first of all, we have to set up action bar function, which here now is going to use the tool bar.

141
00:12:03,850 --> 00:12:09,470
Task list activity, and it's super important that you adjust the toolbar to the activity settings here

142
00:12:09,470 --> 00:12:13,420
at the certification and click listener as well, because otherwise you get a crash.

143
00:12:14,140 --> 00:12:16,430
Then the action bar can stay the same.

144
00:12:16,750 --> 00:12:23,170
The title, however, is not going to come from the get string, but it's actually going to come from

145
00:12:23,500 --> 00:12:25,750
the function call.

146
00:12:25,780 --> 00:12:33,520
So here I'm going to say that pass me the string, so pass me the title and I'm going to display that.

147
00:12:34,090 --> 00:12:39,970
So now what we can do is we can do that in more details so we hide the progress dialogue once we load

148
00:12:39,970 --> 00:12:42,700
the page and then we set up the action bar.

149
00:12:44,080 --> 00:12:47,920
With a title which is going to be bought that name.

150
00:12:49,300 --> 00:12:50,780
So each boat has a name, right?

151
00:12:51,340 --> 00:12:55,720
And here we want to get that name and we want to display it in the.

152
00:12:57,590 --> 00:13:03,110
Still bottom to top, so that's what this function does here, this set up action bar is going to set

153
00:13:03,110 --> 00:13:08,720
that up and also it's going to add a little back button as well as the on back press functionality once

154
00:13:08,720 --> 00:13:09,530
we click on it.

155
00:13:09,770 --> 00:13:13,430
And it will be called in the board details this time and not in uncreate.

156
00:13:15,420 --> 00:13:17,550
So now we can go back to our.

157
00:13:18,620 --> 00:13:25,100
First class and finalize our to do and here we just say activity.

158
00:13:28,460 --> 00:13:38,360
Thought for details and here we can pass in the document, so document to object and what kind of object

159
00:13:38,360 --> 00:13:38,610
is it?

160
00:13:38,630 --> 00:13:40,190
Well, it's of type board.

161
00:13:40,970 --> 00:13:45,740
So board, colon, colon class, the java.

162
00:13:47,800 --> 00:13:53,960
And this can go wrong or this could be now, and that's why we need to add the two exclamation marks.

163
00:13:54,700 --> 00:13:59,500
OK, so at this point, you might be a little confused because I jumped around to between the different

164
00:13:59,500 --> 00:14:03,070
classes, but it's the same approach that we had before.

165
00:14:03,250 --> 00:14:04,650
So we are first class.

166
00:14:04,660 --> 00:14:07,930
That's what we handle, all of the loading of the data.

167
00:14:07,960 --> 00:14:08,200
Right.

168
00:14:08,210 --> 00:14:10,750
So we're getting the board data from the collection.

169
00:14:11,170 --> 00:14:13,570
So we get it from the board's collection.

170
00:14:13,600 --> 00:14:17,260
Then we have a document there with the document ID.

171
00:14:17,710 --> 00:14:21,760
So each board has a document ID and unique one and we want to get that.

172
00:14:22,210 --> 00:14:26,380
And if that was successful, then we're going to load that document and we're going to.

173
00:14:27,670 --> 00:14:35,800
Use that as an object of type board and we pass that to the board details function in our task list

174
00:14:35,800 --> 00:14:39,930
activity because cardboard details is going to be loaded in this activity.

175
00:14:40,510 --> 00:14:46,600
So we need to pass on this task, this activity, which means that in the end, we get to this function

176
00:14:46,600 --> 00:14:54,520
here, where we then set up the action bar, where we then load the title that was passed to us, by

177
00:14:54,520 --> 00:14:58,060
the way, is the board name that is then passed to us.

178
00:14:58,060 --> 00:15:00,880
And we set that as the action bar title.

179
00:15:03,230 --> 00:15:10,850
So basically what we did is we got the budget document, no, pass it over to this task list activity

180
00:15:11,210 --> 00:15:17,120
in the task, this activity, we loaded the board for that number and we loaded the name of that board.

181
00:15:18,620 --> 00:15:19,130
All right.

182
00:15:21,730 --> 00:15:27,880
Now, you could have, of course, also just directly from the board itself, sent over the name, but

183
00:15:27,880 --> 00:15:34,060
that is not going to be enough for later stages because later on, we don't only want to have the board

184
00:15:34,060 --> 00:15:37,590
name, but we also want to get more information on this task list activity.

185
00:15:37,870 --> 00:15:40,300
So it makes sense that we know the data anyways.

186
00:15:40,990 --> 00:15:41,420
All right.

187
00:15:41,890 --> 00:15:44,020
OK, so that is it for this video.

188
00:15:44,620 --> 00:15:50,650
By the way, before we finish it, let's test whether this actually has worked with our own examples

189
00:15:50,650 --> 00:15:50,950
there.

190
00:15:52,830 --> 00:15:53,680
And there we are.

191
00:15:53,700 --> 00:15:57,300
Let's check out the board with image and we can see the title is there.

192
00:15:57,330 --> 00:16:01,650
Let's go back let's go to board one and the title is there.

193
00:16:02,340 --> 00:16:02,820
All right.

194
00:16:03,850 --> 00:16:09,700
So it seems like we are opening the actual borders, which is amazing because now we can go ahead and

195
00:16:09,700 --> 00:16:15,730
use that knowledge to display all of the details about the board, which contains all of the different

196
00:16:15,730 --> 00:16:18,650
tasks which then contain all of the different cards.

197
00:16:19,360 --> 00:16:23,980
OK, so thanks a lot for being with me and see you in the next video.

