Fixed
Status Update
Comments
ia...@google.com <ia...@google.com> #2
Exito
tr...@google.com <tr...@google.com> #3
I know Louis has been looking at this already.
tr...@google.com <tr...@google.com> #4
I think, clickable
/combinedClickable
must be replaced with separated modifiers (as focus...
/onFocus...
). I propose to make:
- new
pressable(enabled, interactionSource)
modifier which does not have anindication
,hoverable
andfocusable
/focusableInNonTouchMode
.interactionSource
will only be used withPressInteraction
. - new modifier(s) for
onClickLabel
/onClick
,onLongClickLabel
/onLongClick
andonDoubleClick
. focusableInNonTouchMode
public.
We can add role
separately via semantics
.
All this will help to create components with the necessary properties.
ma...@google.com <ma...@google.com> #5
R.e
ma...@google.com <ma...@google.com>
ma...@google.com <ma...@google.com>
na...@google.com <na...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
commit c3c96aef1d6c366ee1658cd8dfa27588231740c2
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Thu Sep 28 16:59:45 2023
Deprecates rememberRipple and RippleTheme, adds createRippleNode API
This CL adds a new ripple implementation (createRippleNode) built using Modifier.Node APIs, so it can be used inside IndicationNodeFactory.
This leads to large performance improvements and greatly reduced allocations.
IndicationNodeFactory does not support calling Composable functions, so RippleTheme cannot be used to theme ripples built using the new node
APIs. In addition, having one singular library as the source of truth for ripple theme leads to tension and problems between design systems:
for example the default RippleTheme functions are actually the material spec, not material3, so they should have been versioned with the
material library instead. Similarly, if you are wrapping material / material3 with your own theme, both themes will end up 'fighting' over the
RippleTheme - the theme configuration is a property of the design system, not a generic system.
As a result, this CL deprecates rememberRipple and RippleTheme - the intention moving forward is for design system libraries to provide their
own theming APIs for ripples (if desired), and their own ripple Indication implementations that consume their own theme values. This allows us
to simplify the layering and API shape, and allows for more flexibility between custom design systems. createRippleNode encapsulates all of
the ripple logic so design system implementations can just delegate to createRippleNode after querying their theme values in a separate node.
Bug: b/298048146
Test: RememberRippleTest, RippleModifierNodeTest, RippleBenchmark
Relnote: "Deprecates rememberRipple, RippleTheme and LocalRippleTheme, adds createRippleNode. Instead of using these APIs, use the new ripple Indication and theming APIs in design system libraries such as material / material3. Seedeveloper.android.com for migration / backwards compatibility information and more background information behind this change."
Change-Id: I23f260b2f070e3f0f5b145b87eb1c6a06f3fd861
M compose/material/material-ripple/api/current.txt
M compose/material/material-ripple/api/restricted_current.txt
M compose/material/material-ripple/benchmark/src/androidTest/java/androidx/compose/material/ripple/benchmark/RippleBenchmark.kt
M compose/material/material-ripple/build.gradle
A compose/material/material-ripple/src/androidInstrumentedTest/kotlin/androidx/compose/material/ripple/RememberRippleTest.kt
M compose/material/material-ripple/src/androidInstrumentedTest/kotlin/androidx/compose/material/ripple/RippleContainerTest.kt
A compose/material/material-ripple/src/androidInstrumentedTest/kotlin/androidx/compose/material/ripple/RippleModifierNodeTest.kt
M compose/material/material-ripple/src/androidMain/kotlin/androidx/compose/material/ripple/Ripple.android.kt
M compose/material/material-ripple/src/androidMain/kotlin/androidx/compose/material/ripple/RippleContainer.android.kt
M compose/material/material-ripple/src/commonMain/kotlin/androidx/compose/material/ripple/CommonRipple.kt
M compose/material/material-ripple/src/commonMain/kotlin/androidx/compose/material/ripple/Ripple.kt
M compose/material/material-ripple/src/commonMain/kotlin/androidx/compose/material/ripple/RippleAnimation.kt
M compose/material/material-ripple/src/commonMain/kotlin/androidx/compose/material/ripple/RippleTheme.kt
M compose/material/material-ripple/src/desktopMain/kotlin/androidx/compose/material/ripple/Ripple.desktop.kt
https://android-review.googlesource.com/2767385
Branch: androidx-main
commit c3c96aef1d6c366ee1658cd8dfa27588231740c2
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Thu Sep 28 16:59:45 2023
Deprecates rememberRipple and RippleTheme, adds createRippleNode API
This CL adds a new ripple implementation (createRippleNode) built using Modifier.Node APIs, so it can be used inside IndicationNodeFactory.
This leads to large performance improvements and greatly reduced allocations.
IndicationNodeFactory does not support calling Composable functions, so RippleTheme cannot be used to theme ripples built using the new node
APIs. In addition, having one singular library as the source of truth for ripple theme leads to tension and problems between design systems:
for example the default RippleTheme functions are actually the material spec, not material3, so they should have been versioned with the
material library instead. Similarly, if you are wrapping material / material3 with your own theme, both themes will end up 'fighting' over the
RippleTheme - the theme configuration is a property of the design system, not a generic system.
As a result, this CL deprecates rememberRipple and RippleTheme - the intention moving forward is for design system libraries to provide their
own theming APIs for ripples (if desired), and their own ripple Indication implementations that consume their own theme values. This allows us
to simplify the layering and API shape, and allows for more flexibility between custom design systems. createRippleNode encapsulates all of
the ripple logic so design system implementations can just delegate to createRippleNode after querying their theme values in a separate node.
Bug:
Test: RememberRippleTest, RippleModifierNodeTest, RippleBenchmark
Relnote: "Deprecates rememberRipple, RippleTheme and LocalRippleTheme, adds createRippleNode. Instead of using these APIs, use the new ripple Indication and theming APIs in design system libraries such as material / material3. See
Change-Id: I23f260b2f070e3f0f5b145b87eb1c6a06f3fd861
M compose/material/material-ripple/api/current.txt
M compose/material/material-ripple/api/restricted_current.txt
M compose/material/material-ripple/benchmark/src/androidTest/java/androidx/compose/material/ripple/benchmark/RippleBenchmark.kt
M compose/material/material-ripple/build.gradle
A compose/material/material-ripple/src/androidInstrumentedTest/kotlin/androidx/compose/material/ripple/RememberRippleTest.kt
M compose/material/material-ripple/src/androidInstrumentedTest/kotlin/androidx/compose/material/ripple/RippleContainerTest.kt
A compose/material/material-ripple/src/androidInstrumentedTest/kotlin/androidx/compose/material/ripple/RippleModifierNodeTest.kt
M compose/material/material-ripple/src/androidMain/kotlin/androidx/compose/material/ripple/Ripple.android.kt
M compose/material/material-ripple/src/androidMain/kotlin/androidx/compose/material/ripple/RippleContainer.android.kt
M compose/material/material-ripple/src/commonMain/kotlin/androidx/compose/material/ripple/CommonRipple.kt
M compose/material/material-ripple/src/commonMain/kotlin/androidx/compose/material/ripple/Ripple.kt
M compose/material/material-ripple/src/commonMain/kotlin/androidx/compose/material/ripple/RippleAnimation.kt
M compose/material/material-ripple/src/commonMain/kotlin/androidx/compose/material/ripple/RippleTheme.kt
M compose/material/material-ripple/src/desktopMain/kotlin/androidx/compose/material/ripple/Ripple.desktop.kt
Description
1.1 snapshot: 12421028
If you enable predictive back and use a
NavigableListDetailPaneScaffold
, dragging the gesture to start it and then moving back to the original position to release and cancel it results in a weird limbo state. The modifiers from the list pane will be used but the content won't, so it doesn't seem to reset to details correctly.Sample code: