Updated on 2026-08-14
This commit is contained in:
parent
cd266b50f5
commit
00126b9d36
21 changed files with 711 additions and 16 deletions
|
|
@ -45,6 +45,8 @@ import kotlinx.coroutines.delay
|
|||
* @param placeholder The placeholder text reference to show when the input is empty
|
||||
* @param onValueChange Callback invoked when the input value changes, receives the new string value
|
||||
* @param onPasteClick Callback invoked when the paste button is clicked, receives the pasted string
|
||||
* @param onClearClick Callback invoked when the cross icon is clicked to clear the field. Separate from
|
||||
* [onPasteClick] on purpose: clearing used to be delivered as a paste of an empty string
|
||||
* @param onQrCodeClick Callback invoked when the QR code scan button is clicked
|
||||
* @param modifier Optional modifier to apply to the composable
|
||||
* @param singleLine Whether the text field should be constrained to a single line (default: false)
|
||||
|
|
@ -64,6 +66,7 @@ fun InputRowRecipient(
|
|||
placeholder: TextReference,
|
||||
onValueChange: (String) -> Unit,
|
||||
onPasteClick: (String) -> Unit,
|
||||
onClearClick: () -> Unit,
|
||||
onQrCodeClick: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
singleLine: Boolean = false,
|
||||
|
|
@ -121,7 +124,7 @@ fun InputRowRecipient(
|
|||
.testTag(SendAddressScreenTestTags.ADDRESS_TEXT_FIELD),
|
||||
)
|
||||
CrossIcon(
|
||||
onClick = onPasteClick,
|
||||
onClick = onClearClick,
|
||||
modifier = Modifier
|
||||
.align(CenterVertically)
|
||||
.padding(start = TangemTheme.dimens.spacing8)
|
||||
|
|
@ -258,6 +261,7 @@ private fun InputRowRecipientPreview(
|
|||
showDivider = true,
|
||||
onValueChange = {},
|
||||
onPasteClick = {},
|
||||
onClearClick = {},
|
||||
onQrCodeClick = {},
|
||||
modifier = Modifier.background(TangemTheme.colors.background.primary),
|
||||
resolvedAddress = value.resolvedAddress,
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ fun PasteButton(
|
|||
}
|
||||
|
||||
@Composable
|
||||
fun CrossIcon(onClick: (String) -> Unit, modifier: Modifier = Modifier) {
|
||||
fun CrossIcon(onClick: () -> Unit, modifier: Modifier = Modifier) {
|
||||
Icon(
|
||||
painter = painterResource(id = R.drawable.ic_close_24),
|
||||
tint = TangemTheme.colors.icon.informative,
|
||||
|
|
@ -100,7 +100,7 @@ fun CrossIcon(onClick: (String) -> Unit, modifier: Modifier = Modifier) {
|
|||
.clickable(
|
||||
interactionSource = remember { MutableInteractionSource() },
|
||||
indication = ripple(radius = TangemTheme.dimens.radius12),
|
||||
onClick = { onClick("") },
|
||||
onClick = onClick,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue