Status Update
Comments
ap...@google.com <ap...@google.com> #2
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
ca...@google.com <ca...@google.com> #3
I added a rememberSwipeableState
function to easily create and remember a SwipeableState
with the default animation clock. That should work perfectly for your usecase.
bl...@gmail.com <bl...@gmail.com> #4
Regression in material3: the function is now marked internal. Please re-open.
ma...@google.com <ma...@google.com> #6
Thanks for your feedback. We are looking into the ways of improving the current Mosidifer.swipeable, it has a number of critical bugs and we don't want to publish it as-is in material3. Stay tuned
ke...@gmail.com <ke...@gmail.com> #7
I would like to add one thing (if it's not planned in the new swipeable() yet).
Right now, if you add an anchor, lets say 0..100 then it works as expected if you swipe from left (0) to right (100). However when doing the opposite swipe (from right 100 to left 0), instead of just not doing anything, swipeable shows the "overscroll" (or rather "overstretch") effect and consumes the scroll events if it's located in a horizontally scrollable container.
For example, let's say I want to put swipeable elements inside of the drawer. I want to be able to swipe to the right to "remove" the elements but I also want to be able to close the drawer by swiping to the left. Right now the drawer is impossible to close by swiping to the left. There needs to be some kind of a flag to disable this default behavior and to hint the swipeable to not consume scroll events in this and similar cases.
Description
Currently creating a
SwipeableState
involves some boiler-plate:SwipeableState
AnimationClockObservable
is and how I procure one.remember
it.A factory function producing this for me would be very convenient.