All righty, welcome back and this video, we are going to set everything up so that our task list activity
is going to be prepared, so to speak, so you can see here at the top we can see the board name.
And then later on, we want to, of course, have the task list here.
We will already see how we can create tasks, how we can load the tasks.
But of course, we are not able to create tasks yet.
And that's what we, of course, will do later on.
But as you know, it's a huge project, so there's a lot to do.
So let's go ahead and start with that first.
So the first thing that I think makes sense to build is going to be a new model, which we will put
into models here, of course, to create a new Coplan file.
And it's going to be a class.
So I'm just going to call this one task.
So the idea here is that each board can have multiple tasks.
All right.
So here I'm just going to say that it should have a title, which will be a string.
And by the way, this is going to be a data class.
So I think it makes sense to add this here.
And.
But the VA title, and there should also be part of the bill, of course, so we'll need to do that
and then created by all the EVOL because it will never change.
OK, so each of them will be an empty string for now.
And that is it.
OK, so when we create a task for now, it will be empty, but later on we will add information in there
and this one should be Passell Bo.
And if we do that, we need to make.
A change here, implement the members, let's add those two here.
And let's also add the parts of the war.
Implementation.
So here, after the past, a little ball string, I need to add that and other than that.
Should be pretty much good to go.
I don't need to have these brackets here because we're not going to implement the constructor or do
anything in their.
By the way, right to Parslow well here.
For some reason, it didn't work out for me as I intended it, so I'm just going to add the values here
manually.
So first of all, I will need to add with the destination or test, it's not the destination, but test.
And then right to string's here.
And then I'm going to get rid of this question mark here to make it simpler and describe contents will
simply return.
Zero.
OK, and the rest can stay as it is.
That is going to be our task class.
Next, I'm going to go over to the board.
And create a new entry here, because we don't only want to have document I.D., but, of course, also
a task list.
So here are a list of tasks.
Should be an empty array list for now.
And of course, accordingly, we have to make adjustments here as well, so the first thing is that
we adjust the constructor here, OK?
And what we will do is we will, first of all, add a comma here so that we have another entry.
So parcel dot and here becomes a little more advanced.
So we are using a typed array list here.
So not a string array list as we have before, but this time we're using an own type, which is task.
And when you do that, you also need to add a creator here.
So when you hover over it, it will need some more details here.
And what I'm going to do is I'm going to use task that creator.
So what is this task creator?
Well, if you look in our task class or to be more precise, if you look at the creator, you can see
that we have this companion object, which is the creator, which is our possible creator of a task.
So here we create a task from Pozole Lable were formed Passell itself.
And that is what we need to pass in here, and it's a complaining, so let's add the two exclamation
marks here as well.
And then here we will also need to add something to our right to parcel, parcel, dot.
Right, typed list.
Where we then pass in our task list.
Now, if you look at our project, you can see that this is The Watch Simpsons, so this is the title
of our document and we want to pass the title over.
But more specifically, we want to pass the document idea over so that we can get all of the information
about this specific board.
OK, so in order to do that, we will just go to our constants and first of all, create a new constant
const Voll and this one will be the document ID type string.
And I'm going to assign document Heidi here.
And why would I even need that?
Well, once we click on the board and I mean the main activity here, once we click on the board itself
when clicking on the adapter, what we want to do is to start an activity here.
Right.
But what we want to also do is we want to pass some information here.
So, for example, we would like to pass in details about the.
Document that we want to open, so let's cut out the intent, let's create an intent here so VUL intent
will be our intent that we had before from the main activity over to the task list activity.
Class here and then this time we pass in some more information to our start activity, so we need to
add this to the intent.
So put extra and where do we want to put it?
Well, and Constance Dot document it.
And what kind of information do we want to pass in?
Well, model dot, document ID.
So this model is what we get from our unclick here.
So we get the board, which is our model, and in the board class we have this document ID and now we
use that in order to put it into the intent and pass it over when starting the activity.
OK, so that's the idea of this change in the code here.
Then we can get the details in our task list activity, because now we can catch it once we are in this
view, we can just go ahead and say our board document I.D. is going to be an empty string and then
we get the actual strength from the intent.
So if the intent has some extra information at the position of Constance.
Document ID.
Then we want to use port document ID as equal to intent, get string extra at the position of constants
that document ID.
So we're basically just passing over the document ID from one activity to another and this activity,
we catch it and then we have it here in our variable document ID and now we can load that document ID
from our Firestar class.
So first of all, let's show the progress dialogue real quick and then.
In order to do that, we, of course, need to make sure that this class is inheriting from our base
activity that we created, then we use our fire store class to get the board details and get board details
as a function that we still need to create.
So we pass in the activity and the board documents Heidi.
OK, so let's create this function in our first class.
So just go ahead and fun, get more details.
Here, we need to pass on the activity and here it's our task list activity and then we need to document
it.
Which is of type strength, so document I.D., which is a strain.
OK, so this is the information that we need to pass when we want to get the details and then we can
go ahead and do the whole getting of data from the collection.
So here it's very similar to that code.
So let's copy it.
So it is similar to our five story collection getting the Borz.
But this time, we don't want to get it where the array contains a certain information, but we just
want to get to document where the document ID is the same as the one that was passed to this function.
OK.
So then if we get that, we can now use that document to, first of all, lock something, so we are
going to allow the document to string.
Thought here to string.
Then we can for now get rid of this whole code and also this part here.
And now what we want to do is.
Get board details, and these are the ones that we are going to, again do in the task list.
So here we're going to create a new function.
FON board details.
Which needs a board.
So here, I'm going to say has an aboard that's import port here.
And here I am, first of all, going to highlight the progress dialogue.
So then I want to set up the action bar and where would I get it from?
Well, we can get it from the main activity, but we can also look at some other activities where we
set that up.
So let's look at the base activity that we set it up here.
I think we didn't then in the.
My profile.
Activity, I think that we had a very sophisticated function here, which was set up Action Bar, so
this one here.
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
because it's going to be very similar.
So first of all, we have to set up action bar function, which here now is going to use the tool bar.
Task list activity, and it's super important that you adjust the toolbar to the activity settings here
at the certification and click listener as well, because otherwise you get a crash.
Then the action bar can stay the same.
The title, however, is not going to come from the get string, but it's actually going to come from
the function call.
So here I'm going to say that pass me the string, so pass me the title and I'm going to display that.
So now what we can do is we can do that in more details so we hide the progress dialogue once we load
the page and then we set up the action bar.
With a title which is going to be bought that name.
So each boat has a name, right?
And here we want to get that name and we want to display it in the.
Still bottom to top, so that's what this function does here, this set up action bar is going to set
that up and also it's going to add a little back button as well as the on back press functionality once
we click on it.
And it will be called in the board details this time and not in uncreate.
So now we can go back to our.
First class and finalize our to do and here we just say activity.
Thought for details and here we can pass in the document, so document to object and what kind of object
is it?
Well, it's of type board.
So board, colon, colon class, the java.
And this can go wrong or this could be now, and that's why we need to add the two exclamation marks.
OK, so at this point, you might be a little confused because I jumped around to between the different
classes, but it's the same approach that we had before.
So we are first class.
That's what we handle, all of the loading of the data.
Right.
So we're getting the board data from the collection.
So we get it from the board's collection.
Then we have a document there with the document ID.
So each board has a document ID and unique one and we want to get that.
And if that was successful, then we're going to load that document and we're going to.
Use that as an object of type board and we pass that to the board details function in our task list
activity because cardboard details is going to be loaded in this activity.
So we need to pass on this task, this activity, which means that in the end, we get to this function
here, where we then set up the action bar, where we then load the title that was passed to us, by
the way, is the board name that is then passed to us.
And we set that as the action bar title.
So basically what we did is we got the budget document, no, pass it over to this task list activity
in the task, this activity, we loaded the board for that number and we loaded the name of that board.
All right.
Now, you could have, of course, also just directly from the board itself, sent over the name, but
that is not going to be enough for later stages because later on, we don't only want to have the board
name, but we also want to get more information on this task list activity.
So it makes sense that we know the data anyways.
All right.
OK, so that is it for this video.
By the way, before we finish it, let's test whether this actually has worked with our own examples
there.
And there we are.
Let's check out the board with image and we can see the title is there.
Let's go back let's go to board one and the title is there.
All right.
So it seems like we are opening the actual borders, which is amazing because now we can go ahead and
use that knowledge to display all of the details about the board, which contains all of the different
tasks which then contain all of the different cards.
OK, so thanks a lot for being with me and see you in the next video.