All Projects → hzl123456 → React Native Rk Pull To Refresh

hzl123456 / React Native Rk Pull To Refresh

a pull to refresh component for react-native, same api on both android and ios

Programming Languages

javascript
184084 projects - #8 most used programming language

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

Pull To Refresh.rentals Ios
This project aims to provide a simple and customizable pull to refresh implementation. Made in Yalantis
Stars: ✭ 2,171 (+2071%)
Mutual labels:  pull-to-refresh, refresh
Kafkarefresh
Animated, customizable, and flexible pull-to-refresh framework for faster and easier iOS development.
Stars: ✭ 1,033 (+933%)
Mutual labels:  pull-to-refresh, refresh
SwiftFCXRefresh
Pull to refresh in Swift.
Stars: ✭ 29 (-71%)
Mutual labels:  refresh, pull-to-refresh
Pull To Refresh
ESPullToRefresh is developed and maintained by Vincent Li. If you have any questions or issues in using ESPullToRefresh, welcome to issue. If you want to contribute to ESPullToRefresh, Please submit Pull Request, I will deal with it as soon as possible.
Stars: ✭ 1,591 (+1491%)
Mutual labels:  pull-to-refresh, refresh
ParticlesRefreshLayout-android
Particles Refresh Layout library for Android
Stars: ✭ 15 (-85%)
Mutual labels:  refresh, pull-to-refresh
MagiRefresh
swift版下拉刷新,支持多种样式,同时支持,加载动画,网络错误占位(有兴趣学习如何用swift使用runtime的可以看看)
Stars: ✭ 25 (-75%)
Mutual labels:  refresh, pull-to-refresh
Swiperefreshlayout
swipeRefreshLayout refresh pull-to-refresh
Stars: ✭ 26 (-74%)
Mutual labels:  pull-to-refresh, refresh
Liquid Pull To Refresh
🔁 A custom refresh indicator for flutter.
Stars: ✭ 769 (+669%)
Mutual labels:  pull-to-refresh
Pulltorefresh H5 Iscroll
基于IScroll5的PullToRefresh实现.。提供多套皮肤机制,便于拓展!
Stars: ✭ 56 (-44%)
Mutual labels:  pull-to-refresh
Spring Cloud Examples
Spring Cloud 学习案例,服务发现、服务治理、链路追踪、服务监控等
Stars: ✭ 5,829 (+5729%)
Mutual labels:  refresh
Flutter refresh
A Flutter plugin for refreshing every scrollable view by pulling down-up.
Stars: ✭ 70 (-30%)
Mutual labels:  pull-to-refresh
Flutter refresh
flutter refresh 上拉刷新 下拉加载 进度条
Stars: ✭ 51 (-49%)
Mutual labels:  refresh
Aosf
AOSF:全称为Android Open Source Framework,即Android优秀开源框架汇总。包含:网络请求okhttp,图片下载glide,数据库greenDAO,链式框架RxJava,组件路由ARouter,消息传递通信EventBus,热更新Tinker,插件化框架Replugin,文件下载FileDownloaer,图片选择PhotoPicker,图片滤镜/毛玻璃等特效处理,GIF图片展示控件,图片九宫格控件NineGridView,对话框Dialog,导航指示器ViewpagerIndicator,进度条ProgressWheel,下拉刷新SmartRefreshLayout,key-value高效数据存储MMKV等,应有尽有。
Stars: ✭ 601 (+501%)
Mutual labels:  refresh
Refreshwithappbarlayout
类似知乎和BilibiliAndroid端个人中心界面 添加下拉刷新效果
Stars: ✭ 19 (-81%)
Mutual labels:  refresh
Ultimaterefreshview
UltimateRefreshView 实现下拉刷新,上拉加载更多的轻量级库;支持RecyclerView ,ListView ,ScrollView & WebView
Stars: ✭ 64 (-36%)
Mutual labels:  pull-to-refresh
Vue Pull To
⚡️ A pull-down refresh and pull-up load more and infinite scroll component for Vue.js --Vue下拉刷新组件
Stars: ✭ 708 (+608%)
Mutual labels:  pull-to-refresh
Smoothrefreshlayout
一款支持上下拉刷新、越界回弹、二级刷新、横向刷新、拉伸回弹、平滑滚动、嵌套滚动的多功能刷新控件
Stars: ✭ 1,166 (+1066%)
Mutual labels:  refresh
Pullrefreshlayout
下拉刷新,上拉加载,真实的回弹(overscroll)效果(媲美qq),且大小只有37KB(是其他主流刷新库或回弹库的1/2,1/3,甚至是1/4),同时,自定义header和footer,可以实现任何你想的到的功能(例如:自动触发加载更多、二级刷新等)
Stars: ✭ 639 (+539%)
Mutual labels:  pull-to-refresh
Refresher
DEPRECATED: Pull to refresh in Swift
Stars: ✭ 885 (+785%)
Mutual labels:  pull-to-refresh
Collapsingrefresh
AppBarLayout+ViewPager+RecyclerView的刷新功能
Stars: ✭ 69 (-31%)
Mutual labels:  refresh

react-native-rk-pull-to-refresh(ios/android)

中文说明

A pull to refresh component for react-native, same api on both android and ios.Also you can design you owner pull style for this component.You can use it for most of the component in react-native such as View,Scrollview,Listview and Flatlist.

Preview

ios

android

Installation

npm install react-native-rk-pull-to-refresh --save
react-native link react-native-rk-pull-to-refresh

How to use

It contains PullView,PullScrollView,PullListView and PullFlatList.If you want to use PullFlatList,you should use this component whith React Native 0.43 and newer.

Use it for Listview with default style

import React, {PureComponent} from 'react';
import {ListView, View, Text, Dimensions} from 'react-native';
import {PullListView} from 'react-native-rk-pull-to-refresh'

const width = Dimensions.get('window').width

export default class PullListViewDemo extends PureComponent {

    constructor(props) {
        super(props);
        this.dataSource =
            new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}).cloneWithRows(this.getDataSource())
    }

    getDataSource = () => {
        let array = new Array();
        for (let i = 0; i < 50; i++) {
            array.push(`ListViewItem:${i + 1}`);
        }
        return array;
    }

    render() {
        return (
            <PullListView
                ref={(c) => this.pull = c}
                isContentScroll={true}
                style={{flex: 1, width: width}}
                onPushing={this.props.onPushing}
                onPullRelease={this._onPullRelease}
                dataSource={this.dataSource}
                renderRow={this._renderRow}/>
        )
    }

    _onPullRelease = () => {
        setTimeout(() => {
            this.pull && this.pull.finishRefresh()
        }, 2000)
    }

    _renderRow = (rowData) => {
        return (
            <View style={{width: width, height: 50, justifyContent: 'center', alignItems: 'center'}}>
                <Text>{rowData}</Text>
            </View>);
    }

    componentDidMount() {
        this.pull && this.pull.startRefresh()
    }
}

Use it for View with you owner style

import React, {PureComponent} from 'react';
import {View, Text, Dimensions, StyleSheet, ActivityIndicator} from 'react-native';
import {PullView} from 'react-native-rk-pull-to-refresh'

const width = Dimensions.get('window').width
const topIndicatorHeight = 50

export default class PullViewDemo extends PureComponent {

    render() {
        return (
            <PullView
                ref={(c) => this.pull = c}
                style={{flex: 1, width: width}}
                topIndicatorRender={this.topIndicatorRender}
                topIndicatorHeight={topIndicatorHeight}
                onPullStateChangeHeight={this.onPullStateChangeHeight}
                onPushing={this.props.onPushing}
                onPullRelease={this._onPullRelease}>

                <Text style={{flex: 1, width: width, paddingTop: 200, textAlign: 'center'}}>这是内容</Text>

            </PullView>
        )
    }

    onPullStateChangeHeight = (pullState, moveHeight) => {
        if (pullState == 'pulling') {
            this.txtPulling && this.txtPulling.setNativeProps({style: styles.show});
            this.txtPullok && this.txtPullok.setNativeProps({style: styles.hide});
            this.txtPullrelease && this.txtPullrelease.setNativeProps({style: styles.hide});
        } else if (pullState == 'pullok') {
            this.txtPulling && this.txtPulling.setNativeProps({style: styles.hide});
            this.txtPullok && this.txtPullok.setNativeProps({style: styles.show});
            this.txtPullrelease && this.txtPullrelease.setNativeProps({style: styles.hide});
        } else if (pullState == 'pullrelease') {
            this.txtPulling && this.txtPulling.setNativeProps({style: styles.hide});
            this.txtPullok && this.txtPullok.setNativeProps({style: styles.hide});
            this.txtPullrelease && this.txtPullrelease.setNativeProps({style: styles.show});
        }
    }


    topIndicatorRender = () => {
        return (
            <View style={{flexDirection: 'row', justifyContent: 'center', alignItems: 'center', height: topIndicatorHeight}}>

                <ActivityIndicator size="small" color="gray" style={{marginRight: 5}}/>

                <Text ref={(c) => this.txtPulling = c} style={styles.hide}>pulling...</Text>

                <Text ref={(c) => this.txtPullok = c} style={styles.hide}>pullok...</Text>

                <Text ref={(c) => this.txtPullrelease = c} style={styles.hide}>pullrelease...</Text>

            </View>
        );
    }


    _onPullRelease = () => {
        setTimeout(() => {
            this.pull && this.pull.finishRefresh()
        }, 2000)
    }

    componentDidMount() {
        this.pull && this.pull.startRefresh()
    }
}

const styles = StyleSheet.create({
    hide: {
        position: 'absolute',
        left: 10000,
        backgroundColor: 'transparent'
    },
    show: {
        position: 'relative',
        left: 0,
        backgroundColor: 'transparent'
    }
});

Full Demo

clone or download PullToRefreshDemo

Props

Porp Type Optional Default Description
refreshable bool yes true can pull to refresh or not
isContentScroll bool yes false content scroll when pulling
onPullRelease func yes when refreshing, this function will be called
topIndicatorRender func yes top pulling render for this component,when the value is undefined,this component use default top pulling render
topIndicatorHeight number yes top pulling render header,when topIndicatorRender is not undefined,you must set the correct topIndicatorHeight
onPullStateChangeHeight func yes when pulling, this function will be called
onPushing func yes when pulling, this function will be called

Method

startRefresh():force begin pull down refresh
finishRefresh():end pull down refresh

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].