question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transition of an element inside a scrollView creat FOC

See original GitHub issue

I’m having FOC of the animated elements when inside a scrollable view (note that the banana flashes too for a moment, no idea why). If you have a boilerplate I can happily reproduce it there as my code might be overly complicated, but conceptually:

// Manifest of possible screens
const PrimaryNav = FluidNavigator({
  LaunchScreen: { screen: LaunchScreen },
  Level: { screen: Level }
}, {
  transitionConfig: {
    duration: 3500,
    timing: Animated.timing,
    easing: Easing.easing
  },
  navigationOptions: { gesturesEnabled: true },
})

Tile on the main screen

        <ScrollView
          ref={ref=>{this.scrollview = ref}}
          style={{ flex: 1 }} 
          contentContainerStyle={{ width: STEP * BOARD, height: STEP * BOARD }}
          maximumZoomScale={1}
          minimumZoomScale={1}
          directionalLockEnabled={false}
          onScrollBeginDrag={() => {
            this.background.animate()
          }}
        >
          //...map
             <Tile
                key={id}
                transitionShared={`tile-${id}`}
                inline
                color={bg}
                isSolved={isSolved}
                x={x}
                y={y}
                step={STEP}
                onPress={() => {
                  this.props.navigation.navigate('Level', {id})
                }}
              />
</ScrollView>

Expanded tile

<Transition shared={`tile-${id}`} >
          <View
            style={{
              width: Dimensions.get('window').width,
              height: Dimensions.get('window').height,
              backgroundColor: bg,
              position: 'absolute',
              top: -10,
              left: 0,
              zIndex: -1
            }}
          />
        </Transition>

The banana in an issue with Image, it’s fixed by moving to FastImage

Gif of the happy path(user didn’t scroll) and unhappy path(user did scroll)

2019-01-21 14 24 42 2019-01-21 14 25 14

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
obsidianartcommented, May 19, 2019

@obiwankenoobi I don’t think there’s something similar, I just made nice entering animations for now and maybe one day I’ll go back to this. On IOs everything worked really nicely but on Android it was impossible

0reactions
obiwankenoobicommented, May 19, 2019

@obsidianart sorry to hear! 😦 Have you moved to something similar which you can recommend?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ScrollView - Android Developers
To add multiple views within the scroll view, make the direct child you add a ... android:animateLayoutChanges, Defines whether changes in layout (caused...
Read more >
SingleChildScrollView class - widgets - Flutter - Dart API docs
A box in which a single widget can be scrolled. This widget is useful when you have a single box that will normally...
Read more >
Building scrolling experiences in Flutter | Workshop - YouTube
Learn how to build rich scrolling experiences in Flutter. We explore slivers and how they're different from other widgets in the framework.
Read more >
UIScrollView within a UIScrollView, how to keep a smooth ...
Place a scrollview that fills the bounds of the root view (i.e. also fills the screen) above all the other scrollview and image...
Read more >
ScrollView - React Native
Component that wraps platform ScrollView while providing integration with touch locking "responder" system.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found