Status Update
Comments
jo...@google.com <jo...@google.com> #2
More suggestions:
-
Allow to override containerElevation for RichTooltipBox - RichTooltipColors has container param, but doesn't allow overriding containerElevation (which mixes color with theme primary color, resulting in undesired color)
-
Allow to set or suggest the position of shown tooltip.
-
When isPersistent=true, allow dismissing by clicking outside and still passing through the click event
For example, when some persistent tooltip is shown for a button in screen's top area, user should be able to click something else in screen without having to click twice (once to dismiss the tooltip, second time to actually dismiss the tooltip)
-
Allow to customize PlainTooltipMaxWidth/RichTooltipMaxWidth
-
Accessibility - Hard to close isPersistent=true tooltip in TalkBack mode by clicking outside (this is probably an issue with PopupWindow itself)
-
Accessibility - TalkBack says "Popup window" when tooltip is shown (might be expected)
-
M3 spec doesn't seem to allow it, but tooltip arrows would be also useful. If not added to spec, maybe expose some currently internal stuff in M4 Tooltip implementation that will allow developers to implement arrows without having to rewrite it all?
ph...@lu.ma <ph...@lu.ma> #3
It sounds like the autohide behavior you are looking for is similar to the isPersistent parameter for tooltip state:
When this is set to true, the tooltip should be able to remain on the screen until the user clicks outside of it. The request for a modifiable timeout seems reasonable to me, wdyt Kevin? Something to defer to design perhaps?
jo...@google.com <jo...@google.com> #4
@isPersistent = false
to rememberTooltipState()
. These changes might not be available yet in the current release, but it should be included in the next one. Thanks!
Plain tooltip should be used for quick descriptions, if you have a lot of text that requires longer than 1.5 seconds to read please use rich tooltip and make it actionable.
@
- I think this is a reasonable ask, will file a bug to address.
- We recently merged a change to tooltips that exposes the
PopupPositionProvider
, you should be able to alter the actual position with this parameter. - You can use the
focusable
parameter to achieve this flow. - Dallas What do you think about exposing the maxWidth for Plain and Rich tooltips? From my understanding, this isn't something that we normally expose.
- Yeah this is part of the
Popup
implementation. If you'd like to escalate you can file an accessibility bug with the wider compose team. - Yup, this is expected.
- This is something that we're currently working on! No exact ETA, but it would be in M3.
ro...@osome.com <ro...@osome.com> #5
Branch: androidx-main
commit 6c66eb5e520994bf4f500731d2bc2e57081a89f0
Author: Kevin Truong <kevinctruong@google.com>
Date: Thu Oct 19 10:22:52 2023
[Tooltip] Adding tonalElevation and shadowElevation to APIs
Adding more flexibility to the component by allowing users to set the tonal and shadow elevation of the tooltip.
Also moving TooltipBox, PlainTooltip, and RichTooltip APIs back to experimental since they were accidentally released as stable.
Bug: 293939035
Test: N/A
Relnote: Adding tonalElevation and shadowElevation to tooltip APIs. Additionally, moving TooltipBox, PlainTooltip, and RichTooltip APIs back to experimental since they were accidentally released as stable.
Change-Id: If0f66a8ccc737a0c163fd2b2a890ce60ad3d5fe4
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/restricted_current.txt
M compose/material3/material3/integration-tests/material3-demos/src/main/java/androidx/compose/material3/demos/TooltipDemo.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Tooltip.kt
ap...@google.com <ap...@google.com> #6
The main suggestion was to make the api flexible so a custom dismiss duration could be passed in when isPersistent = false and no extra logic is required. Any plans on providing that flexibility in the TooltipBox?
ap...@google.com <ap...@google.com> #7
Branch: androidx-main
commit 00a9792162b32f60b64eeb5617fd46da749be323
Author: Jossi Wolf <jossiwolf@google.com>
Date: Fri May 12 17:08:38 2023
[M2] AnchoredDraggable Progress API
Improves AnchoredDraggable's progress API to match Swipeable's behavior. The progress is now exposed as the fraction of the current offset between the current (settled) anchor and the closest anchor in the swipe direction.
In contrast to the targetValue, the closestValue does not consider the thresholds.
Test: anchoredDraggable_closestValue, existing progress tests
Fixes: 270066861
Change-Id: I651e06cb34e914a63e13df851b27087d3bbb4257
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/anchoredDraggable/AnchoredDraggableStateTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/AnchoredDraggable.kt
[Deleted User] <[Deleted User]> #8
ph...@gmail.com <ph...@gmail.com> #9
I also expected to see it in 1.5.0-beta02, but it's not there. It's only gonna be available in 1.6?
pr...@google.com <pr...@google.com> #10
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material:material:1.6.0-alpha01
androidx.compose.material:material-android:1.6.0-alpha01
ju...@google.com <ju...@google.com> #11
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material:material:1.5.0-beta03
androidx.compose.material:material-android:1.5.0-beta03
na...@google.com <na...@google.com> #12
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.wear.compose:compose-material-core:1.2.0-rc01
androidx.wear.compose:compose-ui-tooling:1.2.0-rc01
Description
System
ModalBottomSheet
hides scrim quite early after you start swiping - I guess it indicates that sheet is gonna be dismissed at this point.I prefer to have a progressive scrim alpha - it drops smoothly to zero when the sheet is completely closed.
In Compose 1.3.0 I was using
ModalBottomSheetState.progress
to calculate scrim alpha depending on swipe progress.Looks like
SwipeableV2State
API is different fromSwipeableState
at this point. I guess that I can useModalBottomSheetState.currentValue
/ModalBottomSheetState.targetValue
instead ofSwipeableState.progress.from
/SwipeableState.progress.to
, but I still needSwipeableState.progress.friction
which seems likeSwipeableV2State.progress
now.Could you make it publicly available with
ModalBottomSheetState.progress
?