Welcome back and this video, we take care of the lines to stay on the screen, so we want them to be
persistent or at least available for the life cycle of our activity.
So in order to get that, what I'm going to do is I'm going to create a variable here, which I'm going
to call paths and paths, and it's going to be an array list of custom PADF.
And now I'm making this array list and immutable array list that is just the case because even though
the list itself is immutable, its own list elements can be changed.
So we can have as many list elements in there any time, but we cannot make it the new array, less
so to speak.
OK, now the next thing we need to do is we need to add our dropoffs to this path array list, because
as you can see here, we have this model path, which is one custom path.
And as I said, I want to keep those paths consistently on the screen and therefore I need to store
them somewhere and then I can draw them.
So the three steps are pretty simple, actually.
We need to go to the point where we are releasing our screen.
So action up.
And here we just say, OK.
At to drop us to our paths.
And drop half.
And then finally draw it and where would we draw it?
Well, in our.
On draw, so here, just before the if statement, I'm going to add a follow up and this follow up is
going to go through all of the past that we have.
So for.
Perth in paths.
I want to do the same thing as we did here, where we set the brush thickness and to paint, but now
I don't want to do it depending on the bottom drop half.
But the path that I just created, which is of type and drop half anyways.
Right.
But this path in my path of that, I want to have the brush thickness because it might change.
Right.
That might be different for every single path that we store, because later on we also want to be able
to change the brush thickness at the same goes for the color.
So I don't want to use to drop half color, but I want to use the path color.
So the color of the D'Andre path that we're currently looking at.
And then, of course, we need to draw that, so.
Let's draw all of those paths, and in this case, the path name was Path.
And that is it.
So let's run it again.
Let's see if our drawing is going to stay on the screen so that we are.
And as you can see.
I can draw stuff now, and even though I released a screen or at least a click, the drawing is still
there.
So you can see now you can have this little drawing up, so this is already a pretty cool starting point.
This is already a useful episode to see, even though, of course, we cannot change the color, we
cannot export it.
We cannot change the thickness of the brush.
All those kind of things will be added later on.
But for now, you can already see that this app is useful to a certain degree.
So you can already play around with it on the phone, your phone and yes, share with your friends.
And I hope the 40 minute wait to get here was worth it, because from now on it's going to be a lot
easier and we're going to add features just like that.
All right.
So see you in the next video.