Skip to content

Commit f791558

Browse files
committed
added initial doc
1 parent 2df5b4d commit f791558

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

toolkit/featureforms/src/main/java/com/arcgismaps/toolkit/featureforms/theme/DefaultThemeTokens.kt

+14
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,17 @@ import androidx.compose.ui.unit.sp
2929
*/
3030
private val DefaultSelectionColor = Color(0xFF4286F4)
3131

32+
/**
33+
* Provides a default [FeatureFormColorScheme] via [colorScheme] and a default [FeatureFormTypography]
34+
* via [typography].
35+
*
36+
*/
3237
internal object DefaultThemeTokens {
38+
39+
/**
40+
* The default values provided are hardcoded based on the material 3 light color scheme.
41+
* See [androidx.compose.material3.lightColorScheme].
42+
*/
3343
val colorScheme: FeatureFormColorScheme = FeatureFormColorScheme(
3444
editableTextFieldColors = EditableTextFieldColors(
3545
focusedTextColor = ColorTokens.OnSurface,
@@ -93,6 +103,10 @@ internal object DefaultThemeTokens {
93103
)
94104
)
95105

106+
/**
107+
* The default values provided are hardcoded based on the material 3 typography.
108+
* See [androidx.compose.material3.Typography]
109+
*/
96110
val typography: FeatureFormTypography = FeatureFormTypography(
97111
editableTextFieldTypography = EditableTextFieldTypography(
98112
labelStyle = TypographyTokens.bodySmall,

toolkit/featureforms/src/main/java/com/arcgismaps/toolkit/featureforms/theme/FeatureFormTheme.kt

+17
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ import androidx.compose.runtime.staticCompositionLocalOf
2727
import androidx.compose.ui.graphics.Color
2828
import androidx.compose.ui.text.TextStyle
2929

30+
/**
31+
* CompositionLocal used to pass a [FeatureFormTheme] down the tree.
32+
*/
3033
internal val LocalFeatureFormTheme: ProvidableCompositionLocal<FeatureFormTheme> =
3134
staticCompositionLocalOf {
3235
defaultTheme()
@@ -45,6 +48,17 @@ private fun defaultTheme(): FeatureFormTheme =
4548
)
4649

4750

51+
/**
52+
* Provides a default [FeatureFormTheme] to the given [content] so that the FeatureForm can be
53+
* customized.
54+
*
55+
* The default value for the [theme] is based on the current [MaterialTheme].
56+
* See [FeatureFormTheme.createDefaults] for more info on the exact configuration used.
57+
*
58+
* @param theme A complete definition for the [FeatureFormTheme] to use. A default is provided based
59+
* on the current [MaterialTheme].
60+
* @param content The content to which the [theme] should be applied.
61+
*/
4862
@Composable
4963
internal fun FeatureFormTheme(
5064
theme: FeatureFormTheme = FeatureFormTheme.createDefaults(),
@@ -54,6 +68,9 @@ internal fun FeatureFormTheme(
5468
CompositionLocalProvider(LocalFeatureFormTheme provides rememberedTheme) {
5569
content()
5670
}
71+
MaterialTheme {
72+
73+
}
5774
}
5875

5976
/**

0 commit comments

Comments
 (0)