Android
@ExperimentalWearMaterialApi
public object SwipeToRevealDefaults
Defaults for Material SwipeToReveal.
Functions
actionColors
@Composable
public fun actionColors(
primaryActionBackgroundColor: Color = MaterialTheme.colors.error,
primaryActionContentColor: Color = MaterialTheme.colors.onError,
secondaryActionBackgroundColor: Color = MaterialTheme.colors.surface,
secondaryActionContentColor: Color = MaterialTheme.colors.onSurface,
undoActionBackgroundColor: Color = MaterialTheme.colors.surface,
undoActionContentColor: Color = MaterialTheme.colors.onSurface,
): SwipeToRevealActionColors
The recommended colors used to display the contents of the primary, secondary and undo actions in SwipeToReveal.
Parameters
| primaryActionBackgroundColor | The background color (color of the shape) of the primary action |
| primaryActionContentColor | The content color (text and icon) of the primary action |
| secondaryActionBackgroundColor | The background color (color of the shape) of the secondary action |
| secondaryActionContentColor | The content color (text and icon) of the secondary action |
| undoActionBackgroundColor | The background color (color of the shape) of the undo action |
| undoActionContentColor | The content color (text) of the undo action |
createRevealAnchors
@SuppressWarnings("PrimitiveInCollection")
public fun createRevealAnchors(
coveredAnchor: Float = 0f,
revealingAnchor: Float = RevealingRatio,
revealedAnchor: Float = 1f,
revealDirection: RevealDirection = RevealDirection.RightToLeft,
): Map<RevealValue, Float>
Creates the required anchors to which the top content can be swiped, to reveal the actions. Each value should be in the range [0..1], where 0 represents right most end and 1 represents the full width of the top content starting from right and ending on left.
Parameters
| coveredAnchor | Anchor for the RevealValue.Covered value |
| revealingAnchor | Anchor for the RevealValue.LeftRevealing or RevealValue.RightRevealing value |
| revealedAnchor | Anchor for the RevealValue.LeftRevealed or RevealValue.RightRevealed value |
| revealDirection | The direction in which the content can be swiped. It's strongly advised to keep the default RevealDirection.RightToLeft in order to preserve compatibility with the system wide swipe to dismiss gesture. |