Thread
#compose
    fabio.carballo

    fabio.carballo

    1 year ago
    what is the best practice regarding the
    Component
    to use to just represent the
    background
    ? I understand the in MaterialTheme the
    Surface
    has a similar goal, but it takes by default the
    surfaceColor
    . In my case where I want the same practical use but so that the background color is always
    backgroundColor
    . From looking at usages, it seems only
    Scaffold
    actually uses this color, but internally still uses a
    Surface
    and changes the background color.
    nickbutcher

    nickbutcher

    1 year ago
    either: 1 pass a different argument to surface
    Surface(color = MaterialTheme.colors.background,…
    or 2 Create a composable wrapping surface:
    @Composable fun BackgroundSurface(color: Color = MaterialTheme.colors.background, …) {
      Surface(color = color, …)
    }
    fabio.carballo

    fabio.carballo

    1 year ago
    ah great, I actually had followed number 2 ! thanks again for all the support here. the experience we are having of migrating our design system to Compose has been extremely good!