File tree Expand file tree Collapse file tree
app/src/main/java/com/orange/ouds/app/ui/components/controlitem Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,7 +162,8 @@ fun ControlItemAnnotatedTextCustomization(state: ControlItemDemoState) {
162162 CustomizationSwitchItem (
163163 label = stringResource(id = R .string.app_components_common_annotatedText_tech),
164164 checked = annotatedText,
165- onCheckedChange = { annotatedText = it }
165+ onCheckedChange = { annotatedText = it },
166+ enabled = annotatedTextSwitchEnabled
166167 )
167168 }
168169}
Original file line number Diff line number Diff line change @@ -86,15 +86,7 @@ open class ControlItemDemoState(
8686 var label: String by mutableStateOf(label)
8787 var description: String? by mutableStateOf(description)
8888
89- private var _annotatedText : Boolean by mutableStateOf(annotatedText)
90- var annotatedText: Boolean
91- get() = _annotatedText
92- set(value) {
93- _annotatedText = value
94- if (value) {
95- error = true
96- }
97- }
89+ var annotatedText: Boolean by mutableStateOf(annotatedText)
9890
9991 val enabledSwitchEnabled: Boolean
10092 get() = ! error
@@ -108,6 +100,9 @@ open class ControlItemDemoState(
108100 val errorMessageTextInputEnabled: Boolean
109101 get() = error && ! annotatedText
110102
103+ val annotatedTextSwitchEnabled: Boolean
104+ get() = error
105+
111106 enum class Icon (@StringRes val labelRes : Int ) {
112107 None (R .string.app_components_common_none_tech),
113108 Tinted (R .string.app_components_common_tintedIcon_tech),
You can’t perform that action at this time.
0 commit comments