add ripple effect on whole line click

This commit is contained in:
FunkyMuse 2023-07-09 23:57:51 +02:00
parent 869ec6eb78
commit 481a8a8297

View file

@ -2,7 +2,6 @@ package com.simplemobiletools.calculator.compose.settings
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
@ -10,11 +9,9 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Checkbox
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.simplemobiletools.calculator.compose.extensions.MyDevices
import com.simplemobiletools.calculator.compose.theme.AppThemeSurface
import com.simplemobiletools.calculator.compose.theme.preferenceSummaryColor
@ -29,12 +26,11 @@ fun SettingsCheckBoxComponent(
isPreferenceEnabled: Boolean = true,
onChange: ((Boolean) -> Unit)? = null,
) {
val interactionSource = remember { MutableInteractionSource() }
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = modifier
.fillMaxWidth()
.clickable(indication = null, interactionSource = interactionSource, onClick = { onChange?.invoke(!initialValue) })
.clickable(onClick = { onChange?.invoke(!initialValue) })
.padding(vertical = 14.dp, horizontal = 16.dp),
) {
Column(