@Test public void screenWidthAsIntDips_shouldReturnTheWidthAsDips() throws Exception { assertThat(Dips.screenWidthAsIntDips(activity)).isEqualTo(240); }
public static int screenWidthAsIntDips(@NonNull Context context) { Preconditions.checkNotNull(context); return pixelsToIntDips(context.getResources().getDisplayMetrics().widthPixels, context); }
Dips { public static int screenWidthAsIntDips(@NonNull Context context) { Preconditions.checkNotNull(context); return pixelsToIntDips(context.getResources().getDisplayMetrics().widthPixels, context); } }
Dips { public static int screenWidthAsIntDips(@NonNull Context context) { Preconditions.checkNotNull(context); return pixelsToIntDips(context.getResources().getDisplayMetrics().widthPixels, context); }  }
Dips { public static int screenWidthAsIntDips(@NonNull Context context) { Preconditions.checkNotNull(context); return pixelsToIntDips(context.getResources().getDisplayMetrics().widthPixels, context); }  static float pixelsToFloatDips(final float pixels, final Context context); static int pixelsToIntDips(final float pixels, final Context context); static float dipsToFloatPixels(final float dips, final Context context); static int dipsToIntPixels(final float dips, final Context context); static float asFloatPixels(float dips, Context context); static int asIntPixels(float dips, Context context); static int screenWidthAsIntDips(@NonNull Context context); static int screenHeightAsIntDips(@NonNull Context context); }
Dips { public static int screenWidthAsIntDips(@NonNull Context context) { Preconditions.checkNotNull(context); return pixelsToIntDips(context.getResources().getDisplayMetrics().widthPixels, context); }  static float pixelsToFloatDips(final float pixels, final Context context); static int pixelsToIntDips(final float pixels, final Context context); static float dipsToFloatPixels(final float dips, final Context context); static int dipsToIntPixels(final float dips, final Context context); static float asFloatPixels(float dips, Context context); static int asIntPixels(float dips, Context context); static int screenWidthAsIntDips(@NonNull Context context); static int screenHeightAsIntDips(@NonNull Context context);  }