Fixed
Status Update
Comments
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
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit dfbfcd90a67d66d7eab8a7381e85ae9f831cea4a
Author: Matvei Malkov <malkov@google.com>
Date: Wed Mar 31 17:25:02 2021
Add experimental support for a version of Surface that handles click and make a regular Surface to block touches behind it.
Clickable Surface allows us to handle many issues at once:
1. Allows to define clicks on the Surface layout node, making a11y to be correct
2. Allows to define clicks in the single layout node without the need to transfer indication hnadling to the node below (because of the clipping inside the surface)
3. Allows for a desired default behaviour in a non-clickable Surface when we block pointer events from going under the surface. Throughout the many components it is seens like a desiged behaviour and often leads to bugs (snackbar, Drawer, modal sheet & card being norable examples of surfaces that shouldn't allow touches behind it).
To make this work properly, I refactored ModalBottomSheetLayout to work with the sheet-based swipeable (instead of content-based), since sheet is not blocking clicks.
With this one overload we solve many issues so it seems like a worthy experiment.
Relnote: BEHAVIOUR-BREAKING: Surface now consumes clicks, making clicks added via Surface(Modifier.clickable) to be a no-op. Please, use new experimental overload of Surface that accepts onClick.
Relnote: Added a new Surface overload that handles clicks as well as other clickable functionality: indication, interactionSource, enabled/disabled. It wasn't possible to use a regular non-clickable Surface with the Modifier.clickable because the Surface will not clip the ripple indication in those cases.
Test: Added new for an overload
Fixes: 183775620
Change-Id: I73e6c76ed6389040d824a5dcc82dc84dc4fea0c7
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/src/androidAndroidTest/kotlin/androidx/compose/material/ModalBottomSheetTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SnackbarHostTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SurfaceTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Button.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Drawer.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/FloatingActionButton.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/ModalBottomSheet.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Slider.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Surface.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Swipeable.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Switch.kt
https://android-review.googlesource.com/1660323
Branch: androidx-main
commit dfbfcd90a67d66d7eab8a7381e85ae9f831cea4a
Author: Matvei Malkov <malkov@google.com>
Date: Wed Mar 31 17:25:02 2021
Add experimental support for a version of Surface that handles click and make a regular Surface to block touches behind it.
Clickable Surface allows us to handle many issues at once:
1. Allows to define clicks on the Surface layout node, making a11y to be correct
2. Allows to define clicks in the single layout node without the need to transfer indication hnadling to the node below (because of the clipping inside the surface)
3. Allows for a desired default behaviour in a non-clickable Surface when we block pointer events from going under the surface. Throughout the many components it is seens like a desiged behaviour and often leads to bugs (snackbar, Drawer, modal sheet & card being norable examples of surfaces that shouldn't allow touches behind it).
To make this work properly, I refactored ModalBottomSheetLayout to work with the sheet-based swipeable (instead of content-based), since sheet is not blocking clicks.
With this one overload we solve many issues so it seems like a worthy experiment.
Relnote: BEHAVIOUR-BREAKING: Surface now consumes clicks, making clicks added via Surface(Modifier.clickable) to be a no-op. Please, use new experimental overload of Surface that accepts onClick.
Relnote: Added a new Surface overload that handles clicks as well as other clickable functionality: indication, interactionSource, enabled/disabled. It wasn't possible to use a regular non-clickable Surface with the Modifier.clickable because the Surface will not clip the ripple indication in those cases.
Test: Added new for an overload
Fixes: 183775620
Change-Id: I73e6c76ed6389040d824a5dcc82dc84dc4fea0c7
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/src/androidAndroidTest/kotlin/androidx/compose/material/ModalBottomSheetTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SnackbarHostTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SurfaceTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Button.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Drawer.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/FloatingActionButton.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/ModalBottomSheet.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Slider.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Surface.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Swipeable.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Switch.kt
Description
Compose version: 1.0.0-beta03
Steps to reproduce:
Demo
composableActual behavior: Box behind receives input events (we can see a ripple effect)
Expected behavior: Box behind doesn't receive input events