All modules:
-getPlatformName
- SwipeContent
+ Created By Kevin Zou On 2023/10/18
Wrap the real content into a box with weight set and align the content at center
Parameters
the background color of the box
the weight of the box
the action to be executed when the box is clicked
the real content of the box
SwipeIcon
+ Created By Kevin Zou On 2023/10/18
Wrap the Icon into the SwipeContent with required size so that the icon size will not change with the outside container
Package-level declarations
+Functions
+Created By Kevin Zou On 2023/10/18
Created By Kevin Zou On 2023/10/18
SwipeBox
+ Designed a box layout that you can swipe to show action boxes from both directions
Parameters
The modifier to be applied to the SwipeBox.
The state object to be used to control the SwipeBox.
The direction to swipe to. If the direction is SwipeDirection.EndToStart, then only the endContent will be shown.
The width of the start content which will be shown when the swipe direction is StartToEnd or Both.
The content of the start content. Two parameters will be provided to that content:
swipeableState: SwipeableState, which can be used to change the swipe state.
startSwipeProgress: Float, which represent the progress of the swipe of the start content, 0f for null startContent.
Note that the content will be layout in a RowScope with mutable width. Thus, for sub content inside it, you have to use the weight modifier to determine the width of the content instead of use the width modifier directly. Also, since the width of the container will change with swipe progress, the content inside the sub container have to use the requiredWidth modifier to avoid the abnormal recompose to that width change. Like size or visibility change. For content with just icon or text, I would recommend you to use the SwipeIcon and SwipeText which setup the size restriction for you and you only need to set the real content.
The width of the end content which will be shown when the swipe direction is EndToStart or Both.
The content of the end content. Two parameters will be provided to that content:
swipeableState: SwipeableState, which can be used to change the swipe state.
endSwipeProgress: Float, which represent the progress of the swipe of the end content, 0f for null endContent.
Note that the content will be layout in a RowScope with mutable width. Thus, for sub content inside it, you have to use the weight modifier to determine the width of the content instead of use the width modifier directly. Also, since the width of the container will change with swipe progress, the content inside the sub container have to use the requiredWidth modifier to avoid the abnormal recompose to that width change. Like size or visibility change. For content with just icon or text, I would recommend you to use the SwipeIcon and SwipeText which setup the size restriction for you and you only need to set the real content.
Specifies where the thresholds between the states are. The thresholds will be used to determine which state to animate to when swiping stops. This is represented as a lambda that takes two states and returns the threshold between them in the form of a ThresholdConfig. Note that the order of the states corresponds to the swipe direction.
The main content that will be shown at max width when there is no swipe action. It will be provided three parameters:
swipeableState: SwipeableState, which can be used to change the swipe state.
startSwipeProgress: Float, which represent the progress of the swipe of the start content, 0f for null startContent.
endSwipeProgress: Float, which represent the progress of the swipe of the end content, 0f for null endContent.
Both
+ +EndToStart
+
+ StartToEnd
+
+ entries
+Returns a representation of an immutable list of all enum entries, in the order they're declared.
This method may be used to iterate over the enum entries.
SwipeDirection
+ Entries
+ +Properties
+ +Functions
+Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Returns an array containing the constants of this enum type, in the order they're declared.
valueOf
+ Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Throws
if this enum type has no constant with the specified name
values
+Returns an array containing the constants of this enum type, in the order they're declared.
This method may be used to iterate over the constants.
Package-level declarations
+Functions
+Designed a box layout that you can swipe to show action boxes from both directions