Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timob-14359: Android: First TableViewRow is cut off #4708

Merged
merged 2 commits into from
Oct 2, 2013
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)

// If there is a child view, we don't set a minimum height for the row.
// Otherwise, we set a minimum height.
if (((TableViewRowProxy) item.proxy).hasControls()) {
boolean hasChildView = ((TableViewRowProxy) item.proxy).hasControls();
if (hasChildView) {
content.setMinimumHeight(0);
} else {
content.setMinimumHeight(48);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also take this opportunity to move '48' out as a constant.

Expand All @@ -500,7 +501,9 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
} else {
h = Math.max(minRowHeight, height.getAsPixels(this));
}
content.getLayoutParams().height = h;
if (hasChildView) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens when there's no child?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No child means we will use the minimum height 48, so we don't need to force any height in that case.

content.getLayoutParams().height = h;
}

if (Log.isDebugModeEnabled()) {
Log.d(TAG, "Row content measure (" + adjustedWidth + "x" + h + ")", Log.DEBUG_MODE);
Expand Down