npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-swipe-view

v3.0.1

Published

Native container view for enabling swipe actions (for example to enable swipe to delete and such)

Downloads

56

Readme

react-native-swipe-view

A native container which provides a smooth drag interaction with any react-native view to implement a horizontal swiping behaviour, for example: swiping a "card" view out of the screen to delete it.

Installation

Install from npm:

npm i --save react-native-swipe-view

Now link the native libraries:

Android

Add to the app build.gradle dependencies:

compile project(':RNSwipeView')

Add to settings.gradle:

include ':RNSwipeView'
project(':RNSwipeView').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-swipe-view/android')

Add the package to your MainApplication.java getPackages list:

import com.wix.RNSwipeView.SwipeViewPackage;

@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      //add this pacakge:
      new SwipeViewPackage()
  );
}
};

iOS

In Xcode, drag the SwipeView.xcodeproj from your node modules to the libraries list in the Project Navigator. Then add libSwipeView to your app target "Linked Frameworks and Libraries"

Usage

react-native-swipe-view export a Component called SwipeView which you can use to wrap any hirarchy of child views that you wish to be contained and interacted with a swipe behavior.

For example:

//import the swipe view container
import {SwipeView} from 'react-native-swipe-view';

//use it in your render function
<SwipeView changeOpacity removeViewOnSwipedOut style={{borderWidth: 4}}>
	<Text style={styles.welcome}>
		This is a swipe view!
	</Text>
	<Text style={styles.instructions}>
		Drag it to interact
	</Text>
</SwipeView>

supported props

| prop | default | type | description | | ---- | ---- | ----| ---- | | changeOpacity | false | Boolean | Should the component change content alphw while dragging | | removeViewOnSwipedOut |false | Boolean | Should the component be removed from the hierarchy after it is swiped out | | minPanToComplete | 0.5 | Number | The distance from the view center which needs to be completed in percents for the "swipe out" action to happen. If the threshold is not reached it will bounce back | | bounceBackAnimDuration | 0.35 | Number | Duration of bounce back animation when the threshold defined in minPanToComplete is not matched | | bounceBackAnimDamping | 0.65 | Number | Damping param of iOS bounce back animation when the threshold defined in minPanToComplete is not matched | | onSwipeStart | - | Function | Callback function which is called when the swiping action starts. A direction param is provided wiht left or right value | | onWillBeSwipedOut | - | Function | Callback function which is called right before a view is swiped out (when it passed the minPanToComplete threshold). A direction param is provided wiht left or right value | | onSwipedOut | - | Function | Callback function which is called after the "swiped out" animation is done. A direction param is provided wiht left or right value | | onWillBounceBack | - | Function | Callback function which is called right before a view bounces back (when it fails to pass the minPanToComplete threshold). A direction param is provided wiht left or right value | | onBouncedBack | - | Function | Callback function which is called after the "bounce back" animation is done. A direction param is provided wiht left or right value |