Tuesday, September 27, 2022
HomeMobileAndroid Builders Weblog: Put on OS Tiles Materials Library: Construct Tiles, Quick.

Android Builders Weblog: Put on OS Tiles Materials Library: Construct Tiles, Quick.


val theme = Colours(

    /*major=*/ 0xFFD0BCFF.toInt(), /*onPrimary=*/ 0xFF381E72.toInt(),

    /*floor=*/ 0xFF202124.toInt(), /*onSurface=*/ 0xFFFFFFFF.toInt()

)

val buttonColors = ButtonColors.secondaryButtonColors(theme)

val chipColors = ChipColors.primaryChipColors(theme)

val timeline = Timeline.fromLayoutElement(
    PrimaryLayout.Builder(deviceParameters)

        .setPrimaryLabelTextContent(

            Textual content.Builder(this, “1 run this week”)

                .setTypography(Typography.TYPOGRAPHY_CAPTION1)

                .setColor(argb(theme.major))

                .construct()

        )

        .setContent(

            MultiButtonLayout.Builder()

                .addButtonContent(

                    Button.Builder(this, clickable)

                        .setIconContent(“icon_run”)

                        .setButtonColors(buttonColors)

                        .setContentDescription(“Run”)

                        .construct()

                )

                .addButtonContent(

                    Button.Builder(this, clickable)

                        .setIconContent(“icon_yoga”)

                        .setButtonColors(buttonColors)

                        .setContentDescription(“Yoga”)

                        .construct()

                )
                .addButtonContent(

                    Button.Builder(this, clickable)

                        .setIconContent(“icon_cycle”)

                        .setButtonColors(buttonColors)

                        .setContentDescription(“Cycle”)

                        .construct()

                )

                .construct()

        )

        .setPrimaryChipContent(

            CompactChip.Builder(this, “Extra”, clickable, deviceParameters)

                .setChipColors(chipColors)

                .construct()

        )

        .construct()

)

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular