File tree 2 files changed +31
-0
lines changed
toolkit/featureforms/src/main/java/com/arcgismaps/toolkit/featureforms/theme
2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,17 @@ import androidx.compose.ui.unit.sp
29
29
*/
30
30
private val DefaultSelectionColor = Color (0xFF4286F4 )
31
31
32
+ /* *
33
+ * Provides a default [FeatureFormColorScheme] via [colorScheme] and a default [FeatureFormTypography]
34
+ * via [typography].
35
+ *
36
+ */
32
37
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
+ */
33
43
val colorScheme: FeatureFormColorScheme = FeatureFormColorScheme (
34
44
editableTextFieldColors = EditableTextFieldColors (
35
45
focusedTextColor = ColorTokens .OnSurface ,
@@ -93,6 +103,10 @@ internal object DefaultThemeTokens {
93
103
)
94
104
)
95
105
106
+ /* *
107
+ * The default values provided are hardcoded based on the material 3 typography.
108
+ * See [androidx.compose.material3.Typography]
109
+ */
96
110
val typography: FeatureFormTypography = FeatureFormTypography (
97
111
editableTextFieldTypography = EditableTextFieldTypography (
98
112
labelStyle = TypographyTokens .bodySmall,
Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ import androidx.compose.runtime.staticCompositionLocalOf
27
27
import androidx.compose.ui.graphics.Color
28
28
import androidx.compose.ui.text.TextStyle
29
29
30
+ /* *
31
+ * CompositionLocal used to pass a [FeatureFormTheme] down the tree.
32
+ */
30
33
internal val LocalFeatureFormTheme : ProvidableCompositionLocal <FeatureFormTheme > =
31
34
staticCompositionLocalOf {
32
35
defaultTheme()
@@ -45,6 +48,17 @@ private fun defaultTheme(): FeatureFormTheme =
45
48
)
46
49
47
50
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
+ */
48
62
@Composable
49
63
internal fun FeatureFormTheme (
50
64
theme : FeatureFormTheme = FeatureFormTheme .createDefaults(),
@@ -54,6 +68,9 @@ internal fun FeatureFormTheme(
54
68
CompositionLocalProvider (LocalFeatureFormTheme provides rememberedTheme) {
55
69
content()
56
70
}
71
+ MaterialTheme {
72
+
73
+ }
57
74
}
58
75
59
76
/* *
You can’t perform that action at this time.
0 commit comments