Пример #1
0
 public static void resetDensity(Context context) {
   if (context != null && null != context.getResources()) {
     DisplayMetrics metrics = context.getResources().getDisplayMetrics();
     sDensity = metrics.density;
     sFontDensity = metrics.scaledDensity;
     sWidthPixels = metrics.widthPixels;
     sHeightPixels = metrics.heightPixels;
     if (DeviceUtils.isTablet(context)) {
       sStatusHeight = getTabletScreenHeight(context) - sHeightPixels;
     }
     final ViewConfiguration configuration = ViewConfiguration.get(context);
     if (null != configuration) {
       sTouchSlop = configuration.getScaledTouchSlop();
     }
     // Log.i("test",">>>>>>>>sDensity = "+sDensity+",sWidthPixels =
     // "+sWidthPixels+",sHeightPixels="+sHeightPixels+",sStatusHeight = "+sStatusHeight+",dpi =
     // "+sDensity*160);
     // Configuration conf = context.getResources().getConfiguration();
     // Log.i("test",
     // ">>conf.screenWidthDp = "+conf.screenWidthDp+",conf.screenHeightDp =
     // "+conf.screenHeightDp);
   }
 }