Created
February 12, 2016 14:37
-
-
Save GlebMaltsev/e882d16a09183b59ba21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | |
super.onMeasure(widthMeasureSpec, heightMeasureSpec); | |
int width = getMeasuredWidth(); | |
int height = getMeasuredHeight(); | |
int measureSpec = keepAspectRatioByHeight ? height : width; | |
// ViewGroup.LayoutParams params = this.getLayoutParams(); | |
// params.height = measureSpec; | |
// params.width = measureSpec; | |
// this.setLayoutParams(params); | |
setMeasuredDimension(measureSpec, measureSpec); | |
// int measureSpec = keepAspectRatioByHeight ? heightMeasureSpec : widthMeasureSpec; | |
// super.onMeasure(measureSpec, measureSpec); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment