Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit decec050 authored by Dan Elkouby's avatar Dan Elkouby Committed by Gerrit Code Review
Browse files

DisplayMetrics: set noncompat DPI as well

A lot of UI elements (especially Holo, but also Material toggles) appear
visually broken when the noncompat scale doesn't match the regular
scale.

Change-Id: I76013e4d0fce7accac1cb6b85121c94fab5872ea
parent a3b29b6a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -251,6 +251,12 @@ public class DisplayMetrics {
        xdpi = inDensity;
        ydpi = inDensity;

        noncompatDensity = density;
        noncompatDensityDpi = densityDpi;
        noncompatScaledDensity = scaledDensity;
        noncompatXdpi = xdpi;
        noncompatYdpi = ydpi;

        DENSITY_DEVICE = inDensity;
        Bitmap.setDefaultDensity(inDensity);
    }