Advertisement
English transcript
To build the desired layout, the image actually goes edge to edge, so
let's get rid of this padding that we have on the parent view.
Cool, now the image goes edge to edge.
Let's fix the text down here.
We mentioned that we want 16 dp of padding all around the edges here.
Okay, well, I tried to add 16 dp of padding to this TextView, but
we originally wanted only 8 dp of padding here.
So we should break this out into individual values and
set the bottom padding to be 8 dp.
Okay, now we have top, left, and right padding equal to 16 dp, but
the bottom padding of this TextView is 8 dp.
Cool, so now this last text you should also get 16 dp of padding.
But wait, now that increases the amount of space in between the two TextViews.
Let's also add 16 dp of padding to this last TextView.
This makes the left and bottom and right spacing correct.
But now there's too much space in between the two TextViews, so
let's break this out into individual values.
And we'll stop right there because we don't want any top padding on this view.
The correct spacing is coming from the bottom padding of this
TextView above it.
Cool, so that looks correct.
The only thing that's missing now is the fact that we need to get rid of this
white space here.
We don't need a bottom margin on this ImageView, so let's delete it.
Great work, we finished building this layout.
let's get rid of this padding that we have on the parent view.
Cool, now the image goes edge to edge.
Let's fix the text down here.
We mentioned that we want 16 dp of padding all around the edges here.
Okay, well, I tried to add 16 dp of padding to this TextView, but
we originally wanted only 8 dp of padding here.
So we should break this out into individual values and
set the bottom padding to be 8 dp.
Okay, now we have top, left, and right padding equal to 16 dp, but
the bottom padding of this TextView is 8 dp.
Cool, so now this last text you should also get 16 dp of padding.
But wait, now that increases the amount of space in between the two TextViews.
Let's also add 16 dp of padding to this last TextView.
This makes the left and bottom and right spacing correct.
But now there's too much space in between the two TextViews, so
let's break this out into individual values.
And we'll stop right there because we don't want any top padding on this view.
The correct spacing is coming from the bottom padding of this
TextView above it.
Cool, so that looks correct.
The only thing that's missing now is the fact that we need to get rid of this
white space here.
We don't need a bottom margin on this ImageView, so let's delete it.
Great work, we finished building this layout.