summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Elkouby <streetwalrus@codewalr.us>2016-01-23 14:28:01 +0200
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-01-25 09:53:16 -0800
commitdecec0509eac5b815cb8595325d348f26ab417fa (patch)
tree81292693a0502d63369a2c5842c1273c9a477c07
parenta3b29b6a943d1df96a7a4c41d0578b28253a9454 (diff)
downloadframeworks_base-decec0509eac5b815cb8595325d348f26ab417fa.zip
frameworks_base-decec0509eac5b815cb8595325d348f26ab417fa.tar.gz
frameworks_base-decec0509eac5b815cb8595325d348f26ab417fa.tar.bz2
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
-rw-r--r--core/java/android/util/DisplayMetrics.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/util/DisplayMetrics.java b/core/java/android/util/DisplayMetrics.java
index 2b654ad..ee959e2 100644
--- a/core/java/android/util/DisplayMetrics.java
+++ b/core/java/android/util/DisplayMetrics.java
@@ -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);
}