Skip to content

Commit

Permalink
Remove all references to Snapper (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbanes authored Oct 29, 2023
1 parent 1d01706 commit 0185feb
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 201 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ org.eclipse.buildship.core.prefs
.project
bin/

# Docs
site/


##########################################################################################
# Imported from https://github.com/github/gitignore/blob/main/Swift.gitignore
Expand Down
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@

## Haze

Snapper is now deprecated, due to it's functionality being replaced by [`SnapFlingBehavior`](https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/snapping/SnapFlingBehavior) which is available in Jetpack Compose 1.3.0.

The `SnapFlingBehavior` API is very similar to Snapper, so migration should be very easy. I haven't provided an automatic migration path, as I feel that it's important to learn the new API by performing the migration yourself.

## Library

![](docs/assets/header.png)

Snapper is a library which brings snapping to the Compose scrolling layouts (currently only LazyColumn and LazyRow).

Check out the website for more information: https://chrisbanes.github.io/haze

## License
Expand Down
1 change: 0 additions & 1 deletion docs/assets/croc.svg

This file was deleted.

Binary file removed docs/assets/demo.mp4
Binary file not shown.
Binary file removed docs/assets/header.png
Binary file not shown.
Binary file removed docs/assets/tivi.mp4
Binary file not shown.
55 changes: 2 additions & 53 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,9 @@
[![Maven Central](https://img.shields.io/maven-central/v/dev.chrisbanes.haze/snapper)](https://search.maven.org/search?q=g:dev.chrisbanes.haze)
[![Maven Central](https://img.shields.io/maven-central/v/dev.chrisbanes.haze/haze)](https://search.maven.org/search?q=g:dev.chrisbanes.haze)

![](assets/header.png)

## Deprecated

Snapper is now deprecated, due to it's functionality being replaced by [`SnapFlingBehavior`](https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/snapping/SnapFlingBehavior) in Jetpack Compose 1.3.0.

The `SnapFlingBehavior` API is very similar to Snapper, so migration should be very easy. I haven't provided an automatic migration path, as I feel that it's important to learn the new API by performing the migration yourself.

## Library

Snapper is a library which brings snapping to the Compose scrolling layouts (currently LazyColumn and LazyRow):

=== "Sample app"

<video width="100%" controls loop style="max-width: 600px">
<source src="assets/demo.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>


=== "Tivi"

<video width="100%" controls loop style="max-width: 600px">
<source src="assets/tivi.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>


The basic usage looks like so:

``` kotlin
val lazyListState = rememberLazyListState()

LazyRow(
state = lazyListState,
flingBehavior = rememberSnapperFlingBehavior(lazyListState),
) {
// content
}
```

## API Summary

The API is generally split into a few things:

- [SnapperFlingBehavior](api/lib/dev.chrisbanes.haze/-snapper-layout-info/), which is what apps provide to scrollable containers.
- A number of [remember functions](api/lib/dev.chrisbanes.haze/remember-snapper-fling-behavior.html) allowing easy use of `SnapperFlingBehavior` from composables.
- [SnapperFlingLayoutInfo](api/lib/dev.chrisbanes.haze/-snapper-layout-info/), which is an facade class allowing `SnapperFlingBehavior` to interact with different scrollable container state in a generic way.
- Implementations of `SnapperFlingLayoutInfo` for easy integration, such as [LazyListFlingLayoutInfo](api/lib/dev.chrisbanes.haze/-lazy-list-snapper-layout-info/).

For examples, refer to the [samples](https://github.com/chrisbanes/snapper/tree/main/sample/src/main/java/dev/chrisbanes/snapper/sample).

## Download

[![Maven Central](https://img.shields.io/maven-central/v/dev.chrisbanes.haze/snapper)](https://search.maven.org/search?q=g:dev.chrisbanes.haze)
[![Maven Central](https://img.shields.io/maven-central/v/dev.chrisbanes.haze/haze)](https://search.maven.org/search?q=g:dev.chrisbanes.haze)

```groovy
repositories {
Expand Down
130 changes: 0 additions & 130 deletions docs/usage.md

This file was deleted.

3 changes: 1 addition & 2 deletions docs/using-snapshot-version.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Using a Snapshot Version of the Library

If you would like to depend on the cutting edge version of the Snapper
library, you can use the [snapshot versions][snap] that are published to
If you would like to depend on the cutting edge version of the library, you can use the [snapshot versions][snap] that are published to
[Sonatype OSSRH](https://central.sonatype.org/)'s snapshot repository. These are updated on every commit to `main`.

To do so:
Expand Down
9 changes: 4 additions & 5 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ repo_url: 'https://github.com/chrisbanes/haze'
# Navigation
nav:
- 'Overview': index.md
- 'Usage': usage.md
- 'API reference': api/lib/dev.chrisbanes.haze/
- 'API reference': api/
- 'Sample code': https://github.com/chrisbanes/haze/tree/main/sample/shared/src/commonMain/kotlin/dev/chrisbanes/haze/sample

# Configuration
Expand All @@ -24,11 +23,11 @@ theme:
language: 'en'
logo: assets/croc.svg
palette:
primary: 'teal'
primary: 'white'
accent: 'teal'
font:
text: 'Roboto'
code: 'JetBrains Mono'
text: 'DM Sans'
code: 'Space Mono'

# Extensions
markdown_extensions:
Expand Down

0 comments on commit 0185feb

Please sign in to comment.