ViewHolder vh = (ViewHolder) viewHolder;
onBindDescription(vh, item);
boolean hasTitle = true;
if (TextUtils.isEmpty(vh.mTitle.getText())) {
vh.mTitle.setVisibility(View.GONE);
hasTitle = false;
} else {
vh.mTitle.setVisibility(View.VISIBLE);
vh.mTitle.setLineSpacing(vh.mTitleLineSpacing - vh.mTitle.getLineHeight() +
vh.mTitle.getLineSpacingExtra(), vh.mTitle.getLineSpacingMultiplier());
}
setTopMargin(vh.mTitle, vh.mTitleMargin);
boolean hasSubtitle = true;
if (TextUtils.isEmpty(vh.mSubtitle.getText())) {
vh.mSubtitle.setVisibility(View.GONE);
hasSubtitle = false;
} else {
vh.mSubtitle.setVisibility(View.VISIBLE);
if (hasTitle) {
setTopMargin(vh.mSubtitle, vh.mUnderTitleBaselineMargin +
vh.mSubtitleFontMetricsInt.ascent - vh.mTitleFontMetricsInt.descent);
} else {
setTopMargin(vh.mSubtitle, 0);
}
}
if (TextUtils.isEmpty(vh.mBody.getText())) {
vh.mBody.setVisibility(View.GONE);
} else {
vh.mBody.setVisibility(View.VISIBLE);
vh.mBody.setLineSpacing(vh.mBodyLineSpacing - vh.mBody.getLineHeight() +
vh.mBody.getLineSpacingExtra(), vh.mBody.getLineSpacingMultiplier());
if (hasSubtitle) {
setTopMargin(vh.mBody, vh.mUnderSubtitleBaselineMargin +
vh.mBodyFontMetricsInt.ascent - vh.mSubtitleFontMetricsInt.descent);
} else if (hasTitle) {
setTopMargin(vh.mBody, vh.mUnderTitleBaselineMargin +
vh.mBodyFontMetricsInt.ascent - vh.mTitleFontMetricsInt.descent);
} else {
setTopMargin(vh.mBody, 0);
}
}