We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
public class DisplayUtil {
static { DisplayMetrics displayMetrics = Resources.getSystem().getDisplayMetrics(); density = displayMetrics.density; scaledDensity = displayMetrics.scaledDensity; } private static float density; private static float scaledDensity; public static int px2dip(float px){ return (int) (px/density + 0.5f); } public static float dip2px(float dp){ return dp*density; } public static int px2sp(float px){ return (int) (px/scaledDensity + 0.5f); } public static float sp2px(float sp){ return sp*scaledDensity; }
}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
public class DisplayUtil {
}
The text was updated successfully, but these errors were encountered: