Fixed
Status Update
Comments
al...@google.com <al...@google.com>
dy...@gmail.com <dy...@gmail.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 23a7d960caf43390a554700d3c56ada189a9d10e
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Mon Aug 10 15:11:36 2020
IconButton / IconToggleButton API scrub
Test: ./gradlew updateApi
Bug: b/161809385
Bug: b/161807956
Relnote: "Adds enabled parameter to IconButton, and reorders parameters in IconToggleButton"
Change-Id: I0a9419b1a631cadad451395302ad87b7f9214f96
M ui/ui-material/api/current.txt
M ui/ui-material/api/public_plus_experimental_current.txt
M ui/ui-material/api/restricted_current.txt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/IconButton.kt
https://android-review.googlesource.com/1394868
Branch: androidx-master-dev
commit 23a7d960caf43390a554700d3c56ada189a9d10e
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Mon Aug 10 15:11:36 2020
IconButton / IconToggleButton API scrub
Test: ./gradlew updateApi
Bug:
Bug:
Relnote: "Adds enabled parameter to IconButton, and reorders parameters in IconToggleButton"
Change-Id: I0a9419b1a631cadad451395302ad87b7f9214f96
M ui/ui-material/api/current.txt
M ui/ui-material/api/public_plus_experimental_current.txt
M ui/ui-material/api/restricted_current.txt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/IconButton.kt
ca...@google.com <ca...@google.com>
va...@google.com <va...@google.com> #3
insetsControllerCompat = ViewCompat.getWindowInsetsController(
window.decorView.apply {
layoutParams = window.attributes
}
)!!
will prevent the NullPointerException
, but I don't believe it's a completely valid workaround with regards to behavior.
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 7550a7035c72e66977b9709bb67737ff5d0ec4b0
Author: Alex Vanyo <vanyo@google.com>
Date: Thu Feb 24 19:58:16 2022
Revert "Convert WindowInsetsControllerCompat behavior to depend on a View to align behavior"
This reverts commit 0d8eb4081585d1be1997cb097f5fd54b41ddf8bb.
Reason for revert: The approach for constructing the WindowInsetsControllerCompat with just a View doesn't work in Activity.onCreate due to the window flags.
Relnote: "Reverted previous change of relying solely on a View for
WindowInsetsControllerCompat, and again require a Window which is
required for managing some window flags. Deprecated
ViewCompat.getWindowInsetsController in favor of
WindowCompat.getInsetsController to ensure that the correct Window is
used (such as if the View is in a dialog)."
Bug: 219572936
Test: Updated tests
Change-Id: I660aee32108b59516232b41e05b3f05ae2538554
M core/core/api/public_plus_experimental_current.txt
M samples/Support4Demos/src/main/java/com/example/android/supportv4/view/WindowInsetsControllerPlayground.kt
M core/core/src/main/java/androidx/core/view/WindowCompat.java
M compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/theme/Theme.kt
M compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/theme/Theme.kt
M core/core/src/androidTest/java/androidx/core/view/WindowInsetsControllerCompatActivityTest.kt
M compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/theme/Theme.kt
M core/core/api/current.txt
M core/core/src/main/java/androidx/core/view/WindowInsetsControllerCompat.java
M core/core/src/androidTest/java/androidx/core/view/WindowInsetsCompatActivityTest.kt
M core/core/api/restricted_current.txt
M core/core/src/androidTest/java/androidx/core/view/WindowInsetsAnimationCompatActivityTest.kt
M core/core/src/main/java/androidx/core/view/ViewCompat.java
https://android-review.googlesource.com/1999472
Branch: androidx-main
commit 7550a7035c72e66977b9709bb67737ff5d0ec4b0
Author: Alex Vanyo <vanyo@google.com>
Date: Thu Feb 24 19:58:16 2022
Revert "Convert WindowInsetsControllerCompat behavior to depend on a View to align behavior"
This reverts commit 0d8eb4081585d1be1997cb097f5fd54b41ddf8bb.
Reason for revert: The approach for constructing the WindowInsetsControllerCompat with just a View doesn't work in Activity.onCreate due to the window flags.
Relnote: "Reverted previous change of relying solely on a View for
WindowInsetsControllerCompat, and again require a Window which is
required for managing some window flags. Deprecated
ViewCompat.getWindowInsetsController in favor of
WindowCompat.getInsetsController to ensure that the correct Window is
used (such as if the View is in a dialog)."
Bug: 219572936
Test: Updated tests
Change-Id: I660aee32108b59516232b41e05b3f05ae2538554
M core/core/api/public_plus_experimental_current.txt
M samples/Support4Demos/src/main/java/com/example/android/supportv4/view/WindowInsetsControllerPlayground.kt
M core/core/src/main/java/androidx/core/view/WindowCompat.java
M compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/theme/Theme.kt
M compose/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/ui/theme/Theme.kt
M core/core/src/androidTest/java/androidx/core/view/WindowInsetsControllerCompatActivityTest.kt
M compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/ui/theme/Theme.kt
M core/core/api/current.txt
M core/core/src/main/java/androidx/core/view/WindowInsetsControllerCompat.java
M core/core/src/androidTest/java/androidx/core/view/WindowInsetsCompatActivityTest.kt
M core/core/api/restricted_current.txt
M core/core/src/androidTest/java/androidx/core/view/WindowInsetsAnimationCompatActivityTest.kt
M core/core/src/main/java/androidx/core/view/ViewCompat.java
va...@google.com <va...@google.com> #5
Thank you for the report!
I just merged in a change which reverts to using WindowCompat.getInsetsController(window, view)
as the preferred way to get the WindowInsetsControllerCompat
.
This should be released in the next androidx.core
version.
dy...@gmail.com <dy...@gmail.com> #6
Thank you! Looking forward to future changes!
Description
Component used:
androidx.core:core-ktx
Version used:
1.8.0-alpha04
Devices/Android versions reproduced on: Pixel 6 Pro/A13-DP1, Pixel 3XL/A12
Short Description:
Window.getDecorView()
can no longer be used to get theWindowInsetsControllerCompat
as the function always return null.Explanation: In the version I29264 . More importantly, following that change, the
1.8.0-alpha03
ofandroidx.core:core
,WindowInsetsControllerCompat
now fully depends on a View as seen inViewCompat.getWindowInsetsController(View)
function now relies on the rootView's layout params to determine whether if it's an instance ofWindowManager.LayoutParams
, and if not,null
is returned (the previous implementation did not rely on the layout params). When passingdecorView
in the new function,getLayoutParams
returns null, so because it isn't an instance ofWindowManager.LayoutParams
,ViewCompat.getWindowInsetsController(decoreView)
always returns null too.