parent
cf7455c661
commit
846fc9008c
1 changed files with 2 additions and 1 deletions
|
@ -16,8 +16,9 @@ object SystemWindowInsetsSetter {
|
|||
fun attach(view: View, lifecycleOwner: LifecycleOwner, @WindowInsetsCompat.Type.InsetsType insetType: Int = WindowInsetsCompat.Type.systemBars()) {
|
||||
val listener = view.doOnEachLayout {
|
||||
val insets: Insets? = ViewCompat.getRootWindowInsets(view)?.getInsets(insetType)
|
||||
val canTrustInsets = Build.VERSION.SDK_INT > 29 || (WindowInsetsCompat.Type.ime() and insetType == 0)
|
||||
|
||||
if (Build.VERSION.SDK_INT > 29 && insets != null && !insets.isEmpty()) {
|
||||
if (canTrustInsets && insets != null && !insets.isEmpty()) {
|
||||
view.post {
|
||||
view.setPadding(
|
||||
insets.left,
|
||||
|
|
Loading…
Add table
Reference in a new issue