Skip to content

Commit 8bdcdec

Browse files
committed
Allow floating button to cover camera hole cutout (fix for Android below 12)
#453
1 parent 86cc099 commit 8bdcdec

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/src/main/java/com/github/cvzi/screenshottile/services/ScreenshotAccessibilityService.kt

+5-2
Original file line numberDiff line numberDiff line change
@@ -515,9 +515,12 @@ class ScreenshotAccessibilityService : AccessibilityService() {
515515
this.x = x
516516
this.y = y
517517
// Allow the floating button to cover the camera notch/cutout
518-
layoutInDisplayCutoutMode =
518+
flags = flags or WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
519+
layoutInDisplayCutoutMode = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
520+
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
521+
} else {
519522
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
520-
523+
}
521524
}
522525
}
523526

0 commit comments

Comments
 (0)