File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
xpeho_ui_android/src/main/java/com/xpeho/xpeho_ui_android Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -215,7 +215,8 @@ InputText(
215215 focusRequester = FocusRequester ,
216216 keyboardAction = ImeAction ,
217217 onKeyboardAction = () -> Unit ,
218- onInput = (String ) -> Unit
218+ onInput = (String ) -> Unit ,
219+ isReadOnly = Boolean
219220)
220221```
221222
Original file line number Diff line number Diff line change @@ -64,7 +64,8 @@ fun InputText(
6464 focusRequester : FocusRequester = FocusRequester (),
6565 keyboardAction : ImeAction = ImeAction .Next ,
6666 onKeyboardAction : () -> Unit = {},
67- onInput : (String ) -> Unit = { input -> println("The input $input is typed") }
67+ onInput : (String ) -> Unit = { input -> println("The input $input is typed") },
68+ isReadOnly : Boolean = false
6869) {
6970 var input by remember { mutableStateOf(defaultInput) }
7071 var passwordVisible by remember { mutableStateOf(false ) }
@@ -123,6 +124,7 @@ fun InputText(
123124 fontWeight = FontWeight .Normal ,
124125 color = inputColor
125126 ),
127+ readOnly = isReadOnly,
126128 modifier = Modifier
127129 .fillMaxWidth()
128130 .padding(
@@ -132,6 +134,7 @@ fun InputText(
132134 .onFocusChanged { isFocused = it.isFocused }
133135 .semantics { contentDescription = label }
134136 .focusRequester(focusRequester)
137+
135138 )
136139 }
137140
@@ -212,7 +215,8 @@ fun InputTextPreview() {
212215 defaultInput = " input" ,
213216 labelSize = 14 .sp,
214217 inputSize = 16 .sp,
215- focusRequester = test2FocusRequester
218+ focusRequester = test2FocusRequester,
219+ isReadOnly = true
216220 )
217221 Spacer (modifier = Modifier .height(16 .dp))
218222 InputText (
You can’t perform that action at this time.
0 commit comments