Updated on 2026-08-14
This commit is contained in:
parent
52eddd3ac6
commit
c07ecae962
14 changed files with 258 additions and 35 deletions
|
|
@ -44,6 +44,7 @@ fun OutlineTextField(
|
|||
isError: Boolean = false,
|
||||
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
|
||||
keyboardActions: KeyboardActions = KeyboardActions(),
|
||||
visualTransformation: VisualTransformation = VisualTransformation.None,
|
||||
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
|
||||
) {
|
||||
TangemTextField(
|
||||
|
|
@ -58,6 +59,7 @@ fun OutlineTextField(
|
|||
isError = isError,
|
||||
keyboardOptions = keyboardOptions,
|
||||
keyboardActions = keyboardActions,
|
||||
visualTransformation = visualTransformation,
|
||||
interactionSource = interactionSource,
|
||||
)
|
||||
}
|
||||
|
|
@ -76,6 +78,8 @@ fun OutlineTextFieldWithIcon(
|
|||
isError: Boolean = false,
|
||||
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
|
||||
keyboardActions: KeyboardActions = KeyboardActions(),
|
||||
visualTransformation: VisualTransformation = VisualTransformation.None,
|
||||
caption: String? = null,
|
||||
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
|
||||
) {
|
||||
TangemTextFieldWithIcon(
|
||||
|
|
@ -91,6 +95,8 @@ fun OutlineTextFieldWithIcon(
|
|||
isError = isError,
|
||||
keyboardOptions = keyboardOptions,
|
||||
keyboardActions = keyboardActions,
|
||||
visualTransformation = visualTransformation,
|
||||
caption = caption,
|
||||
interactionSource = interactionSource,
|
||||
onIconClick = onIconClick,
|
||||
)
|
||||
|
|
@ -189,15 +195,16 @@ private fun TangemTextField(
|
|||
enter = fadeIn(),
|
||||
exit = fadeOut(),
|
||||
) {
|
||||
if (caption.isNullOrEmpty()) return@AnimatedVisibility
|
||||
val captionWrapped = remember(this) { requireNotNull(caption) }
|
||||
|
||||
Column {
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Text(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp),
|
||||
text = caption,
|
||||
style = TangemTheme.typography.body1,
|
||||
text = captionWrapped,
|
||||
style = TangemTheme.typography.caption2,
|
||||
color = colors.captionColor(enabled = enabled, isError = isError).value,
|
||||
)
|
||||
}
|
||||
|
|
@ -218,6 +225,7 @@ private fun TangemTextFieldWithIcon(
|
|||
placeholder: String? = null,
|
||||
enabled: Boolean = true,
|
||||
isError: Boolean = false,
|
||||
caption: String? = null,
|
||||
visualTransformation: VisualTransformation = VisualTransformation.None,
|
||||
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
|
||||
keyboardActions: KeyboardActions = KeyboardActions(),
|
||||
|
|
@ -280,6 +288,26 @@ private fun TangemTextFieldWithIcon(
|
|||
}
|
||||
},
|
||||
)
|
||||
|
||||
AnimatedVisibility(
|
||||
visible = !caption.isNullOrEmpty(),
|
||||
enter = fadeIn(),
|
||||
exit = fadeOut(),
|
||||
) {
|
||||
val captionWrapped = remember(this) { requireNotNull(caption) }
|
||||
|
||||
Column {
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Text(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp),
|
||||
text = captionWrapped,
|
||||
style = TangemTheme.typography.caption2,
|
||||
color = colors.captionColor(enabled = enabled, isError = isError).value,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
9
core/ui/src/main/res/drawable/ic_eye_outline_24.xml
Normal file
9
core/ui/src/main/res/drawable/ic_eye_outline_24.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M12,9C12.796,9 13.559,9.316 14.121,9.879C14.684,10.441 15,11.204 15,12C15,12.796 14.684,13.559 14.121,14.121C13.559,14.684 12.796,15 12,15C11.204,15 10.441,14.684 9.879,14.121C9.316,13.559 9,12.796 9,12C9,11.204 9.316,10.441 9.879,9.879C10.441,9.316 11.204,9 12,9ZM12,4.5C17,4.5 21.27,7.61 23,12C21.27,16.39 17,19.5 12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5ZM3.18,12C4.83,15.36 8.24,17.5 12,17.5C15.76,17.5 19.17,15.36 20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12Z"
|
||||
android:fillColor="#1E1E1E"/>
|
||||
</vector>
|
||||
Loading…
Add table
Add a link
Reference in a new issue