Fixed
Status Update
Comments
co...@google.com <co...@google.com> #2
Exito
co...@google.com <co...@google.com>
co...@google.com <co...@google.com>
ia...@google.com <ia...@google.com> #3
I know Louis has been looking at this already.
co...@google.com <co...@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.
ia...@google.com <ia...@google.com> #5
R.e
co...@google.com <co...@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
ia...@google.com <ia...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-main
commit ea6ca60a790f13505fa6a865ecb0f1ee1258876e
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Wed Nov 22 18:15:49 2023
Adds RippleConfiguration APIs to material
RippleConfiguration and LocalRippleConfiguration allow for per-component / sub-tree customization of ripples using fixed values. For example, to change the color of a component you don't control, or to disable a ripple for a component. In most cases the default values should be used: these APIs are an escape hatch for customization of individual components / limited sub-trees. For wider changes and custom design systems, you should instead build your own ripple using createRippleModifierNode.
This CL also migrates the last usages of rememberRipple / RippleTheme to the new APIs.
Bug: b/298048146
Test: RippleTest
Relnote: "Adds RippleConfiguration and LocalRippleConfiguration to allow for per-component / sub-tree customization of ripples using fixed values. For example, to change the color of a component you don't control, or to disable a ripple for a component. In most cases the default values should be used: these APIs are an escape hatch for customization of individual components / limited sub-trees. For wider changes and custom design systems, you should instead build your own ripple using createRippleModifierNode. For more information, seedeveloper.android.com ."
Change-Id: I6de11214b76060c93617b0188fc57172d5d5423e
M camera/integration-tests/avsynctestapp/build.gradle
M camera/integration-tests/avsynctestapp/src/main/java/androidx/camera/integration/avsync/ui/widget/Button.kt
M camera/integration-tests/uiwidgetstestapp/build.gradle
M camera/integration-tests/uiwidgetstestapp/src/main/java/androidx/camera/integration/uiwidgets/compose/ui/screen/components/TabRow.kt
M camera/integration-tests/uiwidgetstestapp/src/main/java/androidx/camera/integration/uiwidgets/compose/ui/screen/imagecapture/ImageCaptureScreenState.kt
M camera/integration-tests/uiwidgetstestapp/src/main/java/androidx/camera/integration/uiwidgets/compose/ui/screen/videocapture/VideoCaptureScreenState.kt
M compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/IndicationSamples.kt
M compose/material/material/api/current.txt
M compose/material/material/api/restricted_current.txt
M compose/material/material/src/androidInstrumentedTest/kotlin/androidx/compose/material/RippleTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Ripple.kt
M compose/ui/ui-inspection/src/androidTest/java/androidx/compose/ui/inspection/testdata/RippleTestActivity.kt
https://android-review.googlesource.com/2842980
Branch: androidx-main
commit ea6ca60a790f13505fa6a865ecb0f1ee1258876e
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Wed Nov 22 18:15:49 2023
Adds RippleConfiguration APIs to material
RippleConfiguration and LocalRippleConfiguration allow for per-component / sub-tree customization of ripples using fixed values. For example, to change the color of a component you don't control, or to disable a ripple for a component. In most cases the default values should be used: these APIs are an escape hatch for customization of individual components / limited sub-trees. For wider changes and custom design systems, you should instead build your own ripple using createRippleModifierNode.
This CL also migrates the last usages of rememberRipple / RippleTheme to the new APIs.
Bug:
Test: RippleTest
Relnote: "Adds RippleConfiguration and LocalRippleConfiguration to allow for per-component / sub-tree customization of ripples using fixed values. For example, to change the color of a component you don't control, or to disable a ripple for a component. In most cases the default values should be used: these APIs are an escape hatch for customization of individual components / limited sub-trees. For wider changes and custom design systems, you should instead build your own ripple using createRippleModifierNode. For more information, see
Change-Id: I6de11214b76060c93617b0188fc57172d5d5423e
M camera/integration-tests/avsynctestapp/build.gradle
M camera/integration-tests/avsynctestapp/src/main/java/androidx/camera/integration/avsync/ui/widget/Button.kt
M camera/integration-tests/uiwidgetstestapp/build.gradle
M camera/integration-tests/uiwidgetstestapp/src/main/java/androidx/camera/integration/uiwidgets/compose/ui/screen/components/TabRow.kt
M camera/integration-tests/uiwidgetstestapp/src/main/java/androidx/camera/integration/uiwidgets/compose/ui/screen/imagecapture/ImageCaptureScreenState.kt
M camera/integration-tests/uiwidgetstestapp/src/main/java/androidx/camera/integration/uiwidgets/compose/ui/screen/videocapture/VideoCaptureScreenState.kt
M compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/IndicationSamples.kt
M compose/material/material/api/current.txt
M compose/material/material/api/restricted_current.txt
M compose/material/material/src/androidInstrumentedTest/kotlin/androidx/compose/material/RippleTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Ripple.kt
M compose/ui/ui-inspection/src/androidTest/java/androidx/compose/ui/inspection/testdata/RippleTestActivity.kt
co...@google.com <co...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-main
commit af92b215fa235f565a4b2e2612f195d67adf9a99
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Wed Nov 22 16:10:31 2023
Adds ripple API to wear material and material3 libraries
The new ripple API replaces the deprecated rememberRipple API - it creates a ripple instance that will use the default theme values. ripple
does not need to be remembered, similar to modifiers - if the parameters compare equally, then the same node can be reused internally.
This CL also migrates all wear:compose-material / wear:compose-material3 components to use the new ripple. There is a temporary
CompositionLocal, LocalUseFallbackRippleImplementation, which can be set to true to fallback to using the old RippleTheme / rememberRipple
implementation, but this is strongly discouraged as it is much less performant than the new implementation. This fallback will be removed in
the next stable release, and exists here to aid migration.
Bug: b/298048146
Bug: b/304985887
Test: RippleTest
Relnote: "Adds new ripple API in wear:compose-material and wear:compose-material3 libraries which replaces the deprecated rememberRipple. Also
adds a temporary CompositionLocal, LocalUseFallbackRippleImplementation, to revert Material components to using the deprecated rememberRipple
/ RippleTheme APIs. This will be removed in the next stable release, and is only intended to be a temporary migration aid for cases where you
are providing a custom RippleTheme. Seedeveloper.android.com for migration information and more background information behind this change."
Change-Id: I87fd7d3968ec14c3e684039298b31a1fc620b47c
M wear/compose/compose-material-core/src/androidTest/kotlin/androidx/wear/compose/materialcore/ButtonTest.kt
M wear/compose/compose-material-core/src/androidTest/kotlin/androidx/wear/compose/materialcore/ChipTest.kt
M wear/compose/compose-material-core/src/androidTest/kotlin/androidx/wear/compose/materialcore/SelectionControlsTest.kt
M wear/compose/compose-material-core/src/androidTest/kotlin/androidx/wear/compose/materialcore/StepperTest.kt
M wear/compose/compose-material-core/src/androidTest/kotlin/androidx/wear/compose/materialcore/ToggleButtonTest.kt
M wear/compose/compose-material-core/src/main/java/androidx/wear/compose/materialcore/Button.kt
M wear/compose/compose-material-core/src/main/java/androidx/wear/compose/materialcore/Card.kt
M wear/compose/compose-material-core/src/main/java/androidx/wear/compose/materialcore/Chip.kt
M wear/compose/compose-material-core/src/main/java/androidx/wear/compose/materialcore/SelectionControls.kt
M wear/compose/compose-material-core/src/main/java/androidx/wear/compose/materialcore/Stepper.kt
M wear/compose/compose-material-core/src/main/java/androidx/wear/compose/materialcore/ToggleButton.kt
M wear/compose/compose-material/api/current.txt
M wear/compose/compose-material/api/restricted_current.txt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/Button.kt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/Card.kt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/Chip.kt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/MaterialTheme.kt
A wear/compose/compose-material/src/main/java/androidx/wear/compose/material/Ripple.kt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/Stepper.kt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/SwipeToReveal.kt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/ToggleButton.kt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/ToggleChip.kt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/ToggleControl.kt
M wear/compose/compose-material3/api/current.txt
M wear/compose/compose-material3/api/restricted_current.txt
M wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Button.kt
M wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Card.kt
M wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/IconButton.kt
M wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/MaterialTheme.kt
A wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Ripple.kt
M wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/SelectionControls.kt
M wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Slider.kt
M wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Stepper.kt
M wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/TextButton.kt
M wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/ToggleButton.kt
https://android-review.googlesource.com/2842979
Branch: androidx-main
commit af92b215fa235f565a4b2e2612f195d67adf9a99
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Wed Nov 22 16:10:31 2023
Adds ripple API to wear material and material3 libraries
The new ripple API replaces the deprecated rememberRipple API - it creates a ripple instance that will use the default theme values. ripple
does not need to be remembered, similar to modifiers - if the parameters compare equally, then the same node can be reused internally.
This CL also migrates all wear:compose-material / wear:compose-material3 components to use the new ripple. There is a temporary
CompositionLocal, LocalUseFallbackRippleImplementation, which can be set to true to fallback to using the old RippleTheme / rememberRipple
implementation, but this is strongly discouraged as it is much less performant than the new implementation. This fallback will be removed in
the next stable release, and exists here to aid migration.
Bug:
Bug:
Test: RippleTest
Relnote: "Adds new ripple API in wear:compose-material and wear:compose-material3 libraries which replaces the deprecated rememberRipple. Also
adds a temporary CompositionLocal, LocalUseFallbackRippleImplementation, to revert Material components to using the deprecated rememberRipple
/ RippleTheme APIs. This will be removed in the next stable release, and is only intended to be a temporary migration aid for cases where you
are providing a custom RippleTheme. See
Change-Id: I87fd7d3968ec14c3e684039298b31a1fc620b47c
M wear/compose/compose-material-core/src/androidTest/kotlin/androidx/wear/compose/materialcore/ButtonTest.kt
M wear/compose/compose-material-core/src/androidTest/kotlin/androidx/wear/compose/materialcore/ChipTest.kt
M wear/compose/compose-material-core/src/androidTest/kotlin/androidx/wear/compose/materialcore/SelectionControlsTest.kt
M wear/compose/compose-material-core/src/androidTest/kotlin/androidx/wear/compose/materialcore/StepperTest.kt
M wear/compose/compose-material-core/src/androidTest/kotlin/androidx/wear/compose/materialcore/ToggleButtonTest.kt
M wear/compose/compose-material-core/src/main/java/androidx/wear/compose/materialcore/Button.kt
M wear/compose/compose-material-core/src/main/java/androidx/wear/compose/materialcore/Card.kt
M wear/compose/compose-material-core/src/main/java/androidx/wear/compose/materialcore/Chip.kt
M wear/compose/compose-material-core/src/main/java/androidx/wear/compose/materialcore/SelectionControls.kt
M wear/compose/compose-material-core/src/main/java/androidx/wear/compose/materialcore/Stepper.kt
M wear/compose/compose-material-core/src/main/java/androidx/wear/compose/materialcore/ToggleButton.kt
M wear/compose/compose-material/api/current.txt
M wear/compose/compose-material/api/restricted_current.txt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/Button.kt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/Card.kt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/Chip.kt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/MaterialTheme.kt
A wear/compose/compose-material/src/main/java/androidx/wear/compose/material/Ripple.kt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/Stepper.kt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/SwipeToReveal.kt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/ToggleButton.kt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/ToggleChip.kt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/ToggleControl.kt
M wear/compose/compose-material3/api/current.txt
M wear/compose/compose-material3/api/restricted_current.txt
M wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Button.kt
M wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Card.kt
M wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/IconButton.kt
M wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/MaterialTheme.kt
A wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Ripple.kt
M wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/SelectionControls.kt
M wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Slider.kt
M wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Stepper.kt
M wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/TextButton.kt
M wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/ToggleButton.kt
Description
Using 1.1.0-alpha01
If you specify anchors with the paneExpansionState, those anchors are only used after the first drag. For example using:
The
anchors on app open.png
attachment shows what this looks like when first opened. Note that the red line indicates a physical hinge on a Pixel Fold and is drawn separate from the scaffold. Theanchors after minimal drag.png
attachment shows what the UI looks like after a minimal drag when the anchors take affect.This is much more noticeable on bigger devices like the Galaxy Tab Ultra line of tablets.
anchors on tablet.mp4
shows what the UI looks like on app open and then drags the handle slightly before releasing to show the snapping behavior.