Skip to content

Instantly share code, notes, and snippets.

View moffpage's full-sized avatar
🏠
Working from home

Artur Mavlyuchenko moffpage

🏠
Working from home
View GitHub Profile
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.focus.onFocusChanged
import androidx.compose.ui.layout.boundsInWindow
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.autofill.AutofillNode
import androidx.compose.ui.autofill.AutofillType
import androidx.compose.ui.platform.LocalAutofill
import androidx.compose.ui.platform.LocalAutofillTree
import java.text.DecimalFormat
import androidx.core.text.isDigitsOnly
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.input.OffsetMapping
import androidx.compose.ui.text.input.TransformedText
import androidx.compose.ui.text.input.VisualTransformation
private val String.isValidForFormatting get(): Boolean =
isNotBlank() && isDigitsOnly() && length <= 6