All Projects → NadiKuts → React Native Pull Refresh

NadiKuts / React Native Pull Refresh

Custom pull to refresh component for Android

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Native Pull Refresh

app-intro-lottie-expo
App Intro component with Expo, styled-components and Lottie
Stars: ✭ 46 (-89.91%)
Mutual labels:  lottie, expo
Phoenix
Phoenix Pull-to-Refresh
Stars: ✭ 4,048 (+787.72%)
Mutual labels:  pull-to-refresh
Expo Netflix
Netflix UI Clone with React Native & Expo || web support => https://expo-netflix.vercel.app
Stars: ✭ 297 (-34.87%)
Mutual labels:  expo
Firebase Instagram
📸 Instagram clone with Firebase Cloud Firestore, Expo, and React Native 😁😍
Stars: ✭ 389 (-14.69%)
Mutual labels:  expo
Lottie Windows
Lottie-Windows is a library (and related tools) for rendering Lottie animations on Windows 10.
Stars: ✭ 322 (-29.39%)
Mutual labels:  lottie
React Native Version
🔢 Version your React Native or Expo app in a `npm version` fashion.
Stars: ✭ 408 (-10.53%)
Mutual labels:  expo
Expo Spotify
Spotify UI Clone with React Native & Expo || web support => https://expo-spotify.vercel.app
Stars: ✭ 287 (-37.06%)
Mutual labels:  expo
Lottie Flutter
Render After Effects animations natively on Flutter. This package is a pure Dart implementation of a Lottie player.
Stars: ✭ 444 (-2.63%)
Mutual labels:  lottie
React Native Svg Animated Linear Gradient
A wrap SVG component for animated linear gradient
Stars: ✭ 418 (-8.33%)
Mutual labels:  expo
React Pull To Refresh
React component for web pull to refresh
Stars: ✭ 390 (-14.47%)
Mutual labels:  pull-to-refresh
Zhumulangma
高仿喜马拉雅Android客户端,单activity多fragme组件化架构(新增ams版)
Stars: ✭ 377 (-17.32%)
Mutual labels:  lottie
Brv
Android上最强大的RecyclerView库
Stars: ✭ 345 (-24.34%)
Mutual labels:  pull-to-refresh
Scrollload
scroll bottom load more data pull refresh 滚动到底部加载更多数据 下拉刷新
Stars: ✭ 411 (-9.87%)
Mutual labels:  pull-to-refresh
Ng Lottie
Render After Effects animations on Angular based on lottie-web
Stars: ✭ 311 (-31.8%)
Mutual labels:  lottie
Expo Three
Utilities for using THREE.js on Expo
Stars: ✭ 432 (-5.26%)
Mutual labels:  expo
Mobile App
See your city's air pollution measured in daily cigarettes. iOS/Android.
Stars: ✭ 291 (-36.18%)
Mutual labels:  expo
React Native Dating App
Dating app - Exponent and React Native
Stars: ✭ 352 (-22.81%)
Mutual labels:  expo
Pull To Reload
Pull to reload implementation for the web. Designed to work with both mobile and websites.
Stars: ✭ 396 (-13.16%)
Mutual labels:  pull-to-refresh
Swiftpulltorefresh
An easy way to implement pull-to-refresh feature based on UIScrollView extension, written in Swift 4.
Stars: ✭ 451 (-1.1%)
Mutual labels:  pull-to-refresh
Urweatherview
Show the weather effects onto view written in Swift4.2
Stars: ✭ 439 (-3.73%)
Mutual labels:  lottie

Custom Android Pull to Refresh

Inspired by the shots from the author: https://dribbble.com/yupnguyen

Expo Demo

Coffee Concept Coin Concept Weather Concept
Output sample Output sample Output sample

Description

Currently, react-native provides RefreshControl out of the box. (Which uses standard circle android animation). https://facebook.github.io/react-native/docs/refreshcontrol.html.

However, it is not 'yet' possible to override the animation that runs during refreshing phase. This package aims to fill this gap and provide a 'relatively' easy way to add your own custom animation.

Installation

  1. Install the package using either:
$ npm install --save react-native-pull-refresh
# or
$ yarn add react-native-pull-refresh
  1. Install and link the Lottie package (renders Adobe After Effect animations): https://github.com/airbnb/lottie-react-native
yarn add lottie-react-native
# or
npm i --save lottie-react-native

react-native link lottie-react-native

Usage

This code is taken from examples/SimpleAnimations/weatherAnimation sample

You can find < Header /> and < ScrollItem /> components in the sample folder

import PullToRefresh from 'react-native-pull-refresh';

export default class weatherAnimation extends Component {
  constructor( ) {
    super( );
    this.state = {
      isRefreshing: false,
    };
  }

  onRefresh() {
    this.setState({isRefreshing: true});
    
    // Simulate fetching data from the server
    setTimeout(() => {
      this.setState({isRefreshing: false});
    }, 5000);
  }

  render() {
    return (
      <View style={{flex:1}}>
        <Header/>
        <View style={{flex: 7, backgroundColor: '#F8F4FC'}}>
          <PullToRefresh
            isRefreshing= {this.state.isRefreshing}
            onRefresh= {this.onRefresh.bind(this)}
            animationBackgroundColor = {'#564A63'}
            pullHeight = {180}
            contentView = {
              <ScrollView>
                <ScrollItem/>
                <ScrollItem/>
                <ScrollItem/>
                <ScrollItem/>
                <ScrollItem/>
                <ScrollItem/>
                <ScrollItem/>
                <ScrollItem/>
                <ScrollItem/>
              </ScrollView>
            }
            
            onPullAnimationSrc ={require('./umbrella_pull.json')}
            onStartRefreshAnimationSrc ={require('./umbrella_start.json')}
            onRefreshAnimationSrc = {require('./umbrella_repeat.json')}
            onEndRefreshAnimationSrc = {require('./umbrella_end.json')}
          />
        </View>
      </View>
    );
  }
}

Animation Files Format

Lottie JSON - https://github.com/airbnb/lottie-react-native

Lottie is a mobile library, developed by AirBnB for Android and iOS that parses Adobe After Effects animations exported as JSON with bodymovin and renders them natively on mobile.

Lottie allows to easily use animations in react-native apps. You just need to create an animation in Adobe After Effects and export it with bodymovin addon to AE https://github.com/bodymovin/bodymovin.

You can find file examples in examples/SimpleAnimations/animations folder

General Props

Prop Type Description
isRefreshing Boolean Refresh state set by parent to trigger refresh.
pullHeight Integer Pull Distance Default 180.
onRefresh Function Callback after refresh event
contentView Object The content: ScrollView or ListView
animationBackgroundColor string Background color
onScroll Function Custom onScroll event

Animation Source Files Props

Prop Description
onPullAnimationSrc Animation JSON that runs when scroll view is pulled down
onStartRefreshAnimationSrc Animation JSON that runs after view was pulled and released
onRefreshAnimationSrc Animation JSON that runs continuously until isRefreshing props is not changed
onEndRefreshAnimationSrc Animation JSON that runs after isRefreshing props is changed

Demo

The demo app can be found at examples/SimpleAnimations.

Install Expo App on your Android smartphone

Scan this QR-code with your Expo App.

alt text

... or go here and try it out!

Contribution / Issues

Are very welcome! :)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].