Fixed
Status Update
Comments
ma...@google.com <ma...@google.com> #2
To extend on this request, it would be great if the “cap” for the stroke was configurable, at the moment it is hard coded to StrokeCap.Butt in the private drawCircularIndicator and not configurable from the default; StrokeCap.Butt in the private drawLinearIndicator.
So a cap as a param (for LinearProgressIndicator), or overloading the constructors for ProgressIndicators (Circular & Linear) to include a Stroke param, would be great. We would love to use the provided indicators but still want the curved look, so this addition would be greatly appreciated.
So a cap as a param (for LinearProgressIndicator), or overloading the constructors for ProgressIndicators (Circular & Linear) to include a Stroke param, would be great. We would love to use the provided indicators but still want the curved look, so this addition would be greatly appreciated.
al...@gmail.com <al...@gmail.com> #3
Along with these a great addition would be to open the stroke width for the background track as well. In the code the same width is passed to draw the LinearIndicator and the background for it. Strokewidth is obtained from the height. Only if these were separated, we could customize the progressIndicator to have the progress stroke greater than the background stroke width.
al...@gmail.com <al...@gmail.com> #4
After consideration, we will be adding a parameter to configure the stroke cap of the indicators. Further shape customization or separate stroke widths for track/background are outside the scope of what we want to support in the library.
br...@monzo.com <br...@monzo.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit 013d7bbb021ed16b31afdcedf3936c467a8b3ed5
Author: Max Alfonso-Ying <maxying@google.com>
Date: Wed Nov 30 17:55:39 2022
Add track and stroke cap to progress indicators
Bug: b/216325962 , b/222964817
Test: added new screenshots
Relnote: "Added a track color parameter for circular
progress indicators, and a stroke cap parameter for both
circular and linear progress indicators."
Change-Id: Ie668cc47ce9ce3aa688ad3c3ed9e9e15fdbda5e9
M compose/material/material/api/current.txt
M compose/material/material/api/public_plus_experimental_current.txt
M compose/material/material/api/restricted_current.txt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/ProgressIndicator.kt
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/public_plus_experimental_current.txt
M compose/material3/material3/api/restricted_current.txt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/ProgressIndicatorScreenshotTest.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ProgressIndicator.kt
https://android-review.googlesource.com/2322195
Branch: androidx-main
commit 013d7bbb021ed16b31afdcedf3936c467a8b3ed5
Author: Max Alfonso-Ying <maxying@google.com>
Date: Wed Nov 30 17:55:39 2022
Add track and stroke cap to progress indicators
Bug:
Test: added new screenshots
Relnote: "Added a track color parameter for circular
progress indicators, and a stroke cap parameter for both
circular and linear progress indicators."
Change-Id: Ie668cc47ce9ce3aa688ad3c3ed9e9e15fdbda5e9
M compose/material/material/api/current.txt
M compose/material/material/api/public_plus_experimental_current.txt
M compose/material/material/api/restricted_current.txt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/ProgressIndicator.kt
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/public_plus_experimental_current.txt
M compose/material3/material3/api/restricted_current.txt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/ProgressIndicatorScreenshotTest.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ProgressIndicator.kt
al...@gmail.com <al...@gmail.com> #6
Project: platform/frameworks/support-golden
Branch: androidx-main
commit bfb61a63cca79430f547bc3ae08abb82dab8aee5
Author: Max Alfonso-Ying <maxying@google.com>
Date: Wed Nov 30 17:51:36 2022
Add new progress indicator screenshots.
Also renames old screenshots from "definite" -> "determinate".
Bug: b/216325962 , b/222964817
Change-Id: Ib41b5bce4db06b58612781befb5521f0bc9c7b8d
M compose/material3/material3/circularProgressIndicator_darkTheme_determinate_cuttlefish.png
A compose/material3/material3/circularProgressIndicator_lightTheme_determinate_customCapAndTrack_cuttlefish.png
M compose/material3/material3/circularProgressIndicator_lightTheme_determinate_cuttlefish.png
M compose/material3/material3/circularProgressIndicator_lightTheme_indeterminate_cuttlefish.png
M compose/material3/material3/linearProgressIndicator_darkTheme_determinate_cuttlefish.png
A compose/material3/material3/linearProgressIndicator_lightTheme_determinate_customCap_cuttlefish.png
M compose/material3/material3/linearProgressIndicator_lightTheme_determinate_cuttlefish.png
M compose/material3/material3/linearProgressIndicator_lightTheme_indeterminate_cuttlefish.png
https://android-review.googlesource.com/2320456
Branch: androidx-main
commit bfb61a63cca79430f547bc3ae08abb82dab8aee5
Author: Max Alfonso-Ying <maxying@google.com>
Date: Wed Nov 30 17:51:36 2022
Add new progress indicator screenshots.
Also renames old screenshots from "definite" -> "determinate".
Bug:
Change-Id: Ib41b5bce4db06b58612781befb5521f0bc9c7b8d
M compose/material3/material3/circularProgressIndicator_darkTheme_determinate_cuttlefish.png
A compose/material3/material3/circularProgressIndicator_lightTheme_determinate_customCapAndTrack_cuttlefish.png
M compose/material3/material3/circularProgressIndicator_lightTheme_determinate_cuttlefish.png
M compose/material3/material3/circularProgressIndicator_lightTheme_indeterminate_cuttlefish.png
M compose/material3/material3/linearProgressIndicator_darkTheme_determinate_cuttlefish.png
A compose/material3/material3/linearProgressIndicator_lightTheme_determinate_customCap_cuttlefish.png
M compose/material3/material3/linearProgressIndicator_lightTheme_determinate_cuttlefish.png
M compose/material3/material3/linearProgressIndicator_lightTheme_indeterminate_cuttlefish.png
ae...@google.com <ae...@google.com>
ap...@google.com <ap...@google.com> #7
Thats great! Thanks Max
ae...@google.com <ae...@google.com> #8
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material:material:1.4.0-alpha04
androidx.compose.material3:material3:1.1.0-alpha04
Description
Consider a custom
ListItem
component that displays aRadioButton
at the start of its content, implemented something like this:The problem I have with this code is that I only want the
Row
to show up as focusable in TalkBack and Ionly
want the Row to have a ripple indication. In other words, I would like theRadioButton
to be treated just as a decorative icon inside theRow
that is not individually interactive at all.The problem with this code is that by passing
onClick
to both theRow
and theRadioButton
, both end up being interactive and clickable. However,RadioButton
requires the click listener to be non-null, so there is currently no way to workaround this using the current API.The only way that I’ve been able to workaround this is by creating a custom
RadioButton
component that accepts a nullableonClick
argument. This allows me to passnull
as the click listener in the code above, and internally theRadioButton
will do something likeif (onClick == null) Modifier else Modifier.selectable(...)
to ensure that it can be used as a non-interactive widget.This same issue also exists for
Checkbox
andSwitch
as well.