Fixed
Status Update
Comments
ma...@google.com <ma...@google.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
lp...@google.com <lp...@google.com>
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 79a0ebdf1686b21442e55cbe4fc0b160207c30e6
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Mon Sep 06 21:33:07 2021
Updates Material components to have a minimum touch target size
Button, Slider, Checkbox, RadioButton, and Switch have a visual size smaller than the minimum touch target size of 48x48dp. This means that even with the recent touch target expansion work, in many cases there will not be enough space for hit testing to expand, meaning that these components are not accessible. This CL adds extra space around these components if they are smaller than 48x48, to make sure that there will be enough size for the expanded hit testing to work, ensuring that these components have an accessible touch target.
Also updates Snackbar and AlertDialog to account for the new larger size of buttons in their layout implementation.
Bug: b/149691127
Fixes: b/171509422
Fixes: b/150377503
Fixes: b/174707736
Test: existing tests, new tests
Relnote: "Adds minimum touch target sizing for Material components that do not have an accessible touch target. As this adds extra spacing around components to make sure they have a large enough touch target, this may change existing UIs that assume the size of these components is their visual size, and doesn't account for touch target size. You can use the experimental LocalMinimumTouchTargetEnforcement composition local to disable this behavior across a hierarchy, but this is intended only to be a temporary escape hatch while updating existing UIs to account for the new minimum size."
Change-Id: I9b966a79a290538d8d450aa732b5092760cbece4
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Checkbox.kt
M compose/material/material/api/current.txt
A compose/material/material/src/commonMain/kotlin/androidx/compose/material/TouchTarget.kt
M compose/material/material/api/restricted_current.txt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SnackbarTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Snackbar.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Slider.kt
M compose/material/material/api/public_plus_experimental_current.txt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Switch.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/RadioButton.kt
M compose/ui/ui-inspection/src/androidTest/java/androidx/compose/ui/inspection/inspector/LayoutInspectorTreeTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/RadioButtonScreenshotTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ButtonTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/RadioButtonTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxScreenshotTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Surface.kt
M compose/material/material/src/androidMain/kotlin/androidx/compose/material/AndroidAlertDialog.android.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwitchTest.kt
https://android-review.googlesource.com/1818946
Branch: androidx-main
commit 79a0ebdf1686b21442e55cbe4fc0b160207c30e6
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Mon Sep 06 21:33:07 2021
Updates Material components to have a minimum touch target size
Button, Slider, Checkbox, RadioButton, and Switch have a visual size smaller than the minimum touch target size of 48x48dp. This means that even with the recent touch target expansion work, in many cases there will not be enough space for hit testing to expand, meaning that these components are not accessible. This CL adds extra space around these components if they are smaller than 48x48, to make sure that there will be enough size for the expanded hit testing to work, ensuring that these components have an accessible touch target.
Also updates Snackbar and AlertDialog to account for the new larger size of buttons in their layout implementation.
Bug:
Fixes:
Fixes:
Fixes:
Test: existing tests, new tests
Relnote: "Adds minimum touch target sizing for Material components that do not have an accessible touch target. As this adds extra spacing around components to make sure they have a large enough touch target, this may change existing UIs that assume the size of these components is their visual size, and doesn't account for touch target size. You can use the experimental LocalMinimumTouchTargetEnforcement composition local to disable this behavior across a hierarchy, but this is intended only to be a temporary escape hatch while updating existing UIs to account for the new minimum size."
Change-Id: I9b966a79a290538d8d450aa732b5092760cbece4
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Checkbox.kt
M compose/material/material/api/current.txt
A compose/material/material/src/commonMain/kotlin/androidx/compose/material/TouchTarget.kt
M compose/material/material/api/restricted_current.txt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SnackbarTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Snackbar.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Slider.kt
M compose/material/material/api/public_plus_experimental_current.txt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Switch.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/RadioButton.kt
M compose/ui/ui-inspection/src/androidTest/java/androidx/compose/ui/inspection/inspector/LayoutInspectorTreeTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/RadioButtonScreenshotTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ButtonTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/RadioButtonTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxScreenshotTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Surface.kt
M compose/material/material/src/androidMain/kotlin/androidx/compose/material/AndroidAlertDialog.android.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwitchTest.kt
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit bed1b7549d6bbd2e4b55182427ec5d2a8f88f3ed
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Mon Sep 27 15:49:24 2021
Updates IconButton to use minimum touch target sizing
Previously IconButton was hardcoded to be 48.dp in size, now it uses the same mechanism as other Material components.
Also fixes rounding error in the modifier implementation.
Fixes: b/149691127
Fixes: b/162719845
Test: IconButtonTest
Change-Id: I93ed58d4d5146707df202002e70ac78f9c9ca7af
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TouchTarget.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/AppBarTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/IconButton.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/IconButtonTest.kt
https://android-review.googlesource.com/1837300
Branch: androidx-main
commit bed1b7549d6bbd2e4b55182427ec5d2a8f88f3ed
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Mon Sep 27 15:49:24 2021
Updates IconButton to use minimum touch target sizing
Previously IconButton was hardcoded to be 48.dp in size, now it uses the same mechanism as other Material components.
Also fixes rounding error in the modifier implementation.
Fixes:
Fixes:
Test: IconButtonTest
Change-Id: I93ed58d4d5146707df202002e70ac78f9c9ca7af
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TouchTarget.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/AppBarTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/IconButton.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/IconButtonTest.kt
Description
Material recommends a touch target minimum of 48 x 48 dp for accessibility purposes:
Currently the size of components / their touch target is decided per component. For example, Button sets a min height of 36.dp, but there is no extra touch target affordance here. This means that this component is not accessible.
From a technical side, given that Ripple currently needs to be outside Clickable, it is also currently impossible to increase the touch target size for a bounded ripple, without also increasing the ripple size to no longer be bounded to the component.
We should:
a) Remove this technical limitation, presumably by waiting for ripple / input to become modifiers
b) Extract this touch target requirement into a re-usable component / modifier, such that all components (ours and external) can compose together this functionality, and automatically increase the touch target to the minimum
c) Expose global (ambient) configuration for this minimum, to allow for customization. For example, for pointer input (such as a Chromebook running an Android Compose app), the minimum should be 44 x 44 dp instead, and so the size of components should be adjusted on such a platform.