Welcome back.
And this video, we're going to add this little image button to our user interface so that we can click
on it and then while it will ask us for permission so that we can access photos and media on the device
so that we can then select an image that we want to use as the background.
So for now, I'm not going to allow it.
And we're going to look at permissions in the next video.
But for this video, we just want to add this little layout here.
So I would recommend that you try this yourself.
And just a little tip.
You should use a linear layout to put those two items next to each other.
All right.
So possibly and tried for yourself.
OK, so I hope you tried it.
Therefore, let's go ahead into our activity.
Main example, and of course, we will need this draw.
So I'm just going to.
Paste is dribble in here, you can also just download it.
It's just a little trouble here.
I see a little gallery.
You can, of course, use your very own image here.
So now at the point where we have our image here at the bottom, so the image button, that's where
we need to make the changes.
OK, so we need to make sure that we add a linear layout surrounding it and then this image button can
be inside of it.
So let's go ahead and create a linear layout, and it should take a width of match parent and a height
of rep content, so it should only take as much space as it requires.
I'm going to make sure the gravity is towards the center so that the elements inside of it are going
to gravitate towards the center on a horizontal level.
So let's make sure that horizontal is also the orientation because otherwise that wouldn't work.
And now we just need to make sure that this image button.
So at least all of those properties here from the image button are now going to be the constrained properties
of the linear layout because our image button will be inside of the linear layout.
So let's cut it out from there.
And let's put it inside of the linear layout.
Now this linear layout needs an ID as well, and I'm going to call this one l l underscore action buttons
because there are beautiful action buttons.
Now, accordingly, of course, we need to make sure that our.
Other linear layout here is on top of the action buttons.
So here, bottom to the top of action buttons for the linear layout that is higher.
OK, now we have our image button, which will be the brush.
And this image button so far is fine.
Now we can go ahead and to just duplicate it.
So just put it on top because we want it to be left.
So this other button, this gallery, but we want it to be on the left of it.
So I'm going to call this one Iby gallery and it's going to use the icy gallery image.
This one here?
OK.
And let's look at the design there.
If this is what we got and you see, we have the two items next to each other, and that is because
we put them into this linear layout.
So image button and other image buttons are both in the linear layout.
They have both the same settings.
You can, of course, play around with those and they are oriented horizontally, which means this image
button is going to be on the left and this image button is going to be on the right and they are gravitating
towards the center so they're not cramped to the left or to the right there in the center.
And that's something we get by using gravity's center here.
All right.
So let's check it out.
And see if it's going to be inside of our user interface, and you could see there is our beautiful
little gallery button.
We can, of course, implement it, but we're not going to do it in this video.
We're going to do it in the next one.
Or at least we're going to look at the permissions first before we can then actually implement them
into our application.
So see you there.