Fixed
Status Update
Comments
st...@gmail.com <st...@gmail.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.
ma...@google.com <ma...@google.com>
na...@google.com <na...@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).
Description
Jetpack Compose version: 2024.02.01
Jetpack Compose component used: material3:1.2.0
Android Studio Build: N/A
Kotlin version: 1.9.22
As I was calling the bottom sheet, I was calling the colors function like this
but the latest material3 version is not providing sane defaults as it used to for the colors that I am not specifying explicitly. Instead I get black text on dark and light mode since I am not specifying a specific color for selectedTextColor and unselectedTextColor.
These lines herehttps://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationBar.kt;l=312-321?q=NavigationBarItemDefaults are the ones that probably break this behavior. Which was introduced here https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationBar.kt;l=312-321?q=NavigationBarItemDefaults
This Unspecified color is then used over here https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationBar.kt;l=445-451?q=NavigationBarItemDefaults
Interestingly, the deprecated method which says "Use overload with disabledIconColor and disabledTextColor", does seem to properly set some sane defaults for the parameters you may not be specifying.
In contrast, for NavRail this was not broken in the latest update, see herehttps://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationRail.kt;l=308-317?q=NavigationRailItemDefaults
I would expect here to get either a more sane default meaning something from the MaterialTheme which is more likely to have the right value for dark and light mode like it did before. This simply breaks the layout completely as the text is completely illegible by default.