@@ -24,19 +24,15 @@ import androidx.annotation.DrawableRes
2424import androidx.compose.foundation.ExperimentalFoundationApi
2525import androidx.compose.foundation.clickable
2626import androidx.compose.foundation.layout.*
27- import androidx.compose.foundation.text.ClickableText
2827import androidx.compose.foundation.text.KeyboardActions
2928import androidx.compose.foundation.text.KeyboardOptions
3029import androidx.compose.material.*
31- import androidx.compose.material.icons.Icons
32- import androidx.compose.material.icons.outlined.Clear
3330import androidx.compose.runtime.*
3431import androidx.compose.ui.Modifier
3532import androidx.compose.ui.focus.FocusRequester
3633import androidx.compose.ui.focus.focusRequester
3734import androidx.compose.ui.focus.onFocusChanged
3835import androidx.compose.ui.platform.LocalFocusManager
39- import androidx.compose.ui.platform.testTag
4036import androidx.compose.ui.res.painterResource
4137import androidx.compose.ui.res.stringResource
4238import androidx.compose.ui.text.SpanStyle
@@ -347,7 +343,6 @@ private fun LatitudeTextBox(
347343 placeholder = placeHolder,
348344 showInvalidError = showInvalidError,
349345 label = stringResource(R .string.latitude_text_field_label),
350- clearButtonContentDescription = stringResource(R .string.clear_latitude_content_description),
351346 onSubmit = onSubmit,
352347 onChange = onChange,
353348 onCopy = onCopy
@@ -373,7 +368,6 @@ private fun LongitudeTextBox(
373368 placeholder = placeHolder,
374369 showInvalidError = showInvalidError,
375370 label = stringResource(R .string.longitude_text_field_label),
376- clearButtonContentDescription = stringResource(R .string.clear_longitude_content_description),
377371 onSubmit = onSubmit,
378372 onChange = onChange,
379373 onCopy = onCopy
@@ -388,7 +382,6 @@ private fun LatLngTextField(
388382 placeholder : String ,
389383 showInvalidError : Boolean ,
390384 label : String ,
391- clearButtonContentDescription : String ,
392385 onSubmit : () -> Unit ,
393386 onChange : (String ) -> Unit ,
394387 onCopy : () -> Unit
@@ -421,11 +414,9 @@ private fun LatLngTextField(
421414 value = textValue,
422415 singleLine = true ,
423416 label = {
424- ClickableText (
425- modifier = Modifier .testTag(" latlngtextfield" ),
426- text = buildAnnotatedString { append(label) },
427- maxLines = 1 ,
428- onClick = { onCopy() }
417+ Text (
418+ text = label,
419+ maxLines = 1
429420 )
430421 },
431422 onValueChange = { value ->
@@ -444,16 +435,11 @@ private fun LatLngTextField(
444435 }),
445436 placeholder = { Text (placeholder, maxLines = 1 ) },
446437 trailingIcon = {
447- if (text.isNotEmpty()) {
448- IconButton (onClick = {
449- focusRequester.requestFocus()
450- onChange(" " )
451- }) {
452- Icon (
453- Icons .Outlined .Clear ,
454- contentDescription = clearButtonContentDescription
455- )
456- }
438+ IconButton (onClick = onCopy) {
439+ Icon (
440+ painterResource(R .drawable.ic_outline_content_copy_24),
441+ contentDescription = stringResource(R .string.copy_location_content_description)
442+ )
457443 }
458444 })
459445
0 commit comments