Merge "Fix bug where font size (etc.) doesn't change after changing display settings." into ub-launcher3-rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
77aaa94bc2
@@ -200,7 +200,7 @@ public class InvariantDeviceProfile {
|
|||||||
DefaultDisplay.INSTANCE.get(context).getInfo(),
|
DefaultDisplay.INSTANCE.get(context).getInfo(),
|
||||||
getPredefinedDeviceProfiles(context, gridName));
|
getPredefinedDeviceProfiles(context, gridName));
|
||||||
|
|
||||||
Info myInfo = new Info(display);
|
Info myInfo = new Info(context, display);
|
||||||
DisplayOption myDisplayOption = invDistWeightedInterpolate(
|
DisplayOption myDisplayOption = invDistWeightedInterpolate(
|
||||||
myInfo, getPredefinedDeviceProfiles(context, gridName));
|
myInfo, getPredefinedDeviceProfiles(context, gridName));
|
||||||
|
|
||||||
|
|||||||
@@ -145,10 +145,11 @@ public class DefaultDisplay implements DisplayListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Info(Context context) {
|
private Info(Context context) {
|
||||||
this(context.getSystemService(DisplayManager.class).getDisplay(DEFAULT_DISPLAY));
|
this(context, context.getSystemService(DisplayManager.class)
|
||||||
|
.getDisplay(DEFAULT_DISPLAY));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Info(Display display) {
|
public Info(Context context, Display display) {
|
||||||
id = display.getDisplayId();
|
id = display.getDisplayId();
|
||||||
rotation = display.getRotation();
|
rotation = display.getRotation();
|
||||||
|
|
||||||
@@ -161,8 +162,8 @@ public class DefaultDisplay implements DisplayListener {
|
|||||||
display.getRealSize(realSize);
|
display.getRealSize(realSize);
|
||||||
display.getCurrentSizeRange(smallestSize, largestSize);
|
display.getCurrentSizeRange(smallestSize, largestSize);
|
||||||
|
|
||||||
metrics = new DisplayMetrics();
|
Context defaultDisplayContext = context.createDisplayContext(display);
|
||||||
display.getMetrics(metrics);
|
metrics = defaultDisplayContext.getResources().getDisplayMetrics();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasDifferentSize(Info info) {
|
private boolean hasDifferentSize(Info info) {
|
||||||
|
|||||||
Reference in New Issue
Block a user