sprint-1 #1

Merged
user10 merged 20 commits from sprint-1 into main 2025-05-26 14:29:49 +00:00
Showing only changes of commit eb004d3bc3 - Show all commits

View File

@ -0,0 +1,38 @@
package com.example.libary
import androidx.compose.material3.Checkbox
import androidx.compose.material3.CheckboxDefaults
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import com.example.libary.theme.AccentColor
/**
* Checkboxes allow users to select one or more items from a set. Checkboxes can turn an option on or off.
* @param checked whether this checkbox is checked or unchecked
* @param onCheckedChange called when this checkbox is clicked. If `null`, then this checkbox will
* not be interactable, unless something else handles its input events and updates its state.
* @param modifier the [Modifier] to be applied to this checkbox
* */
@Composable
fun Toggle(
modifier: Modifier = Modifier,
checked: Boolean,
onCheckedChange: ((Boolean) -> Unit)? = null,
) {
Checkbox(
checked = checked,
onCheckedChange = onCheckedChange,
colors = CheckboxDefaults.colors(
checkedColor = AccentColor
)
)
}
@Preview
@Composable
private fun TogglePrev() {
Toggle(
checked = true
)
}