NadiKuts / react-native-pull-refresh

Custom pull to refresh component for Android
https://expo.io/@devilsanek/animated-pull-to-refresh
565 stars 127 forks source link

Animation bugs on scroll down #2

Open gabrielvcbessa opened 7 years ago

gabrielvcbessa commented 7 years ago

If you have an empty or small list, and scroll down, the animation disappears and onRefresh method is not called anymore.

MarkDaleman commented 6 years ago

This is also happening for me when I have a long list. See the attached gif for a video of the problem that we're having.

you can click me for an example

Also, I'm using this piece of code to render the whole thingy:

render() {
  return (
    <View style={{flex: 1}}>
      <PullToRefresh
        isRefreshing= {this.state.isRefreshing}
        onRefresh= {this.onRefresh.bind(this)}
        animationBackgroundColor = {'#D3D3D3'}
        pullHeight = {180}
        contentView = {
          <ScrollView showsVerticalScrollIndicator={false}>
              <Text style={styles.welcome}>Welcome to React Native 0</Text>
              <Text style={styles.welcome}>Welcome to React Native 1</Text>
              <Text style={styles.welcome}>Welcome to React Native 2</Text>
              <Text style={styles.welcome}>Welcome to React Native 3</Text>
              <Text style={styles.welcome}>Welcome to React Native 4</Text>
              <Text style={styles.welcome}>Welcome to React Native 5</Text>
              <Text style={styles.welcome}>Welcome to React Native 6</Text>
           </ScrollView>
           }
          onPullAnimationSrc ={require('./coin_pull.json')}
          onStartRefreshAnimationSrc ={require('./coin_start.json')}
          onRefreshAnimationSrc = {require('./coin_repeat.json')}
          onEndRefreshAnimationSrc = {require('./coin_end.json')}
      />
    </View>
   );
 }

If you need more information or have any tips or tricks that I can try I'd be happy to hear from you.