# Slide To Act: a Material slide to unlock widget for Android, and its three year old artifact

> Slide To Act is a Kotlin Android widget that replaces a button with a slide gesture, drawn entirely with vectors and themed from your app colours. This looks at the attribute surface it exposes, the 80 percent completion bump, and what the release history says about depending on it.

**cortinico/slidetoact** — A simple 'Slide to Unlock' Material widget for Android, written in Kotlin 📱🎨🦄

- Repository: https://github.com/cortinico/slidetoact
- Stars: 1,227 · Forks: 169
- Language: Kotlin
- License: MIT
- Published: 2026-10-19 · Updated: 2026-10-19 · Language: en
- Canonical page: https://hysenlabs.com/projects/cortinico-slidetoact

## A confirmation gesture instead of a button

Slide To Act is a simple slide to unlock Material widget for Android, written in Kotlin. The pattern it implements is the one that mobile designers reach for when a tap is too easy to trigger by accident: the user drags a handle across a track, and only a completed drag counts as the action.

The audience is Android application developers who need that interaction, typically for a destructive or high consequence action. The library is positioned as easy to integrate, with just a Gradle compile line, and it works out of the box with no customization needed.

Two properties of the project are worth knowing before you look at the code. The widget is 100 percent vectorial, with no PNG or other assets provided, so it scales cleanly to any density and any theme change. And it is integrated with your app theme by default, with every SlideToActView fitting itself to your app using the `colorAccent` and `colorBackground` parameters from your theme.

One more detail is nice for a Java shop: the project states it is written in Kotlin, but you do not need Kotlin to use it. The example in the documentation binds the view from Java.

The library is MIT licensed, distributed through Maven Central under the `com.ncorti` group, and the repository is not archived, with the last push on 2026-10-08.

## Adding the dependency and the view to a layout

The library is on Maven Central, and adding it is a single Gradle line in the app module's build file, with the documentation explicitly warning not to put it in the root file:

```groovy
dependencies {
   implementation "com.ncorti:slidetoact:0.11.0"
}
```

If a Gradle dependency is not what you want, the `.AAR` artifact can be downloaded directly from Maven Central.

The view itself goes into an XML layout:

```xml
<com.ncorti.slidetoact.SlideToActView
    android:id="@+id/example"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:text="Example" />
```

And it is bound in code:

```java
SlideToActView sta = (SlideToActView) findViewById(R.id.example);
```

That is the whole integration. The view declares its own height as `wrap_content` and stretches to the parent width, so it behaves like a normal widget in a layout, and the `app:text` attribute sets the label on the track.

The minimum platform is API 14, compatible since v0.2.0, which is a very low floor and a sign that the widget was written to be dropped into older applications without ceremony.

## The attribute surface is where the customisation lives

Everything is configurable through custom attributes, and the documentation gives a full example of them together:

```xml
<com.ncorti.slidetoact.SlideToActView
    android:id="@+id/example_gray_on_green"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:elevation="6dp"
    app:area_margin="4dp"
    app:animation_duration="250"
    app:outer_color="@color/green"
    app:inner_color="@color/grey"
    app:border_radius="2dp"
    app:text="Testing all the custom attributes"
    app:text_size="12sp"
    app:slider_height="80dp"
    app:slider_locked="false"
    app:bounce_on_start="true" />
```

The colour attributes map onto the theme defaults in a specific way. `outer_color` controls the colour of the external area and of the arrow icon, defaulting to `colorAccent` from the theme, and `inner_color` controls the colour of the inner circular button, of the tick icon, and of the text, defaulting to `colorBackground`.

The geometry attributes are where the widget is more unusual than it looks. `area_margin` controls the margin of the inner circular button from the outside area, defaulting to 8dp, and it accepts a negative value to make the button bigger than the slider. That trick has a cost, and the documentation spells it out: you also need to set `android:clipChildren="false"` on the parent layout, or the oversized button is clipped away.

`icon_margin` controls the margin of the icon inside the circular button, defaulting to 16dp, and it exists for a specific interaction with `slider_height`: if you make the slider shorter without reducing the icon margin, the icon becomes tiny.

Other attributes cover the icon itself, `slider_icon` and `complete_icon`, the text styling through `text_size`, `text_style` and `text_appearance`, the radius through `border_radius`, and behaviour through `slider_locked`, `slider_reversed`, `animation_duration`, `bump_vibration`, `rotate_icon`, `state_complete` and `bounce_on_start`.

## The 80 percent bump is a design decision, not a bug

The documentation lists the widget as UX friendly, and explains what that means: the button will bump to complete if it is over 80 percent of the slider.

That is a small piece of interaction design that changes the feel of the widget considerably. A pure slide-to-unlock that requires the handle to reach the exact end of the track is punishing, because a user who is 95 percent of the way there is told they have failed. Letting the last 20 percent snap to completion removes the fiddly final few pixels and turns an imprecise gesture into a definite one.

The cost is that the gesture becomes easier to trigger accidentally, which matters if the action behind it is destructive. The `slider_locked` attribute is the counterweight, and it lets the caller control the state, so a widget can be disabled while an operation is in flight and re-enabled afterwards. `bounce_on_start` and `bump_vibration` cover the feedback side, and `state_complete` reflects the completed state back to the layout.

The project also documents event callbacks as a separate feature area, which is where the actual action is triggered. The widget is a view, so a host application wires the callback to whatever it wants the slide to mean, and the README does not reproduce the callback names, so a developer should read the API in the published documentation rather than guess from the attribute list.

## Where Slide To Act is the wrong tool

Two limits are structural.

The first is the platform and the UI toolkit. This is an XML view for Android. Jetpack Compose is not mentioned anywhere in the project documentation, and there is no Compose example in the repository, whose `example/` module is a traditional app with a `build.gradle.kts` and a `src/` tree. A Compose-only project has no documented way to use this widget, and a project halfway through migration has to keep a view based path alive for it.

The second limit is the release history, and it is the one that deserves the most attention. The tags show v0.11.0 published on 2023-07-15, v0.10.0 in September 2022, and v0.9.0 in July 2020. The last push to the repository was on 2026-10-08, so the source is being touched, but the newest artifact available from Maven Central is still 0.11.0, which is the version the documentation tells you to depend on.

Read that carefully. The code in the repository and the code you would resolve from Maven Central are not the same thing, and the gap is more than three years. A project that depends on this library is depending on a frozen artifact, and the improvements in the default branch, if any, are not reaching it. That is a real risk for a UI component, because Android platform changes continue and a widget that renders vectors and elevation is not immune to them.

There is also a licensing-adjacent detail for anyone who wants to fork. The library is MIT, so forking is legally trivial, but you would be picking up maintenance of a widget with a slow release cadence yourself.

## MIT, Maven Central, and a repository that keeps the build honest

The licence is MIT, with the licence file at the repository root and a badge linking to the MIT text. For a UI widget dropped into an application, that is as simple as it gets, with no attribution requirement beyond keeping the notice.

Distribution is Maven Central, under the group `com.ncorti` and the artifact `slidetoact`, with the `.AAR` also downloadable directly. The project has been featured in Android Weekly, and appears in the Awesome Kotlin list, which is a sign of visibility rather than of maintenance.

The repository layout shows a standard Gradle project with a `build.gradle.kts` at the root, a `settings.gradle.kts`, the `gradle/` wrapper directory, `gradlew` and `gradlew.bat`, a `gradle.properties` file, and the library itself in the `slidetoact/` module next to an `example/` module. There is a `renovate.json`, which means the dependency updates in the build are handled by a bot rather than by hand, and the `assets/` directory holds the documentation images and the animated GIF that the readme uses to show the widget in motion.

The build history in the readme references both CircleCI and TravisCI, with a CircleCI badge still at the top of the document. A readme that still shows two CI systems is a small signal of how the project's own documentation has aged, and it is worth keeping in mind when you judge the freshness of the widget itself.

## Conclusion

Slide To Act fits an Android team that wants a deliberate confirm gesture instead of a button, and that wants it themed from the existing app palette rather than shipped as a fixed asset. It is not a Compose-native widget, because it is an XML view and no Compose usage is documented, and it is a poor fit for a product that needs a maintained release cadence, since the newest artifact on Maven Central is 0.11.0 from 2023 while the repository itself was pushed to on 2026-10-08. Before you adopt it, check that the version you depend on, `com.ncorti:slidetoact:0.11.0`, is the one whose behaviour you tested, and read the attribute list in the project documentation rather than assuming the defaults will match your theme.

## FAQ

### How do I add the Slide To Act widget to an Android project?

Add `implementation "com.ncorti:slidetoact:0.11.0"` to the dependencies of your app module's build file, not the root file. Then place `<com.ncorti.slidetoact.SlideToActView>` in your XML layout and find the view in code.

### Does Slide To Act need Kotlin to use?

No. The project is written in Kotlin, but the documentation states you do not need Kotlin to use it, and the example binds the view from Java with a findViewById cast.

### What is the newest version of Slide To Act on Maven Central?

0.11.0, published on 2023-07-15. The repository itself was pushed to on 2026-10-08, so the source in the default branch is newer than the published artifact you would resolve.

### How do I change the colours of the Slide To Act widget?

By default the widget follows the `colorAccent` and `colorBackground` values from your app theme. The `outer_color` attribute sets the external area and the arrow icon, and `inner_color` sets the inner button, the tick icon and the text, with `border_radius` shaping the shape of both.

### Does the Slide To Act widget work with Jetpack Compose?

The project documentation does not mention Compose. The widget is an XML view, `com.ncorti.slidetoact.SlideToActView`, and the example module in the repository is a traditional view based Android app.

## Sources

- [cortinico/slidetoact on GitHub](https://github.com/cortinico/slidetoact)
- [Issues](https://github.com/cortinico/slidetoact/issues)
- [License: MIT](https://github.com/cortinico/slidetoact/blob/main/LICENSE)
- [README](https://github.com/cortinico/slidetoact/blob/main/README.md)
- [Releases](https://github.com/cortinico/slidetoact/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/cortinico-slidetoact
