Status Update
Comments
se...@google.com <se...@google.com> #2
Branch: androidx-main
commit a330c0d3bcdd41326f37968a60e6084ad4a2e32c
Author: Chet Haase <chet@google.com>
Date: Wed Jul 05 07:26:46 2023
Convert APIs using PointF to use Float instead
PointF is a convenient mechanism for passing around x.y values
representing 2D points. But there are downsides, including:
- Converting to PointF: You may not have the data in PointF form
to begin with, so using an API which takes PointF requires converting
the data to that form (including allocating a PointF object every time)
- Mutability: Point structures can be mutated internally, causing
unpredictability in what that mutation means. Should the library
react to those changes? Ignore them? Do defensive copies (requiring
even more allocations)? Using primitive types like Float make the
behavior more obvious (by making the data inherently immutable).
- Allocations: Whenever we use object types, there are necessarily
allocations on the Java heap for them. This puts pressure on the GC
at both allocation and collection time. Given the amount of points
being passed around (especially at morph creation time, when curves
are being split and created), this causes a lot of PointF objects to
be allocated (even temporarily). Using Float avoids that problem.
Also fixed bug with unclosed paths causing discontinuity at the
start/end point.
Bug: 276466399
Bug: 290254314
Test: integration and unit tests pass
Relnote: PointF parameters changed to Float pairs
Change-Id: Id4705d27c7be31b26ade8186b99fffe2e2f8450e
M graphics/graphics-shapes/api/current.txt
M graphics/graphics-shapes/api/restricted_current.txt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/CubicShapeTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/CubicTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/PolygonMeasureTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/PolygonTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/RoundedPolygonTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/ShapesTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/TestUtils.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/Cubic.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/CubicShape.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/FeatureMapping.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/FloatMapping.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/Morph.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/PolygonMeasure.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/RoundedPolygon.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/Shapes.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/Utils.kt
M graphics/integration-tests/testapp-compose/src/main/java/androidx/graphics/shapes/testcompose/DebugDraw.kt
M graphics/integration-tests/testapp-compose/src/main/java/androidx/graphics/shapes/testcompose/ShapeEditor.kt
M graphics/integration-tests/testapp/src/main/java/androidx/graphics/shapes/test/MaterialShapes.kt
ri...@google.com <ri...@google.com> #3
se...@google.com <se...@google.com> #4
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.graphics:graphics-shapes:1.0.0-alpha04
co...@google.com <co...@google.com>
ri...@google.com <ri...@google.com> #5
Thanks José - I've reviewed the CL, the adding of WindowInsets
solves my issue - I left a comment on adding the edgeToEdgeEnabled
parameter, I don't think that should be added.
I'm not sure I follow the top of the screen issue, what would happen if I set a custom amount for the top of the screen? Would you be able to add a video recording of how that works? Thank you.
co...@google.com <co...@google.com>
se...@google.com <se...@google.com>
ap...@google.com <ap...@google.com> #6
Branch: androidx-main
commit 46eea23c96f45f0ee1e57d8aef2f1375507b0dec
Author: José Figueroa Santos <serniebanders@google.com>
Date: Tue Apr 11 14:38:58 2023
[M3][ModalBottomSheet] Enable edge to edge functionality for ModalBottomSheet
Bug: 274872542
Bug: 272973615
Bug: 272334475
Bug: 268432129
Bug: 275849044
Bug: 275486106
Bug: 268433162
RelNote: Add window insets parameter to ModalBottomSheet.
RelNote: Scrim for ModalBottomSheet may now be drawn behind status bar with windowInsets set to zero
RelNote: Updated default ModalBottomSheet functionality to stay outside of system bars including navigation
RelNote: Status bar inset handling is provided by drag handle in edge-to-edge mode.
RelNote: BottomSheetDefaults includes window insets for BottomSheetWindow.
Test: Parameterizes existing tests to work with and without edgeToEdge enabled.
Test: Manual EdgeToEdge testing on various devices and android APIs
Change-Id: I312008e48573ebd21326f77216be0bcd0372aa78
M compose/material3/material3/api/public_plus_experimental_current.txt
M compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/BottomSheetSamples.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/ModalBottomSheetTest.kt
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/ModalBottomSheet.android.kt
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/Strings.android.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/SheetDefaults.kt
se...@google.com <se...@google.com>
ju...@google.com <ju...@google.com> #7
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material3:material3:1.2.0-alpha02
androidx.compose.material3:material3-android:1.2.0-alpha02
pr...@google.com <pr...@google.com> #8
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material3:material3:1.1.1
di...@zillowgroup.com <di...@zillowgroup.com> #9
When I try to replace the default windowInsets value with something like WindowInsets.navigationBars, it doesn't help because the values are zero at the time of calling ModalBottomSheet(). Placing a hard-coded bottom padding value in the windowInsets object does have an effect when the bottom sheet is expanded, but I can't figure out how to determine the correct padding value since the WindowInsets.navigationBars values are zero.
Specifically, I am experiencing the issue when using Compose BOM 2023.06.01, but not with 2023.05.01.
ar...@gmail.com <ar...@gmail.com> #10
On affected systems the ModalBottomSheet is always aligned to the bottom of the screen.
We see this on Android <= 10 (you can easily see this on an Android 10 emulator, while the Android 13 emulator works).
However, some users report this for Android 13 (only three reports, yet).
I guess it doesn't bother many Android 13 users (most of our users have it), because I think the default is gesture navigation, and while you can see that it overlaps, it doesn't hurt much.
At least with 3-button navigation, you have a hard time to touch the application buttons behind the navigation buttons.
id...@trivago.com <id...@trivago.com> #11
hu...@gmail.com <hu...@gmail.com> #12
Facing the same issue. ModalBottomSheet does not allow the sheet content to be padded rather it places the sheet dialog on top of navigation bars. This way if the sheet container has a background color there's an obvious white line equal to navigation bar inset. Supplying WindowInsets(0,0,0,0) to cancel out bottom paddings & trying to pad content manually doesn't work since within the content navigation insets are returned 0.
ex...@isn.com <ex...@isn.com> #13
I’m experiencing the same issue with ModalBottomSheet
when using material3
B.O.M 2023.06.01
(v1.1.1). This problem does not occur with B.O.M 2023.05.01
(v1.1.0).
Things I Tried (No Luck):
- No modifiers: Used only the default
BottomSheetDefaults.windowInsets
. - Applied the
.safeDrawingPadding()
modifier. - Applied the
.statusBarsPadding()
modifier.
Observations (Screenshots Below):
- #1: The BottomSheet is
edgeToEdge
, covering the status bar content. - #2: Adds way too much padding—more than what’s necessary.
- #3: Adds extra padding, but slightly less than #2.
Temporary Solution:
For now, I’ve downgraded back to B.O.M 2023.05.01
, hopefully, newer versions of material3
(v1.1.1+) will resolve this issue, however, updating to the most recent ones (1.3+) requires tackling significant tech debt.
Description
After looking through all components that support Insets,
ModalBottomSheet
doesn't expose the option to change theWindowInset
that it applies. This goes against the other components that use insets.All the other components (
TopAppBar
,BottomAppBar
etc), expose awindowInsets
parameter. Any component that consumes a window inset, should allow for this to be changed as not everyone is using insets in the exact same standard way.