11package com.steamclock.debugmenu_ui.components
22
3- import android.view.KeyEvent
43import android.view.KeyEvent.KEYCODE_ENTER
54import androidx.compose.foundation.layout.Column
65import androidx.compose.foundation.layout.fillMaxWidth
@@ -18,6 +17,7 @@ import androidx.compose.ui.Modifier
1817import androidx.compose.ui.input.key.onKeyEvent
1918import androidx.compose.ui.text.input.ImeAction
2019import androidx.compose.ui.text.input.KeyboardType
20+ import androidx.compose.ui.text.input.PasswordVisualTransformation
2121import androidx.compose.ui.text.input.TextFieldValue
2222import androidx.compose.ui.unit.dp
2323import kotlinx.coroutines.launch
@@ -37,23 +37,30 @@ fun CodeEntry(onSubmit: suspend (String) -> Unit) {
3737 }
3838 }
3939
40- Column (Modifier .fillMaxWidth().padding(16 .dp)) {
40+ Column (
41+ Modifier
42+ .fillMaxWidth()
43+ .padding(16 .dp)) {
4144 Text (text = " Enter code" )
4245
4346 TextField (
4447 textState.value,
4548 singleLine = true ,
4649 onValueChange = { textState.value = it },
50+ visualTransformation = PasswordVisualTransformation (),
4751 keyboardActions = KeyboardActions { submit() },
4852 keyboardOptions = KeyboardOptions .Default .copy(imeAction = ImeAction .Done , keyboardType = KeyboardType .Password ),
49- modifier = Modifier .fillMaxWidth().padding(vertical = 8 .dp).onKeyEvent {
50- return @onKeyEvent if (it.nativeKeyEvent.keyCode == KEYCODE_ENTER ) {
51- submit()
52- true
53- } else {
54- false
53+ modifier = Modifier
54+ .fillMaxWidth()
55+ .padding(vertical = 8 .dp)
56+ .onKeyEvent {
57+ return @onKeyEvent if (it.nativeKeyEvent.keyCode == KEYCODE_ENTER ) {
58+ submit()
59+ true
60+ } else {
61+ false
62+ }
5563 }
56- }
5764 )
5865
5966 Button (
0 commit comments