Skip to content

Instantly share code, notes, and snippets.

@quiro91
Created January 19, 2017 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quiro91/fc24c6ce11ec12526bd39d9fa1a68c9c to your computer and use it in GitHub Desktop.
Save quiro91/fc24c6ce11ec12526bd39d9fa1a68c9c to your computer and use it in GitHub Desktop.
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
Log.v("Chart onMeasure w", MeasureSpec.toString(widthMeasureSpec));
Log.v("Chart onMeasure h", MeasureSpec.toString(heightMeasureSpec));
int desiredWidth = getSuggestedMinimumWidth() + getPaddingLeft() + getPaddingRight();
int desiredHeight = getSuggestedMinimumHeight() + getPaddingTop() + getPaddingBottom();
setMeasuredDimension(measureDimension(desiredWidth, widthMeasureSpec),
measureDimension(desiredHeight, heightMeasureSpec));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment