listitem
README.md
List Item Component
The list item Component is a reusable view that allows you to create customisable list cell with different items, such as simple button, switch, radio button and image icon. List items are versatile UI elements commonly used for displaying cell with different list.
Types:
- OCListItem
- OCListButtonItem
- OCListCheckboxItem
- OCListRadioItem
- OCListSwitchItem
- OCListCheckboxButtonListItem
Features:
- Configurable leading and trailing components (Checkbox, Switch, Radio Button, Button, Icon)
- Can be switched to different cell type by just a plug
- Customizable text and caption
- Adjustable vertical alignment for leading and trailing components
- Flexible caption placement (top or bottom of the text)
- Clickable cell with callback function support
- Support for improved user experience
How to use List Item Component
-
Add the necessary imports:
import your.package.name.OCListItem
-
Use the required List Item in your Composable:
OCListItem(
text = "Text",
caption = "Caption",
setTextBold = true,
leadIcon = R.drawable.icon_left_input_chip,
leadIconContentDesc = "Test",
trailIcon = R.drawable.icon_left_input_chip,
trailIconContentDesc = "Test",
onItemClick = { /* Handle cell click */}
)