minor fix
This commit is contained in:
parent
011bb7ea86
commit
822b2c859a
1 changed files with 4 additions and 8 deletions
|
@ -58,18 +58,14 @@ class ActivityWindowHandler(private val activity: Activity) : WindowHandler(acti
|
||||||
} else {
|
} else {
|
||||||
activity.window.decorView.rootWindowInsets.displayCutout
|
activity.window.decorView.rootWindowInsets.displayCutout
|
||||||
}
|
}
|
||||||
if (cutout == null) {
|
|
||||||
result.error("getCutoutInsets-null", "cutout insets are null", null)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
val density = activity.resources.displayMetrics.density
|
val density = activity.resources.displayMetrics.density
|
||||||
result.success(
|
result.success(
|
||||||
hashMapOf(
|
hashMapOf(
|
||||||
"left" to cutout.safeInsetLeft / density,
|
"left" to (cutout?.safeInsetLeft ?: 0) / density,
|
||||||
"top" to cutout.safeInsetTop / density,
|
"top" to (cutout?.safeInsetTop ?: 0) / density,
|
||||||
"right" to cutout.safeInsetRight / density,
|
"right" to (cutout?.safeInsetRight ?: 0) / density,
|
||||||
"bottom" to cutout.safeInsetBottom / density,
|
"bottom" to (cutout?.safeInsetBottom ?: 0) / density,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue