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 perf.
And now I'm making this ArrayList and immutable ArrayList, that is just a 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 ArrayList, so
to speak.
Okay, now the next thing we need to do is we need to add our drop offs to this path.
I already list because as you can see here, we have this drop 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 you just say, OK.
At to drop us to our empaths.
And drop have.
And then finally draw it, and where would we draw it?
Well, in our.
On draw, so here just before this statement, I'm going to add a photo and this up is going to go through
all of the past that we have.
So for.
Path in and 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 draw path.
But the path that I just created, which is of type and drop earth anyways, right?
But this path in my empaths of that, I want to have the brush thickness because it might change, right?
It might be different for every single path that we store because later on, we also want to be able
to change the brush thickness.
And 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 tendra 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 paths name was path.
And that is it.
So let's run us again.
Let's see if our drawing is going to stay on the screen.
So there 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 fly, on your phone and 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.