Fixed
Status Update
Comments
cl...@google.com <cl...@google.com>
an...@google.com <an...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit bbfbdb3b7ffc824bcb393595ebfcd4168d9ab934
Author: Matvei Malkov <malkov@google.com>
Date: Tue May 11 13:28:57 2021
Add Card overload with onClick to match Surface.
Most of the cards we have are usually clickable, so to match the Surface we added a Card overload that requires onClick.
Change-Id: Ia8744f372b7ecafd4e92d0fc58245ebc0972b18d
Relnote: BEHAVIOUR-BREAKING: Card now consumes clicks, making clicks added via Card(Modifier.clickable) to be a no-op. Please, use new experimental overload of a Card that accepts onClick.
Relnote: Added a new Card overload that handles clicks as well as other clickable functionality: indication, interactionSource, enabled/disabled. It wasn't possible to use a regular non-clickable Card with the Modifier.clickable because the Card will not clip the ripple indication in those cases.
Bug: 183775620
Test: added for a new overload
M compose/material/material/api/public_plus_experimental_1.0.0-beta08.txt
M compose/material/material/api/public_plus_experimental_current.txt
M compose/material/material/integration-tests/material-demos/src/main/java/androidx/compose/material/demos/ElevationDemo.kt
M compose/material/material/samples/src/main/java/androidx/compose/material/samples/CardSamples.kt
M compose/material/material/samples/src/main/java/androidx/compose/material/samples/SurfaceSamples.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CardTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Card.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Surface.kt
https://android-review.googlesource.com/1703067
Branch: androidx-main
commit bbfbdb3b7ffc824bcb393595ebfcd4168d9ab934
Author: Matvei Malkov <malkov@google.com>
Date: Tue May 11 13:28:57 2021
Add Card overload with onClick to match Surface.
Most of the cards we have are usually clickable, so to match the Surface we added a Card overload that requires onClick.
Change-Id: Ia8744f372b7ecafd4e92d0fc58245ebc0972b18d
Relnote: BEHAVIOUR-BREAKING: Card now consumes clicks, making clicks added via Card(Modifier.clickable) to be a no-op. Please, use new experimental overload of a Card that accepts onClick.
Relnote: Added a new Card overload that handles clicks as well as other clickable functionality: indication, interactionSource, enabled/disabled. It wasn't possible to use a regular non-clickable Card with the Modifier.clickable because the Card will not clip the ripple indication in those cases.
Bug: 183775620
Test: added for a new overload
M compose/material/material/api/public_plus_experimental_1.0.0-beta08.txt
M compose/material/material/api/public_plus_experimental_current.txt
M compose/material/material/integration-tests/material-demos/src/main/java/androidx/compose/material/demos/ElevationDemo.kt
M compose/material/material/samples/src/main/java/androidx/compose/material/samples/CardSamples.kt
M compose/material/material/samples/src/main/java/androidx/compose/material/samples/SurfaceSamples.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CardTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Card.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Surface.kt
Description
Jetpack Compose release version: 1.0.0-beta02
Developers not using AppCompat version 1.3+ nor Fragment 1.3+ can hit this error (i.e. the need of manually setting owners for
ComposeView
ViewTreeLifecycleOwner
andViewTreeSavedStateRegistryOwner
) when usingComposeView
in a XML file even thoughComposeView
'ssetContent
method hasn't been called.These checks seem too aggressive and are done way earlier they're expected. I'd expect these checks to be called when
setContent
is called, not before.The workaround seen in the community is creating a
ComposeViewStub
that they use in XML and replace with aComposeView
at runtime. Then, LayoutParams and id are reassigned, the right owners are set, andsetContent
is called.