All right, so let's get to the final dialogue that I want to look at in this section, and that's the
custom progress dialogue function, and that is the function that I'm using in order to create this
custom progress dialogue, which is this progress here.
And it's a custom one.
So there was one back in the day that you could automatically use an android, but now there is well,
it's deprecated.
So you need to have a little around here and that's what we're doing.
So I'm going to show you how to create this thing because we are going to need it for our application
when we have a background process which needs to run and we don't want to use it to do anything while
that happens.
So in this case, it's a very short one because we can at any time cancel it.
But let's get a look at how we can build this thing.
So first of all, I have this little function and it's called once I click on this button here, which
is this button custom progress dialogue.
So once we click on it, I call this function custom progress, dialogue function.
And you could, of course, call this one custom progress, dialogue, view or appearance or something
like that.
But basically what it does is it creates a dialogue.
All right.
And I call this one custom progress dialogue.
But here I set the content for you to be our layout dialogue, custom progress.
So what is this dialogue, custom progress?
Well, it's another layout file and it's another one that I created myself.
So you can create this as you like.
It has to, of course, fit in the screen.
But other than that, you can create whatever you want.
What of course, makes sense is to have a progress bar.
So maybe you want to have a progress bar, which the user needs to see in order to see how far the progress
is.
I mean, how far the download, for example, has done or how far the upload is and how far the user
is with whatever process he wants to finish.
And then you can use a progress bar and the progress bars are pretty cool feature.
They have a bunch of cool properties here that you can assign a juice.
But if you want to know more about progress bars, then I would really recommend to check out the progress
bar documentation.
For example, if you want to set the progress director, you can set it here to 25 percent, for example,
and so forth.
So you have a bunch of options that you can play around with.
As you can see, it's a very long class once again.
So a bunch of different attributes that you can look at and so forth.
All right.
OK, so let's get back to the code that we have, the progress bar, which is this little icon here.
Let me make it a lot bigger so you can see it, this icon that we're constantly move around because
we're not controlling it otherwise.
And we just wanted to move like that.
And then we have this TextView which says, please wait, OK, this TextView is in black.
It's 16 USB.
But what's interesting here is that it's within a linear layout where I have the gravity, the center.
So the two are next to each other because the orientation is set to horizontal.
So that's why the two are just perfectly next to each other and to progress.
Bar has a margin end which means and margin to towards the right, which gives it some space to this
please.
White text.
OK, so that's basically the XML file.
And as I said, you can customize it as you like and then the only thing we do is we say custom progress,
dialogue that show.
So we're just showing that dialogue and dialogues.
They.
I have, of course, some other options, as we saw before, so you can adjust it as you please.
But in our case, when we click on it.
It just appears in the middle and then I can click it away, but you can, of course, force it not
to get away or go away once we click on it.
But most of the times he will use that for something super short because you don't want to freeze the
UI for a long period of time.
That should be something that can happen within half a second or second.
So it's best if the user can't even read whatever the text here is.
So that's how short this dialogue should be.
This progress dialogues in the context of dialogues.
I can highly recommend to check out the documentation here and especially guides, because you can see
there are a bunch of guides here and one of them is for dialogue.
So if you want to know more about how to create a custom dialogue, this is the place to go, because
here you have a bunch of code examples of layout examples, which I really like.
And yeah, you have the current code, you directly so you can copy it and use it for yourself, can
see how you can positive, negative and neutral buttons and kind of lists and so forth.
So a bunch of options, pretty cool stuff.
You can design it as you like.
And here is the documentation that can really help you out.
And of course, it's not the only thing that you can find here, not only dialogues, but you can find
guides here on a lot of different topics.
Some are better than others.
And yeah, I would definitely recommend to check out the documentation every now and then in order to
get a better understanding of what is going on.
Something that I really like is, for example, drag and drop, because drag and drop is a cool feature
and apps and it feels good.
So you could, of course, check out the documentation on that, even though we're not using drag and
drop in our applications yet.
But that's not to hold you back because it's really your own experience.
You should make this course your very own experience.
And part of it is to learn stuff around the course and not just the core stuff itself, because, of
course, content itself is great.
And I really put a lot of effort into creating a great course.
But of course, I cannot cover everything.
And that's not even necessary because there are a bunch of guides which are amazing here in the documentation.
All right.
So I'd say that's enough for now.
Good luck with the guides that you find here.
If you find something super duper useful and you want to share it, of course, please share it with
the other students and yes, you in the next video.