Status Update
Comments
ha...@gmail.com <ha...@gmail.com> #2
jo...@google.com <jo...@google.com> #3
see
jo...@google.com <jo...@google.com> #4
Can you please check if this task can be finished before June, and if not remove `Jetpack Compose Major Release (May 2020)` hotlist?
(apologies if this is a double comment)
Thank you
jo...@google.com <jo...@google.com> #5
Please ignore last comment related to the June release. It was caused by a mistake in the query I used. Thank you.
jo...@google.com <jo...@google.com> #6
further postponing to category 3, since it doesn't look like we can accomplish this one. If time allows one of us will pick it up during category 2.
ha...@gmail.com <ha...@gmail.com> #7
out of curiousity… if this isnt immediately planned, have you considered changing he default colors at all? a couple things i noticed:
(1) i could see the choice of purple + blue clashing with a number of existing apps, and maybe there are some better defaults that could be used to at least make the colors stand out less.
(2) the defaults don’t support dark mode very well. in our app, the dark purple handles on top of a primary dark mode background has only a 2.14:1 color contrast ratio (whereas in light mode the contrast is 8.98:1)
jo...@google.com <jo...@google.com> #8
I agree with
Siyamed, if you / your team does not have time to look at this, feel free to assign to me - happy to take this over. As well as allowing changing the color, MaterialTheme
should also be configured to set a color from the theme by default so that it is correct out of the box for typicaly use cases.
ha...@gmail.com <ha...@gmail.com> #9
related:
ap...@google.com <ap...@google.com> #10
Thanks Louis.
Please keep in mind there are two main entry points: Text selection and TextField selection. as a note: In TextField it is possible that existing cursorColor defines those colors (or one of them)
jo...@google.com <jo...@google.com>
ha...@gmail.com <ha...@gmail.com> #11
it would be best to control selection as a whole for both of them I believe, but let's discuss it. Looks like material.TextField uses errorColor and activeColor as the cursor color. let's make sure we take that into account while designing the theming (they seem to be related)
jo...@google.com <jo...@google.com> #12
open questions, assumptions that need verification:
- is cursorColor and selection color the same
- cursorColor is errorColor and activeColor in material.TextField, is there any relation
- Text and TextField should use a single selection color for consistency
- selection color is always the same for selection handle and selection background
- cursor color determines insertion (cursor) handle color as well (we do not have cursor handle yet)
- what the default color should be for light and dark mode
- shape of the cursor handle is not urgent, and possibly something we specifically don't want customization for the phone end user experience (similar to cursor animation)
- can there be a default color in foundation? choosing the text color, bg color etc too tricky. Using the exact text color wouldn't work since it would make text invisible.
ha...@gmail.com <ha...@gmail.com> #13
Branch: androidx-master-dev
commit 93195d42d1f079136053e33ccec6e7d5ac839dfe
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Tue Nov 17 15:20:25 2020
Adds AmbientTextSelectionColors to allow customizing the colors used for text selection
Also sets the correct Material defaults in MaterialTheme
Bug:
Bug:
Test: MaterialTextSelectionColorsScreenshotTest
Test: TextSelectionColorsScreenshotTest
Test: TextSelectionBackgroundColorTest
Relnote: "MaterialTheme now sets the correct colors for selection handles and selection background. Non-Material apps can manually use AmbientTextSelectionColors to customize the colors used for selection."
Change-Id: I1e6f4b495bdc713e162759a08ecf0a7311b26e33
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/TextFieldDelegateIntegrationTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreText.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.kt
M compose/material/material/api/current.txt
M compose/material/material/api/public_plus_experimental_current.txt
M compose/material/material/api/restricted_current.txt
A compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/MaterialTextSelectionColorsScreenshotTest.kt
A compose/material/material/src/commonMain/kotlin/androidx/compose/material/MaterialTextSelectionColors.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/MaterialTheme.kt
A compose/material/material/src/test/kotlin/androidx/compose/material/TextSelectionBackgroundColorTest.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/selection/SelectionHandlesTest.kt
A compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/selection/TextSelectionColorsScreenshotTest.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/selection/SelectionHandles.kt
A compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/selection/TextSelectionColors.kt
pr...@google.com <pr...@google.com> #14
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material:material:1.4.0-alpha05
Description
Jetpack Compose version: 1.4.0-alpha04
Jetpack Compose component used: ModalBottomSheetLayout
Android Studio Build: Electric Eel 2022.1.1 #AI-221.6008.13.2211.9477386
Kotlin version: 1.7.21
Repo:https://github.com/hakonschia/bottomsheetcrash
The updated ModalBottomSheetLayout in 1.4.0-alpha04 seems to have some issues. I have observed two cases where it crashes with
Key HalfExpanded is missing in the map
. The linked repo contains both scenarios.First scenario:
I'll add that the bottom sheet "floats" above the bottom of the screen, which seems like a new bug introduced in alpha04. In the example repo this only happens when the sheet is opened in landscape. If I open it in portrait and then rotate, it doesn't happen. It also doesn't crash in this case, so it seems this might be related. This is visible in the video attached.
Second scenario:
The updated ModalBottomSheetLayout is supposed to support empty sheet content, but when going from empty content to some content it crashes.
Steps to reproduce:
I'll add here that I have had to do this hack with empty content to avoid the bottom sheet sometimes being visible when it shouldn't, for example when resizing the window in Picture-in-Picture mode (which might be related to https://issuetracker.google.com/issues/260517771 ). I've added a button to enter PiP where this issue can be seen by removing the logic to not render the content when not visible.
Adding
Spacer(Modifier.height(1.dp))
fixes this crash, which is what I had to do previously anyways since empty content wasn't supported, but I'd like to remove this hack.Stack trace (if applicable):