Back to project page OpenFlappyBird.
The source code is released under:
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2014 Dean Wild <dw86@kent.ac.uk> Everyone is permitted to copy and distribute ver...
If you think the Android project OpenFlappyBird listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package uk.co.deanwild.openflappybird.game; /*from w ww . j a va 2 s .com*/ import android.app.Activity; import android.util.DisplayMetrics; public class ScreenSizeHelper { public static float calculateScreenWidth(Activity context, float windowHeight){ DisplayMetrics dm = new DisplayMetrics(); context.getWindowManager().getDefaultDisplay().getMetrics(dm); final int realHeight = dm.heightPixels; final int realWidth = dm.widthPixels; float ratio = (float)realWidth / (float)realHeight; return windowHeight * ratio; } }