@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
if (isHintEnabled && editText != null) {
final Rect rect = tempRect;
ViewGroupUtils.getDescendantRect(this, editText, rect);
final int l = rect.left + editText.getCompoundPaddingLeft();
final int r = rect.right - editText.getCompoundPaddingRight();
collapsingTextHelper.setExpandedBounds(
l, rect.top + editText.getCompoundPaddingTop(),
r, rect.bottom - editText.getCompoundPaddingBottom());
collapsingTextHelper.setCollapsedBounds(l, getPaddingTop(),
r, bottom - top - getPaddingBottom());
collapsingTextHelper.recalculate();
}
}