Support @left marker am: 21cc2e5f7d

Change-Id: I55bc7ee5b21dd5cf34da5944c7fad8169a34ca6d
This commit is contained in:
Automerger Merge Worker
2019-12-20 22:06:01 +00:00
2 changed files with 7 additions and 1 deletions

View File

@@ -66,6 +66,7 @@ public final class DisplayCutout {
private static final String BOTTOM_MARKER = "@bottom";
private static final String DP_MARKER = "@dp";
private static final String RIGHT_MARKER = "@right";
private static final String LEFT_MARKER = "@left";
/**
* Category for overlays that allow emulating a display cutout on devices that don't have
@@ -642,6 +643,9 @@ public final class DisplayCutout {
if (spec.endsWith(RIGHT_MARKER)) {
offsetX = displayWidth;
spec = spec.substring(0, spec.length() - RIGHT_MARKER.length()).trim();
} else if (spec.endsWith(LEFT_MARKER)) {
offsetX = 0;
spec = spec.substring(0, spec.length() - LEFT_MARKER.length()).trim();
} else {
offsetX = displayWidth / 2f;
}