/** * If {@link #setScaledDensity(float)} has been called, {@link DisplayMetrics#scaledDensity} will * be modified to reflect the value specified. Note that this is not a realistic state. * * @deprecated This behavior is deprecated and will be removed in Robolectric 3.7. */ @Deprecated @Implementation protected void getRealMetrics(DisplayMetrics outMetrics) { if (isJB()) { getMetrics(outMetrics); outMetrics.widthPixels = realWidth; outMetrics.heightPixels = realHeight; } else { directlyOn(realObject, Display.class).getRealMetrics(outMetrics); if (scaledDensity != null) { outMetrics.scaledDensity = scaledDensity; } } }
@Implementation public void getRealMetrics(DisplayMetrics outMetrics) { getMetrics(outMetrics); outMetrics.widthPixels = realWidth; outMetrics.heightPixels = realHeight; }
@Implementation public void getRealMetrics(DisplayMetrics outMetrics) { getMetrics(outMetrics); outMetrics.widthPixels = realWidth; outMetrics.heightPixels = realHeight; }
@Implementation public void getRealMetrics(DisplayMetrics outMetrics) { getMetrics(outMetrics); outMetrics.widthPixels = realWidth; outMetrics.heightPixels = realHeight; }
/** * If {@link #setScaledDensity(float)} has been called, {@link DisplayMetrics#scaledDensity} will * be modified to reflect the value specified. Note that this is not a realistic state. * * @deprecated This behavior is deprecated and will be removed in Robolectric 3.7. */ @Deprecated @Implementation protected void getRealMetrics(DisplayMetrics outMetrics) { if (isJB()) { getMetrics(outMetrics); outMetrics.widthPixels = realWidth; outMetrics.heightPixels = realHeight; } else { directlyOn(realObject, Display.class).getRealMetrics(outMetrics); if (scaledDensity != null) { outMetrics.scaledDensity = scaledDensity; } } }