Status Update
Comments
se...@google.com <se...@google.com>
ap...@google.com <ap...@google.com> #2
Branch: androidx-master-dev
commit c60f33e229e31ab328ef6b59dab63b264954831c
Author: Alexandre Elias <aelias@google.com>
Date: Fri Jul 10 16:23:09 2020
Semantics no-op cleanups
Partly in response to lmr's broad code review, I did a pass of
superficial API/implementation cleanup. The main changes are:
- I changed each Boolean SemanticsProperty where false is equivalent to
not being present to take "Unit" instead. This is conceptually
clearer: it avoids questions like "can I cancel out a semantics from a
merged child by setting it to false?" Because "property = Unit" looks
weird, I also changed the style of these to "property()".
- I moved the Semantics id generator closer to where it's used, in
SemanticsModifierCore. I made it internal and an AtomicInt.
(Note that integer ids are heavily used in the Android
AccessibilityNodeInfo APIs so I can't simply remove them entirely.)
- I deleted dead code. Some examples include SemanticsHintOverrides,
a public API not connected to anything, and SemanticsPropertyKey
merge() open method which is never called. (In both cases I have
a different plan in mind for accessibility.)
Fixes: 145951226
Fixes: 145955412
Test: existing tests
Relnote: "Single-value semantics properties now use a calling style.
For example, 'semantics { hidden = true }' is now written as:
'semantics { hidden() }'."
Change-Id: Ic1afd12ea22c926babc9662f1804d80b33aa0cfc
M ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/LayoutNodeModifierBenchmark.kt
M ui/ui-core/api/0.1.0-dev15.txt
M ui/ui-core/api/current.txt
M ui/ui-core/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-core/api/public_plus_experimental_current.txt
M ui/ui-core/api/restricted_0.1.0-dev15.txt
M ui/ui-core/api/restricted_current.txt
M ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/graphics/vector/VectorTest.kt
M ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/semantics/SemanticsTests.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidActuals.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeView.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeViewAccessibilityDelegateCompat.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidPopup.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Expect.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsConfiguration.kt
D ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsHintOverrides.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsModifier.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsNode.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsOwner.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsWrapper.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/semantics/SemanticsProperties.kt
M ui/ui-foundation/api/0.1.0-dev15.txt
M ui/ui-foundation/api/current.txt
M ui/ui-foundation/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-foundation/api/public_plus_experimental_current.txt
M ui/ui-foundation/api/restricted_0.1.0-dev15.txt
M ui/ui-foundation/api/restricted_current.txt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Clickable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Dialog.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Scroller.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Selectable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Toggleable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/semantics/FoundationSemanticsProperties.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/CardTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonScreenshotTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ScaffoldTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/SnackbarTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/SurfaceTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ripple/RippleIndicationTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldScreenshotTest.kt
M ui/ui-material/src/main/java/androidx/ui/material/AppBar.kt
M ui/ui-material/src/main/java/androidx/ui/material/TextFieldImpl.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/AssertsTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/CallSemanticsActionTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/PrintToStringTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/ScrollToTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
M ui/ui-test/src/main/java/androidx/ui/test/Actions.kt
M ui/ui-test/src/main/java/androidx/ui/test/Filters.kt
M ui/ui-text/api/0.1.0-dev15.txt
M ui/ui-text/api/current.txt
M ui/ui-text/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-text/api/public_plus_experimental_current.txt
M ui/ui-text/api/restricted_0.1.0-dev15.txt
M ui/ui-text/api/restricted_current.txt
M ui/ui-text/src/commonMain/kotlin/androidx/ui/text/CoreTextField.kt
M ui/ui-text/src/commonMain/kotlin/androidx/ui/text/TextSemanticsProperties.kt
an...@microsoft.com <an...@microsoft.com> #3
Tested with 1.2-alpha02. There are some improvements but the cases still all have problems.
Pixel 4a landscape is not clipping the bottom of the sheet anymore, but a white box is appearing on the right side of the screen the size of the system navigation buttons when not using gesture navigation.
Pixel C API33 emulator in landscape the bottomsheet is now sized so all the items would be visible, IF it was appearing over top the system navigation bar, but the bottom is behind it still in that tablet case. On a Pixel C API29 emulator in landscape the bottomsheet appears on top of the system navigation bar, but taps are not being recognized on that are. (don't have samsung s5e tablet with android 9 to test right now)
in the sample and our usage, we are not using edge to edge mode or full scaffold infrastructure (actual app usage is with a ComposeView thats not full screen)
se...@google.com <se...@google.com>
se...@google.com <se...@google.com>
se...@outlook.de <se...@outlook.de> #4
This is really a big problem. So unfortunately we cannot use the ModalBottomSheet productively yet.
When can we expect a correction?
pr...@oodles.io <pr...@oodles.io> #5
ki...@protonmail.com <ki...@protonmail.com> #6
Any updates on this?
bo...@gmail.com <bo...@gmail.com> #7
ra...@gmail.com <ra...@gmail.com> #8
Some news about that?
ri...@gmail.com <ri...@gmail.com> #9
si...@gmail.com <si...@gmail.com> #10
Without edge-to-edge enabled (`decorFitsSystemWindows` is true) material ModalBottomSheet works incorrect, it always overlaps navigation bar.
I tried different solutions, but the only one that works for me is very ugly:
```
@Composable
@SuppressLint("DiscouragedApi")
// todo:
private fun rememberDimensionByName(name: String): Int {
val resources = LocalContext.current.resources
return remember {
val id = resources.getIdentifier(name, "dimen", "android")
if (id == 0) 0 else resources.getDimensionPixelSize(id)
}
}
<...>
val topInsets = WindowInsets(top = rememberDimensionByName("status_bar_height"))
val bottomInsets = WindowInsets(bottom = rememberDimensionByName("navigation_bar_height"))
ModalBottomSheet(
...
windowInsets = topInsets,
content = {
Box(Modifier.padding(bottomInsets.asPaddingValues())) {
...
}
},
)
```
android plugin "8.2.2"
kotlin version "1.9.22"
kotlinCompilerExtensionVersion = "1.5.8"
androidx.activity:activity-compose:1.8.2
androidx.compose.ui:ui:1.6.0
androidx.compose.material3:material3:1.1.2
ty...@gmail.com <ty...@gmail.com> #11
di...@gmail.com <di...@gmail.com> #12
Yes, I still see the issue as well even with edge to edge enabled.
he...@gmail.com <he...@gmail.com> #13
se...@google.com <se...@google.com>
ma...@gmail.com <ma...@gmail.com> #14
he...@gmail.com <he...@gmail.com> #15
za...@gmail.com <za...@gmail.com> #16
sh...@zohocorp.com <sh...@zohocorp.com> #17
Any update on this?
se...@google.com <se...@google.com> #18
We are working on moving the underlying logic to a dialog implementation which should improve this experience in a variety of devices. Apologies for the delay on this. In the meantime, I have the first iteration of this change here:
Would appreciate any and all eyes on this, and especially any manual testing that can be done on a variety of devices/edge cases.
ap...@google.com <ap...@google.com> #19
Branch: androidx-main
commit 33c32f65dd7879954cfa7a46a76eb959c977e291
Author: Jose Figueroa <serniebanders@google.com>
Date: Tue Mar 19 17:08:01 2024
[M3][BottomSheet] Migrate bottom sheet to dialog implementation from popup.
Dialog provides access to the new window created, which allows for system bars styling, setDecorFitsSystemWindows for edge to edge functionality, and unconsumed window insets for proper content padding.
Bug: 274872542
Bug: 300280229
Bug: 290893168
Test: "Existing tests now check for dialog, toggle decorFitsSystemWindows for edge to edge. Added Unit Test for content window inset consumption. Manual testing on API 28, 31, 33, 34 on Pixel 4a, 7, 8, Tablet, and Samsung Galaxy S24"
RelNote: "ModalBottomSheet more accurately draws scrim over status bar when edge to edge is enabled. Modal bottom sheet content can now consume window insets, allowing for visible content above navigation bar. ModalBottomSheet parameter windowInsets renamed to contentWindowInsets to specify where the insets will be applied, these are no longer tied to window logic. contentWindowInsets type has been changed to a function which returns WindowInsets, to allow it to be resolved within its new window."
Change-Id: I39630f2d9a1b159ef27fa62750ffa26b00e078a0
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/restricted_current.txt
M compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/common/CatalogScaffold.kt
M compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/BottomSheetSamples.kt
M compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ModalBottomSheetTest.kt
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/ModalBottomSheet.android.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/SheetDefaults.kt
A compose/material3/material3/src/main/res/values-v30/styles.xml
A compose/material3/material3/src/main/res/values/styles.xml
bo...@gmail.com <bo...@gmail.com> #20
ab...@gmail.com <ab...@gmail.com> #21
se...@google.com <se...@google.com> #22
I believe the following change will land alongside 1.3.0-alpha06. In the meantime, going to leave this bug open to allow some soak time.
pe...@gmail.com <pe...@gmail.com> #23
se...@google.com <se...@google.com> #24
Looking into this styling issue with the status bar. Follow
se...@google.com <se...@google.com> #25
A proposed fix for this bug has been landed in our latest beta release. The bottom sheet window now extends edge to edge by default, and the content padding parameter, alongside with content tagged with system bar padding modifiers should now appropriately move content outside of the nav bar area.
ma...@olxbr.com <ma...@olxbr.com> #26
jb...@anthropic.com <jb...@anthropic.com> #27
This solution seems to work well for the nav bar area, but now bottom sheets with very long content draw behind the status bar at the top of the screen. By default, the grab bar will end up behind the status bar in this case. It isn't obvious how to apply the status bar padding here so that the bottom sheet doesn't go behind it.
As a workaround, you can apply padding to the top of the sheet, but it seems like something that should be handled by default.
ModalBottomSheet(
modifier = Modifier.windowInsetsPadding(WindowInsets.statusBars)
) {
...
}
ni...@carfax.com <ni...@carfax.com> #28
onDismissRequest = { onDismiss() },
sheetState = state,
dragHandle = { BottomSheetDefaults.DragHandle() },
modifier = Modifier.statusBarsPadding().navigationBarsPadding()
) {
//Compose Body
}
Similar issue I was facing while showing BottomSheet in full screen. I did some experiment with modifier and it worked.
My design requirement was to show full screen BottomSheet but below toolbar so I've added two properties.
Description
Jetpack Compose version: 1.4.0, material3 1.1.0-beta01 Jetpack Compose component used: material3 Android Studio Build: Kotlin version: 1.8.10
Steps to Reproduce or Code Sample to Reproduce: Use M3 ModalBottomSheet API with some text content. Finding many scenarios where the bottom of the sheet is not displayed, can't be pulled up. Some examples where cut off:
Sample code:
Some examples attached. Pixel4a working is what it should show, items 1, 2, 3 but in landsacpe its cutoff, pixel c emulator its cutoff in all orientations