text
README.md
:OCText Composable Function
This OCText is a custom composable function for Jetpack Compose. It's a wrapper around the
standard Text
function,
providing flexibility to configure text appearance and behavior. Also provides support to html tags
and actions.
:How to use OCText
To use the OCText function, simply call it within any composable:
-
Add the necessary imports:
import your.package.name.OCText -
Use the
OCTextwithin your Composable:@Composable
fun MyScreen() {
OCText(
text = "Hello, OCText!",
color = Color.Blue,
fontSize = 18.sp,
linkTextColor = Color.Blue,
// ... other configurations
)
}
Parameters
text: The text to be displayed(plain text or HTML formatted text)modifier: Modifier for styling and layout.color: Text color.linkTextColor: Hyperlink text color.fontSize: Size of the text.fontStyle: Style of the font, e.g., italic.fontWeight: Weight of the font, e.g., bold.fontFamily: Family of the font.letterSpacing: Space between letters.textDecoration: Decoration on the text, e.g., underline.textAlign: Alignment of the text.lineHeight: Height of each line of text.overflow: How text should overflow, e.g., ellipsis.softWrap: Whether the text should wrap to the next line.maxLines: Maximum number of lines the text can occupy.minLines: Minimum number of lines the text should occupy.onTextLayout: Callback with information about text layout.style: Style of the text, which can be used for combined configurations.