Skip to content

Commit

Permalink
Merge branch 'master' of github.com:lilstiffy/SlideView
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanSmudja committed Aug 22, 2024
2 parents ad48fbf + 033f985 commit 358e274
Showing 1 changed file with 39 additions and 3 deletions.
42 changes: 39 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# PUBLISHING IS WIP, I WILL NOTIFY WHEN AVAILABLE

# SlideView

SlideView is a highly customizable UI component for Jetpack Compose that allows you to create slide-to-trigger actions in your Android apps. It's perfect for implementing features like slide-to-unlock or slide-to-confirm actions.
Expand All @@ -8,6 +6,9 @@ SlideView is a highly customizable UI component for Jetpack Compose that allows
<img src="./demo_video.gif" alt="Demo">
</p>

### All support is greatly appreciated
https://buymeacoffee.com/lilstiffy

## Features

- **Customizable:** Easily modify the appearance and behavior.
Expand All @@ -20,7 +21,7 @@ Add the following to your `build.gradle.kts`:

```kotlin
dependencies {
implementation("com.example:slideview:1.0.0")
implementation("com.lilstiffy:slideview:1.0.0")
}
```

Expand All @@ -32,6 +33,41 @@ SlideView(
modifier = Modifier.fillMaxWidth()
)
```
Here's how to customise the theming of the component:
```kotlin
SlideView(
text = "Slide to confirm",
onSlideDone = {
Log.d("Fancy log", "Slide completed!")
},
config = SlideViewConfig().copy(backgroundColor = Color.Cyan, thumbColor = Color.Black),
modifier = Modifier.padding(horizontal = 32.dp)
)
```
The theming is held within the SlideViewConfig object:
```kotlin
/**
* Configuration for the colors of the SwipeView.
*
* @param backgroundColor The background color of the SwipeView.
* @param thumbColor The color of the thumb icon.
* @param iconColor The color of the icon.
* @param textColor The color of the text.
* @param thumbIcon The icon to be displayed on the thumb.
* @param thumbIconDone The icon to be displayed on the thumb when the swipe is done.
*
* @author lilstiffy
*/
data class SlideViewConfig(
val backgroundColor: Color = Color.Black,
val thumbColor: Color = Color.White,
val iconColor: Color = Color.Black,
val textColor: Color = Color.White,

val thumbIcon: ImageVector = Icons.AutoMirrored.Outlined.KeyboardArrowRight,
val thumbIconDone: ImageVector = Icons.Outlined.Check,
)
```

## License
This project is licensed under the MIT License - see the LICENSE file for details.

0 comments on commit 358e274

Please sign in to comment.