Java Code Examples for android.util.DisplayMetrics#DENSITY_400
The following examples show how to use
android.util.DisplayMetrics#DENSITY_400 .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EasyDisplayMod.java From easydeviceinfo with Apache License 2.0 | 5 votes |
/** * Gets density. * * @return the density */ public final String getDensity() { String densityStr = null; final int density = context.getResources().getDisplayMetrics().densityDpi; switch (density) { case DisplayMetrics.DENSITY_LOW: densityStr = "LDPI"; break; case DisplayMetrics.DENSITY_MEDIUM: densityStr = "MDPI"; break; case DisplayMetrics.DENSITY_TV: densityStr = "TVDPI"; break; case DisplayMetrics.DENSITY_HIGH: densityStr = "HDPI"; break; case DisplayMetrics.DENSITY_XHIGH: densityStr = "XHDPI"; break; case DisplayMetrics.DENSITY_400: densityStr = "XMHDPI"; break; case DisplayMetrics.DENSITY_XXHIGH: densityStr = "XXHDPI"; break; case DisplayMetrics.DENSITY_XXXHIGH: densityStr = "XXXHDPI"; break; default: //do nothing break; } return CheckValidityUtil.checkValidData(densityStr); }
Example 2
Source File: EmailDeviceInfoLens.java From telescope with Apache License 2.0 | 5 votes |
public static String getDensityString(DisplayMetrics displayMetrics) { switch (displayMetrics.densityDpi) { case DisplayMetrics.DENSITY_LOW: return "ldpi"; case DisplayMetrics.DENSITY_MEDIUM: return "mdpi"; case DisplayMetrics.DENSITY_TV: return "tvdpi"; case DisplayMetrics.DENSITY_HIGH: return "hdpi"; case DisplayMetrics.DENSITY_260: case DisplayMetrics.DENSITY_280: case DisplayMetrics.DENSITY_300: case DisplayMetrics.DENSITY_XHIGH: return "xhdpi"; case DisplayMetrics.DENSITY_340: case DisplayMetrics.DENSITY_360: case DisplayMetrics.DENSITY_400: case DisplayMetrics.DENSITY_420: case DisplayMetrics.DENSITY_XXHIGH: return "xxhdpi"; case DisplayMetrics.DENSITY_560: case DisplayMetrics.DENSITY_XXXHIGH: return "xxxhdpi"; default: return "unknown"; } }