The most annoying thing for me now is `androidx.co...
# compose-desktop
o
The most annoying thing for me now is
androidx.compose.material.Text
vs
androidx.compose.foundation.Text
🙂 Not that big deal, but since I use a lot of
Image
components, the foundation’s Text comes into place in almost every situation. Do you plan to bring some order into packages/components?
j
There is no
androidx.compose.foundation.Text
is there? It should be
androidx.compose.material.Text
and
androidx.compose.foundation.text.BasicText
IIRC. The former understands material terminology, themes, etc. The later is design-system-agnostic and used as a building block for material as well as any other design system that wants to provide a text widget.
As a general rule of thumb, anything in
foundation
is design system agnostic and may require a bit more work to use, but more general purpose / foundational for any design system. Anything in
material
is highly opinionated and design system specific.
o
Copy code
package androidx.compose.foundation

…

@Deprecated(
    message = "Use androidx.compose.material.Text for a high level Text component that " +
        "consumes theming information, or androidx.compose.foundation.text.BasicText for a basic " +
        "unopinionated component that does not have default theming",
    replaceWith = ReplaceWith(
        "Text(text, modifier, color, fontSize, fontStyle, fontWeight, fontFamily, " +
            "letterSpacing, textDecoration, textAlign, lineHeight, overflow, softWrap, maxLines, " +
            "onTextLayout, style)",
        "androidx.compose.material.Text"
    )
)
@Composable
fun Text(
It’s deprecated, but it is still there
j
Ah, ok, that exists only for binary compatibility/migration. That will presumably be deleted before a
1.0
release.
o
If it’s for binary compatibility, may be make it DeprecationLevel.HIDDEN?
j
Yeah, or since it has been a couple months, I think I'd just delete it at this point. I'll post a CL now and see what @Siyamed thinks.
s
Sounds good, it has been a while
Actually i want to do a cleanup on deprecated apis