Skip to content

Commit 6301d76

Browse files
authored
docs(modifiers): Add TODOs for inspectableProperties lint warnings (#589)
The lint tool reported warnings for `ModifierNodeElement` classes missing an override for `inspectableProperties`. This function is used by development tools like the Layout Inspector to display debug information. Rather than implementing the function directly and adding complexity to the existing minimal snippets, this commit adds `TODO` comments. This serves as a reminder to create a dedicated snippet that demonstrates how to properly implement `inspectableProperties`, thereby keeping the current examples focused and clean while still addressing the lint warning.
1 parent f95ab59 commit 6301d76

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compose/snippets/src/main/java/com/example/compose/snippets/modifiers/CustomModifierSnippets.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ private class CircleNode(var color: Color) : DrawModifierNode, Modifier.Node() {
142142
}
143143
// [END android_compose_custom_modifiers_7]
144144

145+
// TODO: Create a new snippet that overrides InspectorInfo.inspectableProperties.
145146
// [START android_compose_custom_modifiers_8]
146147
// ModifierNodeElement
147148
private data class CircleElement(val color: Color) : ModifierNodeElement<CircleNode>() {
@@ -159,6 +160,7 @@ fun Modifier.circle(color: Color) = this then CircleElement(color)
159160
// [END android_compose_custom_modifiers_9]
160161

161162
private object CustomModifierSnippets10 {
163+
// TODO: Create a new snippet that overrides InspectorInfo.inspectableProperties.
162164
// [START android_compose_custom_modifiers_10]
163165
// Modifier factory
164166
fun Modifier.circle(color: Color) = this then CircleElement(color)
@@ -181,6 +183,7 @@ private object CustomModifierSnippets10 {
181183
// [END android_compose_custom_modifiers_10]
182184
}
183185

186+
// TODO: Create a new snippet that overrides InspectorInfo.inspectableProperties.
184187
// [START android_compose_custom_modifiers_11]
185188
fun Modifier.fixedPadding() = this then FixedPaddingElement
186189

0 commit comments

Comments
 (0)