Fixed
Status Update
Comments
cl...@google.com <cl...@google.com>
ma...@google.com <ma...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 9082f62682f853ad5251a1c79dde9eccba7abdd9
Author: Max Alfonso-Ying <maxying@google.com>
Date: Thu Apr 18 00:34:40 2024
[M2 text field] Apply background to decoration box
...instead of to the BasicTextField, so changing the
backgroundColor will properly change the decoration
box's background color.
Fixes: b/307694651
Test: added unit tests
Relnote: "Fix backgroundColor not applying to
TextFieldDecorationBox and OutlinedTextFieldDecorationBox.
Decoration boxes now accept a `shape` parameter."
Change-Id: I371c26718597cb36ac537e9412ce476532afb40d
M compose/material/material/api/current.txt
M compose/material/material/api/restricted_current.txt
M compose/material/material/integration-tests/material-demos/src/main/java/androidx/compose/material/demos/TextFieldDecorationBoxDemos.kt
M compose/material/material/src/androidInstrumentedTest/kotlin/androidx/compose/material/textfield/TextFieldDecorationBoxTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/OutlinedTextField.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TextField.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TextFieldDefaults.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TextFieldImpl.kt
https://android-review.googlesource.com/3046833
Branch: androidx-main
commit 9082f62682f853ad5251a1c79dde9eccba7abdd9
Author: Max Alfonso-Ying <maxying@google.com>
Date: Thu Apr 18 00:34:40 2024
[M2 text field] Apply background to decoration box
...instead of to the BasicTextField, so changing the
backgroundColor will properly change the decoration
box's background color.
Fixes:
Test: added unit tests
Relnote: "Fix backgroundColor not applying to
TextFieldDecorationBox and OutlinedTextFieldDecorationBox.
Decoration boxes now accept a `shape` parameter."
Change-Id: I371c26718597cb36ac537e9412ce476532afb40d
M compose/material/material/api/current.txt
M compose/material/material/api/restricted_current.txt
M compose/material/material/integration-tests/material-demos/src/main/java/androidx/compose/material/demos/TextFieldDecorationBoxDemos.kt
M compose/material/material/src/androidInstrumentedTest/kotlin/androidx/compose/material/textfield/TextFieldDecorationBoxTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/OutlinedTextField.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TextField.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TextFieldDefaults.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TextFieldImpl.kt
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit e4894d0b99ea6360cc84bc2bc55d6f602e3b8b63
Author: Calin Tataru <calintat@google.com>
Date: Mon Jul 27 10:53:31 2020
Refactor stateDraggable and rename to swipeable
This CL does the following things:
* Rename Modifier.stateDraggable to Modifier.swipeable.
* Make swipeable public and mark it as ExperimentalMaterialApi.
* Introduce the concept of SwipeableState which holds the current state
of the swipeable as well as the animated float, and provides methods for
updating the state and subscribing to more granular in-movement updates.
* Rename DrawerState to DrawerValue, and introduce a new DrawerState
class which is a subclass of SwipeableState<DrawerValue> and provides
more contextual methods such as isOpen or open(). Same for BottomDrawer.
Bug: 148023068
Test: Ran DrawerTest, ScaffoldTest and SwitchTest
Relnote: "Modifier.stateDraggable was completely reworked and renamed
to Modifier.swipeable. A new SwipeableState class was introduced, and
DrawerState and BottomDrawerState were refactored to inherit from it.
[Modal/Bottom]DrawerLayout no longer take an onStateChange parameter."
Change-Id: I7233229dfc9c04a4615f4c1cc29e604b97edd1df
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/runtime/HotReloadIntegrationTests.kt
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/samples/src/main/java/androidx/compose/material/samples/DrawerSamples.kt
M ui/ui-material/samples/src/main/java/androidx/compose/material/samples/ScaffoldSamples.kt
A ui/ui-material/samples/src/main/java/androidx/compose/material/samples/SwipeableSamples.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerScreenshotTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/ScaffoldTest.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Drawer.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Scaffold.kt
A ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Swipeable.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Switch.kt
D ui/ui-material/src/commonMain/kotlin/androidx/compose/material/internal/StateDraggable.kt
https://android-review.googlesource.com/1362598
Branch: androidx-master-dev
commit e4894d0b99ea6360cc84bc2bc55d6f602e3b8b63
Author: Calin Tataru <calintat@google.com>
Date: Mon Jul 27 10:53:31 2020
Refactor stateDraggable and rename to swipeable
This CL does the following things:
* Rename Modifier.stateDraggable to Modifier.swipeable.
* Make swipeable public and mark it as ExperimentalMaterialApi.
* Introduce the concept of SwipeableState which holds the current state
of the swipeable as well as the animated float, and provides methods for
updating the state and subscribing to more granular in-movement updates.
* Rename DrawerState to DrawerValue, and introduce a new DrawerState
class which is a subclass of SwipeableState<DrawerValue> and provides
more contextual methods such as isOpen or open(). Same for BottomDrawer.
Bug: 148023068
Test: Ran DrawerTest, ScaffoldTest and SwitchTest
Relnote: "Modifier.stateDraggable was completely reworked and renamed
to Modifier.swipeable. A new SwipeableState class was introduced, and
DrawerState and BottomDrawerState were refactored to inherit from it.
[Modal/Bottom]DrawerLayout no longer take an onStateChange parameter."
Change-Id: I7233229dfc9c04a4615f4c1cc29e604b97edd1df
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/runtime/HotReloadIntegrationTests.kt
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/samples/src/main/java/androidx/compose/material/samples/DrawerSamples.kt
M ui/ui-material/samples/src/main/java/androidx/compose/material/samples/ScaffoldSamples.kt
A ui/ui-material/samples/src/main/java/androidx/compose/material/samples/SwipeableSamples.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerScreenshotTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/ScaffoldTest.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Drawer.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Scaffold.kt
A ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Swipeable.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Switch.kt
D ui/ui-material/src/commonMain/kotlin/androidx/compose/material/internal/StateDraggable.kt
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit e4894d0b99ea6360cc84bc2bc55d6f602e3b8b63
Author: Calin Tataru <calintat@google.com>
Date: Mon Jul 27 10:53:31 2020
Refactor stateDraggable and rename to swipeable
This CL does the following things:
* Rename Modifier.stateDraggable to Modifier.swipeable.
* Make swipeable public and mark it as ExperimentalMaterialApi.
* Introduce the concept of SwipeableState which holds the current state
of the swipeable as well as the animated float, and provides methods for
updating the state and subscribing to more granular in-movement updates.
* Rename DrawerState to DrawerValue, and introduce a new DrawerState
class which is a subclass of SwipeableState<DrawerValue> and provides
more contextual methods such as isOpen or open(). Same for BottomDrawer.
Bug: 148023068
Test: Ran DrawerTest, ScaffoldTest and SwitchTest
Relnote: "Modifier.stateDraggable was completely reworked and renamed
to Modifier.swipeable. A new SwipeableState class was introduced, and
DrawerState and BottomDrawerState were refactored to inherit from it.
[Modal/Bottom]DrawerLayout no longer take an onStateChange parameter."
Change-Id: I7233229dfc9c04a4615f4c1cc29e604b97edd1df
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/runtime/HotReloadIntegrationTests.kt
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/samples/src/main/java/androidx/compose/material/samples/DrawerSamples.kt
M ui/ui-material/samples/src/main/java/androidx/compose/material/samples/ScaffoldSamples.kt
A ui/ui-material/samples/src/main/java/androidx/compose/material/samples/SwipeableSamples.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerScreenshotTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/ScaffoldTest.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Drawer.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Scaffold.kt
A ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Swipeable.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Switch.kt
D ui/ui-material/src/commonMain/kotlin/androidx/compose/material/internal/StateDraggable.kt
https://android-review.googlesource.com/1362598
Branch: androidx-master-dev
commit e4894d0b99ea6360cc84bc2bc55d6f602e3b8b63
Author: Calin Tataru <calintat@google.com>
Date: Mon Jul 27 10:53:31 2020
Refactor stateDraggable and rename to swipeable
This CL does the following things:
* Rename Modifier.stateDraggable to Modifier.swipeable.
* Make swipeable public and mark it as ExperimentalMaterialApi.
* Introduce the concept of SwipeableState which holds the current state
of the swipeable as well as the animated float, and provides methods for
updating the state and subscribing to more granular in-movement updates.
* Rename DrawerState to DrawerValue, and introduce a new DrawerState
class which is a subclass of SwipeableState<DrawerValue> and provides
more contextual methods such as isOpen or open(). Same for BottomDrawer.
Bug: 148023068
Test: Ran DrawerTest, ScaffoldTest and SwitchTest
Relnote: "Modifier.stateDraggable was completely reworked and renamed
to Modifier.swipeable. A new SwipeableState class was introduced, and
DrawerState and BottomDrawerState were refactored to inherit from it.
[Modal/Bottom]DrawerLayout no longer take an onStateChange parameter."
Change-Id: I7233229dfc9c04a4615f4c1cc29e604b97edd1df
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/runtime/HotReloadIntegrationTests.kt
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/samples/src/main/java/androidx/compose/material/samples/DrawerSamples.kt
M ui/ui-material/samples/src/main/java/androidx/compose/material/samples/ScaffoldSamples.kt
A ui/ui-material/samples/src/main/java/androidx/compose/material/samples/SwipeableSamples.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerScreenshotTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/ScaffoldTest.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Drawer.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Scaffold.kt
A ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Swipeable.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Switch.kt
D ui/ui-material/src/commonMain/kotlin/androidx/compose/material/internal/StateDraggable.kt
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit e4894d0b99ea6360cc84bc2bc55d6f602e3b8b63
Author: Calin Tataru <calintat@google.com>
Date: Mon Jul 27 10:53:31 2020
Refactor stateDraggable and rename to swipeable
This CL does the following things:
* Rename Modifier.stateDraggable to Modifier.swipeable.
* Make swipeable public and mark it as ExperimentalMaterialApi.
* Introduce the concept of SwipeableState which holds the current state
of the swipeable as well as the animated float, and provides methods for
updating the state and subscribing to more granular in-movement updates.
* Rename DrawerState to DrawerValue, and introduce a new DrawerState
class which is a subclass of SwipeableState<DrawerValue> and provides
more contextual methods such as isOpen or open(). Same for BottomDrawer.
Bug: 148023068
Test: Ran DrawerTest, ScaffoldTest and SwitchTest
Relnote: "Modifier.stateDraggable was completely reworked and renamed
to Modifier.swipeable. A new SwipeableState class was introduced, and
DrawerState and BottomDrawerState were refactored to inherit from it.
[Modal/Bottom]DrawerLayout no longer take an onStateChange parameter."
Change-Id: I7233229dfc9c04a4615f4c1cc29e604b97edd1df
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/runtime/HotReloadIntegrationTests.kt
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/samples/src/main/java/androidx/compose/material/samples/DrawerSamples.kt
M ui/ui-material/samples/src/main/java/androidx/compose/material/samples/ScaffoldSamples.kt
A ui/ui-material/samples/src/main/java/androidx/compose/material/samples/SwipeableSamples.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerScreenshotTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/ScaffoldTest.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Drawer.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Scaffold.kt
A ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Swipeable.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Switch.kt
D ui/ui-material/src/commonMain/kotlin/androidx/compose/material/internal/StateDraggable.kt
https://android-review.googlesource.com/1362598
Branch: androidx-master-dev
commit e4894d0b99ea6360cc84bc2bc55d6f602e3b8b63
Author: Calin Tataru <calintat@google.com>
Date: Mon Jul 27 10:53:31 2020
Refactor stateDraggable and rename to swipeable
This CL does the following things:
* Rename Modifier.stateDraggable to Modifier.swipeable.
* Make swipeable public and mark it as ExperimentalMaterialApi.
* Introduce the concept of SwipeableState which holds the current state
of the swipeable as well as the animated float, and provides methods for
updating the state and subscribing to more granular in-movement updates.
* Rename DrawerState to DrawerValue, and introduce a new DrawerState
class which is a subclass of SwipeableState<DrawerValue> and provides
more contextual methods such as isOpen or open(). Same for BottomDrawer.
Bug: 148023068
Test: Ran DrawerTest, ScaffoldTest and SwitchTest
Relnote: "Modifier.stateDraggable was completely reworked and renamed
to Modifier.swipeable. A new SwipeableState class was introduced, and
DrawerState and BottomDrawerState were refactored to inherit from it.
[Modal/Bottom]DrawerLayout no longer take an onStateChange parameter."
Change-Id: I7233229dfc9c04a4615f4c1cc29e604b97edd1df
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/runtime/HotReloadIntegrationTests.kt
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/samples/src/main/java/androidx/compose/material/samples/DrawerSamples.kt
M ui/ui-material/samples/src/main/java/androidx/compose/material/samples/ScaffoldSamples.kt
A ui/ui-material/samples/src/main/java/androidx/compose/material/samples/SwipeableSamples.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerScreenshotTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/ScaffoldTest.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Drawer.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Scaffold.kt
A ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Swipeable.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Switch.kt
D ui/ui-material/src/commonMain/kotlin/androidx/compose/material/internal/StateDraggable.kt
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-master-dev
commit e4894d0b99ea6360cc84bc2bc55d6f602e3b8b63
Author: Calin Tataru <calintat@google.com>
Date: Mon Jul 27 10:53:31 2020
Refactor stateDraggable and rename to swipeable
This CL does the following things:
* Rename Modifier.stateDraggable to Modifier.swipeable.
* Make swipeable public and mark it as ExperimentalMaterialApi.
* Introduce the concept of SwipeableState which holds the current state
of the swipeable as well as the animated float, and provides methods for
updating the state and subscribing to more granular in-movement updates.
* Rename DrawerState to DrawerValue, and introduce a new DrawerState
class which is a subclass of SwipeableState<DrawerValue> and provides
more contextual methods such as isOpen or open(). Same for BottomDrawer.
Bug: 148023068
Test: Ran DrawerTest, ScaffoldTest and SwitchTest
Relnote: "Modifier.stateDraggable was completely reworked and renamed
to Modifier.swipeable. A new SwipeableState class was introduced, and
DrawerState and BottomDrawerState were refactored to inherit from it.
[Modal/Bottom]DrawerLayout no longer take an onStateChange parameter."
Change-Id: I7233229dfc9c04a4615f4c1cc29e604b97edd1df
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/runtime/HotReloadIntegrationTests.kt
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/samples/src/main/java/androidx/compose/material/samples/DrawerSamples.kt
M ui/ui-material/samples/src/main/java/androidx/compose/material/samples/ScaffoldSamples.kt
A ui/ui-material/samples/src/main/java/androidx/compose/material/samples/SwipeableSamples.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerScreenshotTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/ScaffoldTest.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Drawer.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Scaffold.kt
A ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Swipeable.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Switch.kt
D ui/ui-material/src/commonMain/kotlin/androidx/compose/material/internal/StateDraggable.kt
https://android-review.googlesource.com/1362598
Branch: androidx-master-dev
commit e4894d0b99ea6360cc84bc2bc55d6f602e3b8b63
Author: Calin Tataru <calintat@google.com>
Date: Mon Jul 27 10:53:31 2020
Refactor stateDraggable and rename to swipeable
This CL does the following things:
* Rename Modifier.stateDraggable to Modifier.swipeable.
* Make swipeable public and mark it as ExperimentalMaterialApi.
* Introduce the concept of SwipeableState which holds the current state
of the swipeable as well as the animated float, and provides methods for
updating the state and subscribing to more granular in-movement updates.
* Rename DrawerState to DrawerValue, and introduce a new DrawerState
class which is a subclass of SwipeableState<DrawerValue> and provides
more contextual methods such as isOpen or open(). Same for BottomDrawer.
Bug: 148023068
Test: Ran DrawerTest, ScaffoldTest and SwitchTest
Relnote: "Modifier.stateDraggable was completely reworked and renamed
to Modifier.swipeable. A new SwipeableState class was introduced, and
DrawerState and BottomDrawerState were refactored to inherit from it.
[Modal/Bottom]DrawerLayout no longer take an onStateChange parameter."
Change-Id: I7233229dfc9c04a4615f4c1cc29e604b97edd1df
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/runtime/HotReloadIntegrationTests.kt
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/samples/src/main/java/androidx/compose/material/samples/DrawerSamples.kt
M ui/ui-material/samples/src/main/java/androidx/compose/material/samples/ScaffoldSamples.kt
A ui/ui-material/samples/src/main/java/androidx/compose/material/samples/SwipeableSamples.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerScreenshotTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/ScaffoldTest.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Drawer.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Scaffold.kt
A ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Swipeable.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Switch.kt
D ui/ui-material/src/commonMain/kotlin/androidx/compose/material/internal/StateDraggable.kt
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-master-dev
commit e4894d0b99ea6360cc84bc2bc55d6f602e3b8b63
Author: Calin Tataru <calintat@google.com>
Date: Mon Jul 27 10:53:31 2020
Refactor stateDraggable and rename to swipeable
This CL does the following things:
* Rename Modifier.stateDraggable to Modifier.swipeable.
* Make swipeable public and mark it as ExperimentalMaterialApi.
* Introduce the concept of SwipeableState which holds the current state
of the swipeable as well as the animated float, and provides methods for
updating the state and subscribing to more granular in-movement updates.
* Rename DrawerState to DrawerValue, and introduce a new DrawerState
class which is a subclass of SwipeableState<DrawerValue> and provides
more contextual methods such as isOpen or open(). Same for BottomDrawer.
Bug: 148023068
Test: Ran DrawerTest, ScaffoldTest and SwitchTest
Relnote: "Modifier.stateDraggable was completely reworked and renamed
to Modifier.swipeable. A new SwipeableState class was introduced, and
DrawerState and BottomDrawerState were refactored to inherit from it.
[Modal/Bottom]DrawerLayout no longer take an onStateChange parameter."
Change-Id: I7233229dfc9c04a4615f4c1cc29e604b97edd1df
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/runtime/HotReloadIntegrationTests.kt
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/samples/src/main/java/androidx/compose/material/samples/DrawerSamples.kt
M ui/ui-material/samples/src/main/java/androidx/compose/material/samples/ScaffoldSamples.kt
A ui/ui-material/samples/src/main/java/androidx/compose/material/samples/SwipeableSamples.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerScreenshotTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/ScaffoldTest.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Drawer.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Scaffold.kt
A ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Swipeable.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Switch.kt
D ui/ui-material/src/commonMain/kotlin/androidx/compose/material/internal/StateDraggable.kt
https://android-review.googlesource.com/1362598
Branch: androidx-master-dev
commit e4894d0b99ea6360cc84bc2bc55d6f602e3b8b63
Author: Calin Tataru <calintat@google.com>
Date: Mon Jul 27 10:53:31 2020
Refactor stateDraggable and rename to swipeable
This CL does the following things:
* Rename Modifier.stateDraggable to Modifier.swipeable.
* Make swipeable public and mark it as ExperimentalMaterialApi.
* Introduce the concept of SwipeableState which holds the current state
of the swipeable as well as the animated float, and provides methods for
updating the state and subscribing to more granular in-movement updates.
* Rename DrawerState to DrawerValue, and introduce a new DrawerState
class which is a subclass of SwipeableState<DrawerValue> and provides
more contextual methods such as isOpen or open(). Same for BottomDrawer.
Bug: 148023068
Test: Ran DrawerTest, ScaffoldTest and SwitchTest
Relnote: "Modifier.stateDraggable was completely reworked and renamed
to Modifier.swipeable. A new SwipeableState class was introduced, and
DrawerState and BottomDrawerState were refactored to inherit from it.
[Modal/Bottom]DrawerLayout no longer take an onStateChange parameter."
Change-Id: I7233229dfc9c04a4615f4c1cc29e604b97edd1df
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/runtime/HotReloadIntegrationTests.kt
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/samples/src/main/java/androidx/compose/material/samples/DrawerSamples.kt
M ui/ui-material/samples/src/main/java/androidx/compose/material/samples/ScaffoldSamples.kt
A ui/ui-material/samples/src/main/java/androidx/compose/material/samples/SwipeableSamples.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerScreenshotTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/ScaffoldTest.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Drawer.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Scaffold.kt
A ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Swipeable.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Switch.kt
D ui/ui-material/src/commonMain/kotlin/androidx/compose/material/internal/StateDraggable.kt
Description
Motivation: This is key to create rich transitions and be able to update content based on what's going to happen. For example, imagine that you have a Draggable composable whose content must be shown/hidden at a threshold.
E.g. You might have something like this as a state:
enum class HomeState {
HomeBottomBarCollapsed,
HomeBottomBarContentReveal,
HomeBottomBaExpanded
}
I'd be nice to know that the current state is HomeBottomBarContentReveal but is moving towards HomeBottomBaExpanded so that I can show the content. Otherwise, if the movement is the opposite, then hide it.