Skip to content

Instantly share code, notes, and snippets.

View nemscep's full-sized avatar

Nemanja Scepanovic nemscep

View GitHub Profile
@nemscep
nemscep / TextFieldWithBackoff.kt
Last active November 23, 2023 21:55
TextField which automatically triggers provided `onValueChange` lambda with the full text input (not for every character).
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.shape.ZeroCornerSize
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.LocalTextStyle
import androidx.compose.material.MaterialTheme
import androidx.compose.material.TextField
import androidx.compose.material.TextFieldColors
import androidx.compose.material.TextFieldDefaults
import androidx.compose.runtime.Composable