Skip to content

Commit 8185418

Browse files
authored
Forms : Read only fields re-design (#346)
1 parent 9799209 commit 8185418

File tree

11 files changed

+265
-295
lines changed

11 files changed

+265
-295
lines changed

toolkit/featureforms/README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ FeatureForm(
101101

102102
#### Text Fields
103103
- Outline color - `MaterialTheme.colorScheme.outline`
104-
- Label TextStyle - `MaterialTheme.typography.bodyMedium`
104+
- Label TextStyle - `MaterialTheme.typography.bodySmall`
105105
- Input TextStyle - `MaterialTheme.typography.bodyLarge`
106106
- SupportingText TextStyle - `MaterialTheme.typography.bodySmall`
107107
- Error color - `MaterialTheme.colorScheme.error`
@@ -121,6 +121,8 @@ FeatureForm(
121121
- Description TextStyle - `MaterialTheme.typography.bodySmall`
122122

123123
#### Read-Only Fields
124-
Alpha values for read only fields cannot be customized at this time.
124+
- Label TextStyle - `MaterialTheme.typography.bodyMedium`
125+
- Input TextStyle - `MaterialTheme.typography.bodyLarge`
126+
- SupportingText TextStyle - `MaterialTheme.typography.bodySmall`
125127

126128
More information on the material 3 specs [here](https://m3.material.io/components/text-fields/specs#e4964192-72ad-414f-85b4-4b4357abb83c)

toolkit/featureforms/src/androidTest/java/com/arcgismaps/toolkit/featureforms/FormTextFieldTests.kt

+4-11
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ class FormTextFieldTests {
115115
val label = composeTestRule.onNodeWithContentDescription(labelSemanticLabel)
116116
label.assertIsDisplayed()
117117

118-
val supportingText = composeTestRule.onNode(hasContentDescription(supportingTextSemanticLabel), useUnmergedTree = true)
119-
supportingText.assertExists()
118+
composeTestRule.onNode(hasContentDescription(supportingTextSemanticLabel), useUnmergedTree = true).assertDoesNotExist()
120119
}
121120

122121
/**
@@ -134,9 +133,7 @@ class FormTextFieldTests {
134133
val label = composeTestRule.onNodeWithContentDescription(labelSemanticLabel)
135134
label.assertIsDisplayed()
136135

137-
val supportingText = composeTestRule.onNode(hasContentDescription(supportingTextSemanticLabel), useUnmergedTree = true)
138-
supportingText.assertExists()
139-
assertEquals(field.description, supportingText.getTextString())
136+
composeTestRule.onNode(hasContentDescription(supportingTextSemanticLabel), useUnmergedTree = true).assertDoesNotExist()
140137
}
141138

142139
/**
@@ -155,9 +152,7 @@ class FormTextFieldTests {
155152
val label = composeTestRule.onNodeWithContentDescription(labelSemanticLabel)
156153
label.assertIsDisplayed()
157154

158-
val supportingText = composeTestRule.onNode(hasContentDescription(supportingTextSemanticLabel), useUnmergedTree = true)
159-
supportingText.assertExists()
160-
assertEquals(field.description, supportingText.getTextString())
155+
composeTestRule.onNode(hasContentDescription(supportingTextSemanticLabel), useUnmergedTree = true).assertDoesNotExist()
161156

162157
val charCountNode =
163158
composeTestRule.onNode(hasContentDescription(charCountSemanticLabel), useUnmergedTree = true)
@@ -185,9 +180,7 @@ class FormTextFieldTests {
185180
val label = composeTestRule.onNodeWithContentDescription(labelSemanticLabel)
186181
label.assertIsDisplayed()
187182

188-
val supportingText = composeTestRule.onNode(hasContentDescription(supportingTextSemanticLabel), useUnmergedTree = true)
189-
supportingText.assertExists()
190-
assertEquals(field.description, supportingText.getTextString())
183+
composeTestRule.onNode(hasContentDescription(supportingTextSemanticLabel), useUnmergedTree = true).assertDoesNotExist()
191184

192185
outlinedTextField.performImeAction()
193186
outlinedTextField.assertIsNotFocused()

toolkit/featureforms/src/main/java/com/arcgismaps/toolkit/featureforms/FeatureForm.kt

+1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ private fun FeatureFormBody(
173173
// other form elements are not created
174174
}
175175
}
176+
Divider()
176177
}
177178
}
178179
}

0 commit comments

Comments
 (0)