Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for FlatList #157

Closed
2 of 3 tasks
pi0trpietruszewski opened this issue Sep 29, 2020 · 5 comments
Closed
2 of 3 tasks

Support for FlatList #157

pi0trpietruszewski opened this issue Sep 29, 2020 · 5 comments
Labels
bug Something isn't working enhancement New feature or request hacktoberfest

Comments

@pi0trpietruszewski
Copy link
Contributor

pi0trpietruszewski commented Sep 29, 2020

Support for FlatList

  • I'm submitting a ...

    • bug report
    • feature request
    • support request
  • If bug, used module version

    0.4.0

  • What is the current behavior?
    -On IOS, FlatList sometimes stuck, and user is unable to scroll down.
    -On Android FlatList is scrollable without Header moving.

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

  • Open example
  • Select Quiz
  • Solution Idea
    For non tabbed components we can try to detect FlatList and replace ScrollableTabView to React.cloneElement() cloned FlatList. But no idea what we can do with TabbedHeader.

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

IOS Android
ezgif-4-1726a70d0b12 ezgif-4-55827a9427c2
@pi0trpietruszewski pi0trpietruszewski added bug Something isn't working hacktoberfest enhancement New feature or request labels Sep 29, 2020
@pi0trpietruszewski pi0trpietruszewski pinned this issue Sep 29, 2020
@phwed
Copy link

phwed commented Nov 19, 2020

I am facing the same issue currently is there a way to resolve this?

@phwed
Copy link

phwed commented Nov 19, 2020

I am facing the same issue currently is there a way to resolve this?

never mind i solved it by adding scrollEnabled={false} to the flatlist and moving my scroll logic to the Header as suggested

@SvenNussgruber
Copy link

@phwed Do you mind sharing how exactly you implemented the scroll logic in the Header? I'm trying to have a top text that disappears, a search bar underneath that stays stickied, and a sectionList underneath that but can't get it working properly.

@phwed
Copy link

phwed commented Dec 5, 2020

@SvenNussgruber
You can override the components with animated views as shown here

const CutomHeaderScreen = () => {

  const renderHeader = () => {
    const opacity = scrollY.y.interpolate({
      inputRange: [0, 60, 90],
      outputRange: [0, 0, 1],
      extrapolate: 'clamp',
    })

    return (
      <View
        style={styles.headerCotainer}>
        <View style={styles.headerWrapper}>
          <TouchableOpacity onPress={() => {}>
            <Image
              style={styles.headerImage}
              resizeMode="contain"
              source={{
                uri: 'https://close.png',
              }}
            />
          </TouchableOpacity>
          <Animated.View style={{ opacity }}>
            <Text
              style={styles.headerText}>
              Baby Yoda
            </Text>
          </Animated.View>
        </View>
      </View>
    )
  }

  return (
    <StickyParallaxHeader
      headerType="TabbedHeader"
      header={renderHeader}
      scrollEvent={event(
        [{ nativeEvent: { contentOffset: { y: scrollY.y } } }],
        { useNativeDriver: false }
      )}
    />
  )
}

so u can basically add your own animated opacity style to handle the top text that appears with respect to the animated scroll value.

link to docs::
https://github.com/netguru/sticky-parallax-header/blob/master/docs/TABBEDHEADER.MD

@mateusz1913
Copy link
Contributor

FlatList, SectionList & custom scroll components are supported in version 1.0.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request hacktoberfest
Projects
None yet
Development

No branches or pull requests

4 participants