Welcome back and this video.
Our goal is to create this UI here, this XML file, and of course, we also need a new activity, which
is going to be the result activity.
So this is what should be displayed in the result activity.
And for now, the goal is just to create that and also to have a variable which knows how many answers
we had, correct or how many correct answers we selected.
And yeah, that's pretty much it for this video.
So if you want, you can of course, try to build that yourself so you can post a video and just go
ahead and try to build that UI.
You will, of course, need to have the image you can download from the lecture and then.
Yeah, good luck with it.
All right.
Otherwise, of course, I will show you how to do it.
So let's go ahead and create a new activity here.
Which will be an empty activity and I'm going to call this one result activity.
Once it's ready, let's go to the manifest and adjust the activity accordingly.
So I want to have the no action bar theme and also the poetry orientation for my result activities.
So I'm just going to add that here.
And then we can go back to our quiz questions activity, because here what we needed is a variable which
knows how many times we have answered correctly.
So let's create one private var and correct answers.
It's going to be an integer and which is going to be set to zero at the start.
And when do we want to increase that value?
Well, each time that we assign the green button as the option.
So each time that we had a correct answer here.
So pretty much we had this statement where we checked, if we were incorrect and if we weren't incorrect,
then we can improve Cresta correct answers by one.
So we are inside of our own click function here for the submit button when we had the.
Correct answer check here.
And if it was correct, then we increased by one, so pretty much what we say, if it wasn't incorrect,
then we increased by one.
Now, this video, because we have already created so many different eyes, I'm just going to keep it
super simple, so I'm just going to paste it in here and I will talk over what the activity result amount
looks like.
So what we have is a linear layout.
And it matches the parent in both directions, so with and heart and has a certain background, which
is our drawable I CBG.
Then it's centered horizontally, the orientation itself is vertical, so things are put on top of each
other.
We have the padding of 20 DPI, so a little bit of putting in all directions and then.
We have a text here saying result, which is bold and has a text size of 25 Hespe, it's white text.
The margin towards top is 25.
So it's not all the way up, all the way at the top.
So that's the idea behind it.
And then there is one very important part missing, and that is this image of you here.
So you can see I need this.
I see trophy.
So what you can do is, of course, you can download it from the resources.
And go over to your projects, to your resources folder, drawable have been pasted in there and once
we pasted in there.
We can see that it appears here, so in this case, the device that is by default used here is this
pixel and my case.
All right.
So this is how it's gonna look like in the pixel.
That's why I only have the eyes.
This I see trophy PMG, which is the size my DP.
But if you want to have all the different sizes for the different screen sizes, so to speak, then
you should of course import the whole folder.
As you can see, there are different sizes here.
The low density pixels, medium high, extra high extra extra height and extra extra high.
So it's going to adjust accordingly to the screen size if you have all of those in there.
In my case, I just kept it simple for this video.
So I'm just using the ICC trophy PNG.
But otherwise, of course, import the whole folder here so that it looks fine on different screen sizes.
So, for example, if I now go over to this screen size, you can see it's pushed towards the top a
little bit because the image is not that big.
All right.
So it really depends on the screen size that you look at.
All right, so that's our image.
And as you can see, the content we have, the content description of image, and then underneath we
have a little text.
You say congratulations and it says, hey, congratulations.
Which is why 25 espie bold text, so it's this one here, then we have the username, which is another
text view.
You can see it's not as big as 20 to Espie has the same margin towards the top.
Also Reps content in both directions than with the text view, which says your score is nine out of
ten.
And it's important that this one has an ID so that we can override it and it has less margin, as you
can see here.
So the margin is not as big as it was here.
And then the button finally, which also has a margin of ten.
So it's this one here towards the top.
So they are equally far apart from each other.
Those three elements, each tenth density pixels.
And then TechStars is eighteen and the textile is bold.
And the difference here, as you can see, is the background is white and the color of the text is,
in this case, this purple color, which is our color primary.
So if we change the color primary, that color will change as well.
All right, and to the next video, we are going to finalize this whole thing, so we're going to add
some more features that will then finally allow us to get over to the screen because the screen needs
to know how many answers we had correctly and so forth.
So we need to put this information over to this result activity.
All right.
So see you in the next one.