Slide 29
Slide 29 text
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int widthConstraints = getPaddingLeft() + getPaddingRight();
int heightConstraints = getPaddingTop() + getPaddingBottom();
// Measure the thumbnail.
measureChildWithMargins(
mThumbnailView,
widthMeasureSpec,
widthConstraints,
heightMeasureSpec,
heightConstraints);
widthConstraints += mThumbnailView.getMeasuredWidth();
// Measure the title.
measureChildWithMargins(
mTitleView,
widthMeasureSpec,
widthConstraints,
heightMeasureSpec,
heightConstraints);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23