Loading core/java/android/view/DisplayCutout.java +4 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -647,6 +648,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; } Loading core/res/res/values/config.xml +3 −1 Original line number Diff line number Diff line Loading @@ -3126,7 +3126,9 @@ The path is assumed to be specified in display coordinates with pixel units and in the display's native orientation, with the origin of the coordinate system at the center top of the display. center top of the display. Optionally, you can append either `@left` or `@right` to the end of the path string, in order to change the path origin to either the top left, or top right of the display. To facilitate writing device-independent emulation overlays, the marker `@dp` can be appended after the path string to interpret coordinates in dp instead of px units. Loading Loading
core/java/android/view/DisplayCutout.java +4 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -647,6 +648,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; } Loading
core/res/res/values/config.xml +3 −1 Original line number Diff line number Diff line Loading @@ -3126,7 +3126,9 @@ The path is assumed to be specified in display coordinates with pixel units and in the display's native orientation, with the origin of the coordinate system at the center top of the display. center top of the display. Optionally, you can append either `@left` or `@right` to the end of the path string, in order to change the path origin to either the top left, or top right of the display. To facilitate writing device-independent emulation overlays, the marker `@dp` can be appended after the path string to interpret coordinates in dp instead of px units. Loading