Skip to content

Commit a9ad599

Browse files
committed
Merge remote-tracking branch 'origin/state-based-tf' into state-based-tf
# Conflicts: # compose/snippets/src/main/java/com/example/compose/snippets/text/StateBasedText.kt
2 parents 21908c2 + f1d108e commit a9ad599

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

compose/snippets/src/main/java/com/example/compose/snippets/text/StateBasedText.kt

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
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+
117
package com.example.compose.snippets.text
218

319
import android.text.TextUtils
@@ -19,7 +35,6 @@ import androidx.compose.foundation.text.input.setTextAndPlaceCursorAtEnd
1935
import androidx.compose.foundation.text.input.then
2036
import androidx.compose.material.SecureTextField
2137
import androidx.compose.material.TextField
22-
2338
import androidx.compose.material3.Button
2439
import androidx.compose.material3.CircularProgressIndicator
2540
import androidx.compose.material3.Text
@@ -108,13 +123,11 @@ fun StateHoisting() {
108123

109124
class Repository {
110125
fun login(username: String, password: String) {
111-
112126
}
113127
}
114128

115129
@Composable
116130
fun TextFieldPlaceholder() {
117-
118131
}
119132

120133
@Composable
@@ -191,7 +204,6 @@ fun EditTextFieldState() {
191204
class TextFieldViewModel : ViewModel() {
192205
val usernameState = TextFieldState()
193206
fun validateUsername() {
194-
195207
}
196208
}
197209
val textFieldViewModel = TextFieldViewModel()
@@ -210,8 +222,6 @@ fun TextFieldKeyboardOptions() {
210222
// [END android_compose_state_text_13]
211223
}
212224

213-
214-
215225
@Composable
216226
fun 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]
236245
class 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]
255262
class 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
275279
fun 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

Comments
 (0)