File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed
androidTest/java/com/arcgismaps/toolkit/featureforms
main/java/com/arcgismaps/toolkit/featureforms/internal/components/datetime Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ class DateTimeFieldTests {
117117 " expected helper text: Date Entry is Required"
118118
119119 }
120- val iconMatcher = hasContentDescription(" field icon " )
120+ val iconMatcher = hasContentDescription(" date time picker button " )
121121 assert (iconMatcher.matches(dateTimeField.fetchSemanticsNode()))
122122 }
123123
@@ -136,7 +136,7 @@ class DateTimeFieldTests {
136136 val col = composeTestRule.onNodeWithContentDescription(" lazy column" )
137137 col.performScrollToIndex(8 )
138138 val dateTimeField = composeTestRule.onNodeWithText(" ${formElement.label} *" )
139- val iconMatcher = hasContentDescription(" field icon " )
139+ val iconMatcher = hasContentDescription(" date time picker button " )
140140 assert (iconMatcher.matches(dateTimeField.fetchSemanticsNode()))
141141 dateTimeField.assertHasClickAction()
142142 dateTimeField.performClick()
@@ -150,7 +150,6 @@ class DateTimeFieldTests {
150150 helperTextInDialog.assertIsDisplayed()
151151 }
152152
153-
154153 /* *
155154 * Given a FieldFormElement with an editable datetime input
156155 * When the date value is displayed
Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ package com.arcgismaps.toolkit.featureforms.internal.components.datetime
2121import androidx.compose.foundation.interaction.MutableInteractionSource
2222import androidx.compose.foundation.interaction.PressInteraction
2323import androidx.compose.material.icons.Icons
24- import androidx.compose.material.icons.rounded.CalendarMonth
2524import androidx.compose.material.icons.rounded.EditCalendar
25+ import androidx.compose.material3.Icon
2626import androidx.compose.material3.MaterialTheme
2727import androidx.compose.runtime.Composable
2828import androidx.compose.runtime.LaunchedEffect
@@ -76,8 +76,19 @@ internal fun DateTimeField(
7676 isRequired = isRequired,
7777 singleLine = true ,
7878 interactionSource = interactionSource,
79- trailingIcon = if (isEditable) Icons .Rounded .EditCalendar else Icons .Rounded .CalendarMonth ,
80- onFocusChange = state::onFocusChanged
79+ trailingIcon = Icons .Rounded .EditCalendar ,
80+ onFocusChange = state::onFocusChanged,
81+ trailingContent =
82+ if (isRequired) {
83+ {
84+ Icon (
85+ imageVector = Icons .Rounded .EditCalendar ,
86+ contentDescription = " date time picker button"
87+ )
88+ }
89+ } else {
90+ null
91+ }
8192 )
8293
8394 LaunchedEffect (interactionSource) {
You can’t perform that action at this time.
0 commit comments