Skip to content

Fluent Data Structure

mishramayank1 edited this page Jan 2, 2023 · 4 revisions

StateColor: It hold color for different interactions state.

data class StateColor(
    val rest: Color = Color.Unspecified,
    val pressed: Color = Color.Unspecified,
    val selected: Color = Color.Unspecified,
    val focused: Color = Color.Unspecified,
    val selectedPressed: Color = Color.Unspecified,
    val selectedFocused: Color = Color.Unspecified,
    val selectedDisabled: Color = Color.Unspecified,
    val disabled: Color = Color.Unspecified
)

FluentColor : It is hold color for both light & dark mode. If the dark color is not set then the light color would be used for same. It emit the color as per the mode set in FluentTheme.

data class FluentColor(
    val light: Color,
    val dark: Color = light,
)

FluentStyle: It represents the style of control. Its values are Netural or Brand.

enum class FluentStyle {
    Neutral,
    Brand
}

StateElevation: It represents the elevation in different interactions state.

data class StateElevation(
    val rest: Dp = 0.dp,
    val pressed: Dp = 0.dp,
    val selected: Dp = 0.dp,
    val selectedPressed: Dp = 0.dp,
    val selectedFocused: Dp = 0.dp,
    val selectedDisabled: Dp = 0.dp,
    val focused: Dp = 0.dp,
    val disabled: Dp = 0.dp,
)

FontSize: It hold size & lineheight for text

data class FontSize(val size: TextUnit, val lineHeight: TextUnit)

FontInfo: It hold font name, fontSize, weight.

data class FontInfo(
        val name: String? = null,
        val fontSize: FontSize,
        val weight: FontWeight = FontWeight.Normal
)

StateBorderStroke: It hold list of BorderStroke for different interaction state.

data class StateBorderStroke(
    val rest: List<BorderStroke> = listOf(BorderStroke(0.dp, Color(0, 0, 0, 0))),
    val pressed: List<BorderStroke> = listOf(BorderStroke(0.dp, Color(0, 0, 0, 0))),
    val selected: List<BorderStroke> = listOf(BorderStroke(0.dp, Color(0, 0, 0, 0))),
    val selectedPressed: List<BorderStroke> = listOf(BorderStroke(0.dp, Color(0, 0, 0, 0))),
    val selectedFocused: List<BorderStroke> = listOf(BorderStroke(0.dp, Color(0, 0, 0, 0))),
    val selectedDisabled: List<BorderStroke> = listOf(BorderStroke(0.dp, Color(0, 0, 0, 0))),
    val focused: List<BorderStroke> = listOf(BorderStroke(0.dp, Color(0, 0, 0, 0))),
    val disabled: List<BorderStroke> = listOf(BorderStroke(0.dp, Color(0, 0, 0, 0))),
)
Clone this wiki locally