Skip to content

Commit

Permalink
Brought CompositionLocalProvider Back
Browse files Browse the repository at this point in the history
  • Loading branch information
Maik Mursall committed Sep 1, 2022
1 parent f67dd45 commit a7f18a5
Showing 1 changed file with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.text.ClickableText
import androidx.compose.material.Checkbox
import androidx.compose.material.CheckboxDefaults
import androidx.compose.material.ripple.LocalRippleTheme
import androidx.compose.material.ripple.rememberRipple
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
Expand All @@ -18,6 +19,7 @@ import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.dp
import com.fintecsystems.xs2awizard.components.XS2AWizardViewModel
import com.fintecsystems.xs2awizard.components.mutateInteractionSource
import com.fintecsystems.xs2awizard.components.theme.NoRippleTheme
import com.fintecsystems.xs2awizard.components.theme.XS2ATheme
import com.fintecsystems.xs2awizard.form.CheckBoxLineData
import com.fintecsystems.xs2awizard.helper.MarkupParser
Expand Down Expand Up @@ -74,17 +76,19 @@ fun CheckBoxLine(formData: CheckBoxLineData, viewModel: XS2AWizardViewModel) {
},
) {

Checkbox(
checked = checkBoxValue,
onCheckedChange = ::onCheckedChange,
interactionSource = interactionSource,
enabled = enabled,
colors = CheckboxDefaults.colors(
checkedColor = XS2ATheme.CURRENT.tintColor,
uncheckedColor = XS2ATheme.CURRENT.unselectedColor,
checkmarkColor = XS2ATheme.CURRENT.onTintColor
CompositionLocalProvider(LocalRippleTheme provides NoRippleTheme) {
Checkbox(
checked = checkBoxValue,
onCheckedChange = ::onCheckedChange,
interactionSource = interactionSource,
enabled = enabled,
colors = CheckboxDefaults.colors(
checkedColor = XS2ATheme.CURRENT.tintColor,
uncheckedColor = XS2ATheme.CURRENT.unselectedColor,
checkmarkColor = XS2ATheme.CURRENT.onTintColor
)
)
)
}

if (!formData.label.isNullOrEmpty()) {
val annotatedString = MarkupParser.parseMarkupText(formData.label)
Expand Down

0 comments on commit a7f18a5

Please sign in to comment.