Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
valkriaine committed Jan 24, 2021
2 parents 7a66774 + d07d52b commit 3183369
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Bouncy

[ ![Download](https://api.bintray.com/packages/valkriaine/factor/bouncy/images/download.svg?version=1.6) ](https://bintray.com/valkriaine/factor/bouncy/1.6/link)
[ ![Download](https://api.bintray.com/packages/valkriaine/factor/bouncy/images/download.svg?version=1.61) ](https://bintray.com/valkriaine/factor/bouncy/1.61/link)

Add IOS-like overscroll animation to your scrolling views using [SpringAnimation](https://developer.android.com/guide/topics/graphics/spring-animation).

Expand All @@ -12,7 +12,7 @@ Currently includes BouncyRecyclerView and BouncyNestedScrollView.
```
dependencies {
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.factor:bouncy:1.6'
implementation 'com.factor:bouncy:1.61'
}
```
(androidx.recyclerview is required for BouncyRecyclerView to work)
Expand All @@ -26,7 +26,7 @@ Achieved by overriding the default EdgeEffect

<img src="./images/BouncyNestedScrollViewDemo.gif"/> <img src="./images/FactorLauncherSettingsScreen.gif"/>

Usage:
## Usage:

Use as normal NestedScrollView. Place it in your layout:

Expand Down Expand Up @@ -63,7 +63,7 @@ BouncyRecyclerView adds overscroll effect to RecyclerView and supports drag & dr

<img src="./images/BouncyRecyclerViewDemo.gif"/> <img src="./images/reorder_and_swipe.gif"/>

Usage:
## Usage:

Use as normal RecyclerView. Place it in your layout:

Expand All @@ -87,13 +87,15 @@ set up layout manager and adapter. Theoratically supports any LayoutManager:
//recycler_view.setLayoutManager(new GridLayoutManager(context, 3));
```

## Customization

```recyclerview_fling_animation_size``` specifies the magnitude of overscroll effect for fling, default is 0.5 if no value is given

```recyclerview_overscroll_animation_size``` specifies the magnitude of overscroll effect for drag, default is 0.5 if no value is given

```allow_drag_reorder``` and ```allow_item_swipe``` are set to false by default. If you would like to enable these features, simply set them to true.

1.6 version supports customizing the spring animation proerties.
### Spring customization (Bouncy 1.6 and above)

```recyclerview_damping_ratio``` and ```recyclerview_stiffness``` please refer to [damping ratio](https://developer.android.com/guide/topics/graphics/spring-animation#damping-ratio) and [stiffness](https://developer.android.com/guide/topics/graphics/spring-animation#stiffness)

Expand Down Expand Up @@ -126,7 +128,9 @@ A known issue is when customizing spring properties, items close to the edges of
</androidx.core.widget.NestedScrollView>
```

**Drag & drop does not work out of the box.
## Drag & drop

Drag & drop does not work out of the box.

For drag & drop or swipe gestures to work, make your adapter extend ```BouncyRecyclerView.Adapter``` and add constructor matching parent.
(If your adapter does not extend BouncyRecyclerView.Adapter, BouncyRecyclerView will simply disable the gestures)
Expand Down

0 comments on commit 3183369

Please sign in to comment.