From 522e3709116f6c6b095ed6bedd28b559da0e51d0 Mon Sep 17 00:00:00 2001 From: KevinnZou <43654611+KevinnZou@users.noreply.github.com> Date: Wed, 20 Mar 2024 01:27:47 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20KevinnZo?= =?UTF-8?q?u/compose-swipebox-multiplatform@dfc13ca376fcc5bd7d38f1f5999fd8?= =?UTF-8?q?7847ac0e75=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 2 +- scripts/sourceset_dependencies.js | 2 +- swipebox/com.kevinnzou.swipebox.widget/-swipe-content.html | 2 +- swipebox/com.kevinnzou.swipebox.widget/-swipe-icon.html | 2 +- swipebox/com.kevinnzou.swipebox.widget/-swipe-text.html | 2 +- swipebox/com.kevinnzou.swipebox.widget/index.html | 2 +- swipebox/com.kevinnzou.swipebox/-swipe-box.html | 2 +- .../com.kevinnzou.swipebox/-swipe-direction/-both/index.html | 2 +- .../-swipe-direction/-end-to-start/index.html | 2 +- .../-swipe-direction/-start-to-end/index.html | 2 +- swipebox/com.kevinnzou.swipebox/-swipe-direction/entries.html | 2 +- swipebox/com.kevinnzou.swipebox/-swipe-direction/index.html | 2 +- swipebox/com.kevinnzou.swipebox/-swipe-direction/value-of.html | 2 +- swipebox/com.kevinnzou.swipebox/-swipe-direction/values.html | 2 +- swipebox/com.kevinnzou.swipebox/index.html | 2 +- swipebox/index.html | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/index.html b/index.html index 95d6c18..1669311 100644 --- a/index.html +++ b/index.html @@ -76,7 +76,7 @@

All modules:

diff --git a/scripts/sourceset_dependencies.js b/scripts/sourceset_dependencies.js index cdfc767..ccd49a7 100644 --- a/scripts/sourceset_dependencies.js +++ b/scripts/sourceset_dependencies.js @@ -1 +1 @@ -sourceset_dependencies = '{":swipebox:dokkaHtmlPartial/androidDebug":[":swipebox:dokkaHtmlPartial/commonMain"],":swipebox:dokkaHtmlPartial/androidMain":[":swipebox:dokkaHtmlPartial/commonMain"],":swipebox:dokkaHtmlPartial/androidRelease":[":swipebox:dokkaHtmlPartial/commonMain"],":swipebox:dokkaHtmlPartial/commonMain":[],":swipebox:dokkaHtmlPartial/desktopMain":[":swipebox:dokkaHtmlPartial/commonMain"],":swipebox:dokkaHtmlPartial/iosArm64Main":[":swipebox:dokkaHtmlPartial/commonMain",":swipebox:dokkaHtmlPartial/iosMain"],":swipebox:dokkaHtmlPartial/iosMain":[":swipebox:dokkaHtmlPartial/commonMain"],":swipebox:dokkaHtmlPartial/iosSimulatorArm64Main":[":swipebox:dokkaHtmlPartial/commonMain",":swipebox:dokkaHtmlPartial/iosMain"],":swipebox:dokkaHtmlPartial/iosX64Main":[":swipebox:dokkaHtmlPartial/commonMain",":swipebox:dokkaHtmlPartial/iosMain"]}' \ No newline at end of file +sourceset_dependencies = '{":swipebox:dokkaHtmlPartial/androidDebug":[":swipebox:dokkaHtmlPartial/commonMain"],":swipebox:dokkaHtmlPartial/androidMain":[":swipebox:dokkaHtmlPartial/commonMain"],":swipebox:dokkaHtmlPartial/androidRelease":[":swipebox:dokkaHtmlPartial/commonMain"],":swipebox:dokkaHtmlPartial/commonMain":[],":swipebox:dokkaHtmlPartial/desktopMain":[":swipebox:dokkaHtmlPartial/commonMain"],":swipebox:dokkaHtmlPartial/iosArm64Main":[":swipebox:dokkaHtmlPartial/commonMain",":swipebox:dokkaHtmlPartial/iosMain"],":swipebox:dokkaHtmlPartial/iosMain":[":swipebox:dokkaHtmlPartial/commonMain"],":swipebox:dokkaHtmlPartial/iosSimulatorArm64Main":[":swipebox:dokkaHtmlPartial/commonMain",":swipebox:dokkaHtmlPartial/iosMain"],":swipebox:dokkaHtmlPartial/iosX64Main":[":swipebox:dokkaHtmlPartial/commonMain",":swipebox:dokkaHtmlPartial/iosMain"],":swipebox:dokkaHtmlPartial/wasmJsMain":[":swipebox:dokkaHtmlPartial/commonMain"]}' \ No newline at end of file diff --git a/swipebox/com.kevinnzou.swipebox.widget/-swipe-content.html b/swipebox/com.kevinnzou.swipebox.widget/-swipe-content.html index 41b90dc..9c252d8 100644 --- a/swipebox/com.kevinnzou.swipebox.widget/-swipe-content.html +++ b/swipebox/com.kevinnzou.swipebox.widget/-swipe-content.html @@ -66,7 +66,7 @@

SwipeContent

fun RowScope.SwipeContent(background: Color = Color.White, weight: Float = 1.0f, onClick: () -> Unit, content: @Composable () -> Unit)

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

background

the background color of the box

weight

the weight of the box

onClick

the action to be executed when the box is clicked

content

the real content of the box

diff --git a/swipebox/com.kevinnzou.swipebox.widget/-swipe-icon.html b/swipebox/com.kevinnzou.swipebox.widget/-swipe-icon.html index 6ccce02..b0d58a6 100644 --- a/swipebox/com.kevinnzou.swipebox.widget/-swipe-icon.html +++ b/swipebox/com.kevinnzou.swipebox.widget/-swipe-icon.html @@ -66,7 +66,7 @@

SwipeIcon

fun RowScope.SwipeIcon(imageVector: ImageVector, contentDescription: String?, tint: Color = LocalContentColor.current.copy(alpha = LocalContentAlpha.current), background: Color = Color.White, iconSize: Dp = 16.dp, weight: Float = 1.0f, onClick: () -> Unit)

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


fun RowScope.SwipeIcon(background: Color = Color.White, painter: Painter, contentDescription: String?, iconSize: Dp = 16.dp, tint: Color = LocalContentColor.current.copy(alpha = LocalContentAlpha.current), weight: Float = 1.0f, onClick: () -> Unit)
fun RowScope.SwipeIcon(background: Color = Color.White, bitmap: ImageBitmap, contentDescription: String?, iconSize: Dp = 16.dp, tint: Color = LocalContentColor.current.copy(alpha = LocalContentAlpha.current), weight: Float = 1.0f, onClick: () -> Unit)
diff --git a/swipebox/com.kevinnzou.swipebox.widget/-swipe-text.html b/swipebox/com.kevinnzou.swipebox.widget/-swipe-text.html index 1db61a1..0ec85bf 100644 --- a/swipebox/com.kevinnzou.swipebox.widget/-swipe-text.html +++ b/swipebox/com.kevinnzou.swipebox.widget/-swipe-text.html @@ -66,7 +66,7 @@

SwipeText

fun RowScope.SwipeText(background: Color = Color.White, weight: Float = 1.0f, onClick: () -> Unit, text: @Composable () -> Unit)

Created By Kevin Zou On 2023/10/18

diff --git a/swipebox/com.kevinnzou.swipebox.widget/index.html b/swipebox/com.kevinnzou.swipebox.widget/index.html index 158ab35..5f92c00 100644 --- a/swipebox/com.kevinnzou.swipebox.widget/index.html +++ b/swipebox/com.kevinnzou.swipebox.widget/index.html @@ -119,7 +119,7 @@

Functions

diff --git a/swipebox/com.kevinnzou.swipebox/-swipe-box.html b/swipebox/com.kevinnzou.swipebox/-swipe-box.html index d82597c..82aa613 100644 --- a/swipebox/com.kevinnzou.swipebox/-swipe-box.html +++ b/swipebox/com.kevinnzou.swipebox/-swipe-box.html @@ -66,7 +66,7 @@

SwipeBox

fun SwipeBox(modifier: Modifier = Modifier, state: SwipeableState<Int> = rememberSwipeableState(initialValue = 0), swipeDirection: SwipeDirection = SwipeDirection.EndToStart, startContentWidth: Dp = 0.dp, startContent: @Composable RowScope.(swipeableState: SwipeableState<Int>, startSwipeProgress: Float) -> Unit? = null, endContentWidth: Dp = 0.dp, endContent: @Composable RowScope.(swipeableState: SwipeableState<Int>, endSwipeProgress: Float) -> Unit? = null, thresholds: (from: Int, to: Int) -> ThresholdConfig = { _, _ -> FixedThreshold(12.dp) }, content: @Composable BoxScope.(swipeableState: SwipeableState<Int>, startSwipeProgress: Float, endSwipeProgress: Float) -> Unit)

Designed a box layout that you can swipe to show action boxes from both directions

Parameters

modifier

The modifier to be applied to the SwipeBox.

state

The state object to be used to control the SwipeBox.

swipeDirection

The direction to swipe to. If the direction is SwipeDirection.EndToStart, then only the endContent will be shown.

startContentWidth

The width of the start content which will be shown when the swipe direction is StartToEnd or Both.

startContent

The content of the start content. Two parameters will be provided to that content:

  1. swipeableState: SwipeableState, which can be used to change the swipe state.

  2. 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.

endContentWidth

The width of the end content which will be shown when the swipe direction is EndToStart or Both.

endContent

The content of the end content. Two parameters will be provided to that content:

  1. swipeableState: SwipeableState, which can be used to change the swipe state.

  2. 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.

thresholds

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.

content

The main content that will be shown at max width when there is no swipe action. It will be provided three parameters:

  1. swipeableState: SwipeableState, which can be used to change the swipe state.

  2. startSwipeProgress: Float, which represent the progress of the swipe of the start content, 0f for null startContent.

  3. endSwipeProgress: Float, which represent the progress of the swipe of the end content, 0f for null endContent.

diff --git a/swipebox/com.kevinnzou.swipebox/-swipe-direction/-both/index.html b/swipebox/com.kevinnzou.swipebox/-swipe-direction/-both/index.html index 5c31fd2..0472cd3 100644 --- a/swipebox/com.kevinnzou.swipebox/-swipe-direction/-both/index.html +++ b/swipebox/com.kevinnzou.swipebox/-swipe-direction/-both/index.html @@ -105,7 +105,7 @@

Properties

diff --git a/swipebox/com.kevinnzou.swipebox/-swipe-direction/-end-to-start/index.html b/swipebox/com.kevinnzou.swipebox/-swipe-direction/-end-to-start/index.html index 45d1a79..4d95b33 100644 --- a/swipebox/com.kevinnzou.swipebox/-swipe-direction/-end-to-start/index.html +++ b/swipebox/com.kevinnzou.swipebox/-swipe-direction/-end-to-start/index.html @@ -105,7 +105,7 @@

Properties

diff --git a/swipebox/com.kevinnzou.swipebox/-swipe-direction/-start-to-end/index.html b/swipebox/com.kevinnzou.swipebox/-swipe-direction/-start-to-end/index.html index ab19a70..5556090 100644 --- a/swipebox/com.kevinnzou.swipebox/-swipe-direction/-start-to-end/index.html +++ b/swipebox/com.kevinnzou.swipebox/-swipe-direction/-start-to-end/index.html @@ -105,7 +105,7 @@

Properties

diff --git a/swipebox/com.kevinnzou.swipebox/-swipe-direction/entries.html b/swipebox/com.kevinnzou.swipebox/-swipe-direction/entries.html index 88e0ca8..2427772 100644 --- a/swipebox/com.kevinnzou.swipebox/-swipe-direction/entries.html +++ b/swipebox/com.kevinnzou.swipebox/-swipe-direction/entries.html @@ -66,7 +66,7 @@

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.

diff --git a/swipebox/com.kevinnzou.swipebox/-swipe-direction/index.html b/swipebox/com.kevinnzou.swipebox/-swipe-direction/index.html index 9eeed99..5e2f8cf 100644 --- a/swipebox/com.kevinnzou.swipebox/-swipe-direction/index.html +++ b/swipebox/com.kevinnzou.swipebox/-swipe-direction/index.html @@ -203,7 +203,7 @@

Functions

diff --git a/swipebox/com.kevinnzou.swipebox/-swipe-direction/value-of.html b/swipebox/com.kevinnzou.swipebox/-swipe-direction/value-of.html index b6024e2..2403706 100644 --- a/swipebox/com.kevinnzou.swipebox/-swipe-direction/value-of.html +++ b/swipebox/com.kevinnzou.swipebox/-swipe-direction/value-of.html @@ -66,7 +66,7 @@

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

diff --git a/swipebox/com.kevinnzou.swipebox/-swipe-direction/values.html b/swipebox/com.kevinnzou.swipebox/-swipe-direction/values.html index e111aa0..a91eaf4 100644 --- a/swipebox/com.kevinnzou.swipebox/-swipe-direction/values.html +++ b/swipebox/com.kevinnzou.swipebox/-swipe-direction/values.html @@ -66,7 +66,7 @@

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.

diff --git a/swipebox/com.kevinnzou.swipebox/index.html b/swipebox/com.kevinnzou.swipebox/index.html index 6a5297e..f0136ee 100644 --- a/swipebox/com.kevinnzou.swipebox/index.html +++ b/swipebox/com.kevinnzou.swipebox/index.html @@ -108,7 +108,7 @@

Functions

diff --git a/swipebox/index.html b/swipebox/index.html index b8352bb..a51ff15 100644 --- a/swipebox/index.html +++ b/swipebox/index.html @@ -103,7 +103,7 @@

Packages