Skip to content

Commit

Permalink
Added gap on LogDetailItem
Browse files Browse the repository at this point in the history
The text for the question and the ratio on LogDetailItem was running together in some cases. Specifically whenever it was a really long vocabulary word. So I made a quick tweak that forced an 8dp gap between these two items. This is specifically designed to work when used in conjunction with the auto size feature. If it's disabled, there's nothing I can really do. But I don't disable it, so it's not an issue.
  • Loading branch information
theblackwidower committed Feb 4, 2019
1 parent d03e81e commit 4e8c668
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)

private int desiredWidth()
{
return Math.round((Math.max(questionWidth + correctWidth, totalWidth + percentageWidth) * 2) + slashWidth) +
getPaddingLeft() + getPaddingRight();
return Math.round((Math.max(questionWidth + correctWidth +
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics()),
totalWidth + percentageWidth) * 2) + slashWidth) + getPaddingLeft() + getPaddingRight();
}

private static int calculateSize(int measureSpec, int desired)
Expand Down

0 comments on commit 4e8c668

Please sign in to comment.