Created
May 31, 2012 07:13
-
-
Save scompt/2841608 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
public final void onMeasure(final int widthMeasureSpec, | |
final int heightMeasureSpec) { | |
int mode = View.MeasureSpec.getMode(widthMeasureSpec); | |
int width = View.MeasureSpec.getSize(widthMeasureSpec); | |
int height = (int) (width / aspect.ratio); | |
int heightSpec = MeasureSpec.makeMeasureSpec(height, mode); | |
super.onMeasure(widthMeasureSpec, heightSpec); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment