Hello, my friends, and welcome back.
Let's create the project and design the layouts.
Open Android Studio.
Select Empty Views activity.
I will name it as Planets app.
Click finish.
I'll start creating the layout of the list item.
I'll create a new layout resource file and I'll name it as item underscore list layout go split mode.
And this file, this layout file will contain two text views and one image view with height as RGB content.
Because I need to wrap the content of the items.
I'll start with the image view.
And this is our image view.
I'll drag and drop it.
I'll add the constraints to the parent or you can add directly margin 16.
Also, I'll add this constraint for the button and this is our image view 16 DPI from top left and bottom,
let's create our text views one for the planet name and one for the moon Descriptions of this planet.
How many moons does this planet has?
Wrap Content.
Wrap content.
Add the constraints for this text view.
Add 16 DPI from the top and or the start will be 16 DPI.
Another text view.
And I'll constrain it under this planet.
Name.
And this is our layout.
This is acting as a template for our items of the list.
View one, image, view and two text view.
Let's move to the main activity layout file.
Remove this text view and replace it with the view.
And here infer the constraints.
Just click on this button, infer constraints and it will fill the parent layout width and height.