Welcome back in the next couple of videos, we are going to set up a little progression bar here at
the bottom, which allows us to see at which exercise we currently are.
And this is something that I want to do dynamically, so it shouldn't be something we have to manually
change.
If we want to change the amount of exercises that we have, it should really be done dynamically.
So what we're going to use for that is going to be a recycler of view.
And that's why we looked at recycler views because they are great to basically have lists, right,
and display lists.
So in order to work with it, I will need to prepare it, OK, and therefore I'm going to have a new
XML file as well as I will need to make a change to my activity exercise example.
So let's first of all, look at how one particular item is going to look like.
OK, so I'm going to call this one item X or size status.
OK?
And item exercise status will not be a constraint layout, but it will just have a text view in it.
OK, so text view like so.
And this text view will need to use namespaces because here Aksum L and S Android, which will be HTP
and then the rest.
Android this one here and then we will need another namespace and put it into a different line.
And by the way, it's close to text you like so.
And we need to add the tools namespace here.
And a width and height, so I'm going to set that to 25 dpi.
I'm going to give it an idea of text view item.
I'm going to add a little bit of margin of one density pixels towards all directions.
I will create a background, which will be a draw bill.
So let me create this trouble.
Create resource file.
Now, let's look at what is this, this is just going to be a shape with a solid.
Content.
OK, and the solid content will just have a color, which will be our.
Primary Gray, I think this colored primary, this gray color.
Yes, and then ah, actually, no, I want to make it lighter.
So let's use something like C4, C4, C4.
All right, which will be this light gray color and the shape should have a shape of oval.
OK, so here shape oval.
And we've seen that multiple times, right?
But that's what I want to have as the background for my individual item.
So an individual item will basically just be a number because we want to know what, which number of
exercises we are.
And currently, if you look at it, we.
Well, let me make sure that my apps are closed because what we have right now is that we don't display
the exercises, we don't know which exercise we're at.
So we're at jumping jacks.
But his jumping jacks, number one, number two, number three, we don't know that.
And we could, of course, also just enter or display the number out of total.
But we're going to add a recycler view, which will make it look a lot nicer.
OK, so now I have the background for my exercise.
I want it to be gravitated, so the content of it to be gravitated, I will have a little bit of padding
so that this circle is going to look a little bigger.
You can see it here.
It's just this circle, and I'm going to have our dark gray color as the text color.
The text size will be 14 S.P. The textile will be bold, and the text that I want to display is going
to be a one.
OK, so you see, this is basically going to be how one individual item is going to look like, and
now they should be next to each other.
So I want to have 12 of these items next to each other.
And usually, how you would use a recycled view is like a list view that you can scroll through, right?
So something that you would use, for example, in, uh, in Facebook or so, right, where you have
this big scroll view.
But you can use recycled views also to display multiple different items next to each other if you want
to do that dynamically, as it is what we want to do.
All right.
Now let's set up a of view in our activity exercise because it should basically be at the very bottom.
So you hear underneath my very bottom frame layout underneath.
This one here, which contains this linear layout inside of it.
I'm going to set up a recycler view, which is this Android X recycler view widget it needs with.
So I'm going to say to say it should be matching the parent and it should only rep the content so it
shouldn't be higher as it requires.
All right, then it will need an ID so that we can access it, and I'm going to call it RV for resect
of you exercise status.
Then it needs to have constraints and margins, so this should actually be an idea.
So at Heidi, like so Harvey exercise status and there's a plus that is missing and then we can go ahead
and add the layout margin towards all directions, which I'm going to set to five density pixels and
then I need to add a constraint.
So top to bottom of the AFL exercise view, so it should be underneath our frame a lay out exercise
view, which is this frame layout here.
So now you will see that we now have this item, which is underneath it.
OK, and then.
It's going to be underneath, but it should also be on top of the parent.
So the bottom should be at the bottom of the parents, so to speak, so bottom at bottom of parent.
Otherwise you saw that it was just disappear.
All right.
So this is how receptive you generally looks like.
And now what the want to happen is that it, of course, will not display it like a recyclable you like
this, but it should be displaying the data in a horizontal fashion.
So right next to each other.
And now we will also need to get rid of this bottom to bottom off, because for our friend Neal, by
the way, for this full exercise view, because otherwise it would overlap so.
Now we should be good to go, even though it doesn't look great here.
But it's all right because it will be fine once we get into the actual application and going to use
it.
OK, so this was just a setup.
Now we can go ahead and use to recycle review and therefore we will need to create an adapter and so
forth.
So let's do that in the next video.