This page describes all the library modules available on Maven Central. Code is available on Github.
https://github.com/LunabeeStudio/Lunabee_Compose_Android
LbcFoundationimplementation "studio.lunabee.compose:lbcfoundation:$LAST_VERSION"
This module provides Composable built on Foundation Compose library (not linked to Material)
You will find:
StyledTextItem that can highlight one or multiple part of a larger text, and make some section clickable.StyledTextItem(
rawBaseText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
rawBaseTextStyle = MaterialTheme.typography.body1.copy(textAlign = TextAlign.Center),
textToHighLightList = setOf(
TextToHighlight(
tag = "Unique tag for my highlighted text",
text = "consectetur adipiscing elit",
style = MaterialTheme.typography.body2.copy(
fontWeight = FontWeight.Bold,
textDecoration = TextDecoration.combine(listOf(TextDecoration.Underline, TextDecoration.LineThrough)),
).toSpanStyle()
.copy(
brush = Brush.linearGradient(...),
action = { ... },
ignoreCase = true,
)
)
)
),
modifier = Modifier, // optional
softWrap = true, // optional
overflow = TextOverflow.Clip, // optional
maxLines = Int.MAX_VALUE, // optional
onTextLayout = { }, // optional
)
LbcHapticFeedback to perform predefined haptics effect. It handles API checks and provide a unique entry point for any haptics effect.@Composable
fun MyComposable() {
val hapticFeedback: LbcHapticFeedback = rememberLbcHapticFeedback()
Button(
onClick = {
// your action
hapticFeedback.perform(
hapticEffect = LbcHapticEffect.Predefined.Tick,
// optional fallback if [hapticEffect] is not supported.
fallback = LbcHapticEffect.Compose.LongPress,
}
}
There is also helpers method:
getSupportedHapticEffect to get all LbcHapticEffect supported on the device.isPrimitiveSupported if you want to check a specific haptic id directly<aside>
⚠️ To use perform, you need to add android.permission.VIBRATE permission.
</aside>
Enregistrement de l’écran 2022-08-01 à 13.54.09.mov
LbcAccessibilityimplementation "studio.lunabee.compose:lbcaccessibility:$LAST_VERSION"
This module provides extensions for Modifier in order to make your application accessible.
You will find following methods and object:
AccessibilityState that allows you to determine if accessibility is enabled on the phone.ClickDescription and ToggleDescription to describe an action for a specific elementsetAccessibilityDetails extension method on Modifier to make any Composable accessible with custom data.setAsInvisibleForAccessibility (experimental) that hide a node for the screen reader.For more detail about each parameters of above extension method, you can consult the JavaDoc directly.