Status Update
Comments
si...@google.com <si...@google.com>
si...@google.com <si...@google.com>
si...@google.com <si...@google.com>
si...@google.com <si...@google.com>
si...@google.com <si...@google.com>
si...@google.com <si...@google.com> #3
Thanks for the report!
si...@google.com <si...@google.com>
si...@google.com <si...@google.com> #4
The release notes documentation has been edited to clarify this change in behavior for line height.
To support non-standard text sizes, we encourage users to follow the Material design system and use a different style = LocalTextStyle.current.copy(lineHeight = TextUnit.Unspecified)
, or create a custom Typography
entirely.
si...@google.com <si...@google.com> #5
si...@google.com <si...@google.com> #6
In my case, I have multiple font sizes in the same Text
(using SpanStyle
in AnnotatedString
). There are legitimate reasons for this. For example, when combining Chinese and English (phonetic) together (for language-learning purposes).
al...@gmail.com <al...@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)
lp...@google.com <lp...@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.
si...@google.com <si...@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)
si...@google.com <si...@google.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)
si...@google.com <si...@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.
ap...@google.com <ap...@google.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
Description
No description yet.