1919package com.example.compose.snippets.text
2020
2121import android.graphics.Typeface
22- import android.provider.ContactsContract.CommonDataKinds.Email
2322import androidx.compose.foundation.BorderStroke
2423import androidx.compose.foundation.background
2524import androidx.compose.foundation.basicMarquee
@@ -29,15 +28,13 @@ import androidx.compose.foundation.layout.Arrangement
2928import androidx.compose.foundation.layout.Box
3029import androidx.compose.foundation.layout.Column
3130import androidx.compose.foundation.layout.Row
32- import androidx.compose.foundation.layout.Spacer
3331import androidx.compose.foundation.layout.fillMaxWidth
3432import androidx.compose.foundation.layout.padding
3533import androidx.compose.foundation.layout.requiredSize
3634import androidx.compose.foundation.layout.width
3735import androidx.compose.foundation.shape.RoundedCornerShape
3836import androidx.compose.foundation.text.BasicSecureTextField
3937import androidx.compose.foundation.text.KeyboardOptions
40- import androidx.compose.foundation.text.input.TextFieldDecorator
4138import androidx.compose.foundation.text.input.TextFieldState
4239import androidx.compose.foundation.text.input.TextObfuscationMode
4340import androidx.compose.foundation.text.selection.DisableSelection
@@ -50,7 +47,6 @@ import androidx.compose.material3.LocalTextStyle
5047import androidx.compose.material3.MaterialTheme
5148import androidx.compose.material3.OutlinedTextField
5249import androidx.compose.material3.Text
53- import androidx.compose.material3.TextButton
5450import androidx.compose.material3.TextField
5551import androidx.compose.runtime.Composable
5652import androidx.compose.runtime.derivedStateOf
@@ -650,9 +646,9 @@ private fun TextSample(samples: Map<String, @Composable () -> Unit>) {
650646
651647private const val SAMPLE_LONG_TEXT =
652648 " Jetpack Compose is Android’s modern toolkit for building native UI. " +
653- " It simplifies and accelerates UI development on Android bringing your apps " +
654- " to life with less code, powerful tools, and intuitive Kotlin APIs. " +
655- " It makes building Android UI faster and easier."
649+ " It simplifies and accelerates UI development on Android bringing your apps " +
650+ " to life with less code, powerful tools, and intuitive Kotlin APIs. " +
651+ " It makes building Android UI faster and easier."
656652
657653@Composable
658654@Preview
@@ -889,9 +885,11 @@ fun PasswordTextField() {
889885 .padding(6 .dp),
890886 decorator = { innerTextField ->
891887 Box (modifier = Modifier .fillMaxWidth()) {
892- Box (modifier = Modifier
893- .align(Alignment .CenterStart )
894- .padding(start = 16 .dp,end = 48 .dp)) {
888+ Box (
889+ modifier = Modifier
890+ .align(Alignment .CenterStart )
891+ .padding(start = 16 .dp, end = 48 .dp)
892+ ) {
895893 innerTextField()
896894 }
897895 Icon (
@@ -912,7 +910,6 @@ fun PasswordTextField() {
912910}
913911// [END android_compose_text_auto_format_phone_number_showhidepassword]
914912
915-
916913// [START android_compose_text_auto_format_phone_number_validatetext]
917914class EmailViewModel : ViewModel () {
918915 var email by mutableStateOf(" " )
@@ -964,4 +961,4 @@ fun ValidateInput() {
964961 validatorHasErrors = emailViewModel.emailHasErrors
965962 )
966963}
967- // [END android_compose_text_auto_format_phone_number_validatetext]
964+ // [END android_compose_text_auto_format_phone_number_validatetext]
0 commit comments