Skip to content

Commit

Permalink
smooth large title animation
Browse files Browse the repository at this point in the history
it was jumping because ScrollView was wrapped by SafeArea
  • Loading branch information
kanzitelli committed Nov 18, 2020
1 parent 1cc6e55 commit 6641318
Showing 1 changed file with 37 additions and 39 deletions.
76 changes: 37 additions & 39 deletions src/screens/ExpoScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,45 +51,43 @@ const ExpoScreen: NavigationFunctionComponent<ExpoScreenProps> = observer(({
}

return contentHidden ? null : (
<SafeAreaView style={styles.container}>
<ScrollView>
<View style={styles.section}>
<Text style={styles.header}>
{ 'From Expo SDK' }
</Text>

<Text style={styles.text}>Device ID: {ExpoConstants.deviceId}</Text>
<Text style={styles.text}>Network type: {ui.networkType}</Text>
</View>

<View style={styles.section}>
<Text style={styles.header}>
{ 'Reanimated 2' }
</Text>

<Reanimated2 />
</View>

<View style={styles.section}>
<Text style={styles.header}>
{ 'Navigation' }
</Text>

<ButtonTitle
title={'Push this screen again'}
onPress={() => navigation.pushExpo(componentId)}
/>
<ButtonTitle
title={'Show it as a modal'}
onPress={() => navigation.showExpo()}
/>
<ButtonTitle
title={'Close modal'}
onPress={() => navigation.dismissModal(componentId)}
/>
</View>
</ScrollView>
</SafeAreaView>
<ScrollView>
<View style={styles.section}>
<Text style={styles.header}>
{ 'From Expo SDK' }
</Text>

<Text style={styles.text}>Device ID: {ExpoConstants.deviceId}</Text>
<Text style={styles.text}>Network type: {ui.networkType}</Text>
</View>

<View style={styles.section}>
<Text style={styles.header}>
{ 'Reanimated 2' }
</Text>

<Reanimated2 />
</View>

<View style={styles.section}>
<Text style={styles.header}>
{ 'Navigation' }
</Text>

<ButtonTitle
title={'Push this screen again'}
onPress={() => navigation.pushExpo(componentId)}
/>
<ButtonTitle
title={'Show it as a modal'}
onPress={() => navigation.showExpo()}
/>
<ButtonTitle
title={'Close modal'}
onPress={() => navigation.dismissModal(componentId)}
/>
</View>
</ScrollView>
);
});

Expand Down

0 comments on commit 6641318

Please sign in to comment.