1+ /*
2+ * Copyright 2025 The Android Open Source Project
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * https://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
117package com.example.compose.snippets.text
218
319import android.text.TextUtils
@@ -19,7 +35,6 @@ import androidx.compose.foundation.text.input.setTextAndPlaceCursorAtEnd
1935import androidx.compose.foundation.text.input.then
2036import androidx.compose.material.SecureTextField
2137import androidx.compose.material.TextField
22-
2338import androidx.compose.material3.Button
2439import androidx.compose.material3.CircularProgressIndicator
2540import androidx.compose.material3.Text
@@ -108,13 +123,11 @@ fun StateHoisting() {
108123
109124class Repository {
110125 fun login (username : String , password : String ) {
111-
112126 }
113127}
114128
115129@Composable
116130fun TextFieldPlaceholder () {
117-
118131}
119132
120133@Composable
@@ -191,7 +204,6 @@ fun EditTextFieldState() {
191204class TextFieldViewModel : ViewModel () {
192205 val usernameState = TextFieldState ()
193206 fun validateUsername () {
194-
195207 }
196208}
197209val textFieldViewModel = TextFieldViewModel ()
@@ -210,8 +222,6 @@ fun TextFieldKeyboardOptions() {
210222 // [END android_compose_state_text_13]
211223}
212224
213-
214-
215225@Composable
216226fun TextFieldInputTransformation () {
217227 // [START android_compose_state_text_14]
@@ -229,14 +239,11 @@ fun TextFieldInputTransformation() {
229239 .then(CustomInputTransformation ()),
230240 )
231241 // [END android_compose_state_text_17]
232-
233242}
234243
235244// [START android_compose_state_text_15]
236245class CustomInputTransformation : InputTransformation {
237246 override fun TextFieldBuffer.transformInput () {
238-
239-
240247 }
241248}
242249// [END android_compose_state_text_15]
@@ -254,8 +261,6 @@ class DigitOnlyInputTransformation : InputTransformation {
254261// [START android_compose_state_text_17]
255262class CustomOutputTransformation : OutputTransformation {
256263 override fun TextFieldBuffer.transformOutput () {
257-
258-
259264 }
260265}
261266// [END android_compose_state_text_17]
@@ -270,7 +275,6 @@ class PhoneNumberOutputTransformation : OutputTransformation {
270275}
271276// [END android_compose_state_text_18]
272277
273-
274278@Composable
275279fun TextFieldOutputTransformation () {
276280 // [START android_compose_state_text_19]
@@ -279,4 +283,4 @@ fun TextFieldOutputTransformation() {
279283 outputTransformation = PhoneNumberOutputTransformation ()
280284 )
281285 // [END android_compose_state_text_19]
282- }
286+ }
0 commit comments