-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[SET] Tab Navigator support #5793
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
Merged
Merged
Changes from 72 commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
9395a59
Update layout animations
bartlomiejbloniarz 272399c
Add example
bartlomiejbloniarz fd7aaea
batchinator
bartlomiejbloniarz de8c246
`'use strict'` 😭
bartlomiejbloniarz 2ee764d
Mock web
bartlomiejbloniarz ee5eae0
Fix `enableLayoutAnimations` call
bartlomiejbloniarz 9d480e9
Fix overlapping layout animations
bartlomiejbloniarz 73603db
Fix `MethodMetadata`
bartlomiejbloniarz 722ec07
Update docs
bartlomiejbloniarz 056deb8
Merge branch 'main' into @bartlomiejbloniarz/modify-layout-animations
bartlomiejbloniarz 9c77015
Merge branch 'main' into @bartlomiejbloniarz/modify-layout-animations
bartlomiejbloniarz cc02106
Merge branch 'main' into @bartlomiejbloniarz/modify-layout-animations
bartlomiejbloniarz efbd197
Big commit
bartlomiejbloniarz 778fa63
change Android implementation
bartlomiejbloniarz a30284a
Remove unnecessary configuration calls
bartlomiejbloniarz aaf7149
Move animation start to `willAppear`
bartlomiejbloniarz f3debe0
Fix interactivity
bartlomiejbloniarz 05bac12
merg
bartlomiejbloniarz 577feea
fix java lint
bartlomiejbloniarz 15974e1
Merge branch 'main' into @bartlomiejbloniarz/modify-sets
bartlomiejbloniarz 1771706
Add tsdoc
bartlomiejbloniarz 6adce90
Fix transforms on iOS
bartlomiejbloniarz 6de03aa
Simplify configuration
bartlomiejbloniarz a9a5461
Remove old api
bartlomiejbloniarz 7b3d4dc
Add comment
bartlomiejbloniarz 0b0fcdc
Fix [SET] Modals example
bartlomiejbloniarz 5748249
Change config cleanup
bartlomiejbloniarz c5ae961
Rename listener
bartlomiejbloniarz 2ccf49e
merg
bartlomiejbloniarz bfd5391
Split cleanup for shared transitions
bartlomiejbloniarz 3d04f0f
Merge main
piaskowyk 17add2d
Update name
piaskowyk ed5f2ca
SET everywhere
piaskowyk b2eaf60
Merge branch 'main' into @bartlomiejbloniarz/modify-sets
piaskowyk 260614f
Improvements after review
piaskowyk ba6256e
Merge branch '@bartlomiejbloniarz/modify-sets' into @piaskowyk/SET-ev…
piaskowyk 0618d41
Nested stacks
piaskowyk 0cfdc62
Tab support
piaskowyk dcdd688
Stack inside tab
piaskowyk de7a827
Go back button
piaskowyk 3b55b68
Merge branch 'main' into @piaskowyk/SET-everywhere
piaskowyk f38abbe
Basic nested navigators support
piaskowyk dc3d88b
Basic tab navigator support
piaskowyk 90d9346
Examples
piaskowyk 214e956
Merge branch 'main' into @piaskowyk/SET-everywhere
piaskowyk 56373b3
Android, tab transiton - I am shocked that it works
piaskowyk d4761bf
Update an example
piaskowyk 3c2599e
Merge branch 'main' into @piaskowyk/SET-everywhere
piaskowyk f8d9d2a
Fix snapshot flatlist rerender issue (#6007)
bartlomiejbloniarz 9bf8f1d
merge
piaskowyk 6972b08
Add bottom-tabs
piaskowyk 5e10c0a
Experimental release
piaskowyk 6cf5ec5
Move screen header
piaskowyk 3469a1d
Merge
piaskowyk 86fe27d
iOS improvements
piaskowyk 378ba34
Add viewTag cleanup
piaskowyk 5de7d20
Clean up Java part
piaskowyk 9a98602
Clean up JS part
piaskowyk 4a30312
Restore changes in UIManager
piaskowyk d03689a
Cleanup
piaskowyk 098feb9
Remove unused variables
piaskowyk 269e2bc
Merge branch 'main' into @piaskowyk/SET-everywhere
piaskowyk aa92185
Improvements after review
piaskowyk 33565e0
Merge with main
piaskowyk 9010500
Update package.json
piaskowyk cdbd576
Improvements after review
piaskowyk 7138062
Update yarn.lock
piaskowyk 3504153
Java lint
piaskowyk 696e4bb
Merge branch 'main' into @piaskowyk/SET-everywhere
piaskowyk eb7573d
Improvements after review
piaskowyk ac21d5e
run lineter
piaskowyk f4ac4b0
Add comment
piaskowyk 7f2d24d
Merge branch 'main' into @piaskowyk/SET-everywhere
piaskowyk 2b83956
Run formatter
piaskowyk ebe8c24
Added mocks
piaskowyk 4f7bc15
Run formatter
piaskowyk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
apps/common-app/src/examples/SharedElementTransitions/TabNavigatorExample.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| import React from 'react'; | ||
| import { StyleSheet, View, Button, Text } from 'react-native'; | ||
| import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; | ||
| import type {NativeStackScreenProps} from '@react-navigation/native-stack'; | ||
| import {createNativeStackNavigator} from '@react-navigation/native-stack'; | ||
| import Animated from 'react-native-reanimated'; | ||
|
|
||
| function getStyle(index: number) { | ||
| switch (index) { | ||
| case 0: | ||
| return styles.box1; | ||
| case 1: | ||
| return styles.box2; | ||
| default: | ||
| return styles.box3; | ||
| } | ||
| } | ||
|
|
||
| type ScreenProps = { | ||
| [key: string]: { | ||
| id?: number; | ||
| showButtons?: boolean; | ||
| }; | ||
| }; | ||
| function Screen({ navigation, route }: NativeStackScreenProps<ScreenProps>) { | ||
| const id = route.params?.id ?? 0; | ||
| const showButtons = !!route.params?.showButtons; | ||
| return ( | ||
| <View style={styles.container}> | ||
| <Text>Current id: {id}</Text> | ||
| {showButtons && id < 2 && ( | ||
| <Button | ||
| title={`Go next ${id + 1}`} | ||
| onPress={() => navigation.push('Details', { id: id + 1 })} | ||
| /> | ||
| )} | ||
| {showButtons && id > 0 && ( | ||
| <Button | ||
| onPress={() => navigation.push('Details', { id: id - 1 })} | ||
| title={`Go next ${id - 1}`} | ||
| /> | ||
| )} | ||
| <Animated.View style={getStyle(id)} sharedTransitionTag="test" /> | ||
| </View> | ||
| ); | ||
| }; | ||
|
|
||
| function createStack() { | ||
| const Stack = createNativeStackNavigator(); | ||
| return () => ( | ||
| <Stack.Navigator> | ||
| <Stack.Screen | ||
| name="Details" | ||
| initialParams={{ showButtons: true }} | ||
| component={Screen as React.ComponentType} | ||
| /> | ||
| </Stack.Navigator> | ||
| ); | ||
| }; | ||
|
|
||
| const Tab = createBottomTabNavigator(); | ||
| const StackA = createStack(); | ||
| const StackB = createStack(); | ||
|
|
||
| function TabNavigatorExample() { | ||
| return ( | ||
| <Tab.Navigator screenOptions={{ headerShown: false }}> | ||
| <Tab.Screen | ||
| name="A" | ||
| initialParams={{ id: 0 }} | ||
| component={Screen as React.ComponentType} | ||
| /> | ||
| <Tab.Screen | ||
| name="B" | ||
| initialParams={{ id: 1 }} | ||
| component={Screen as React.ComponentType} | ||
| /> | ||
| <Tab.Screen name="C" component={StackA} /> | ||
| <Tab.Screen name="D" component={StackB} /> | ||
| </Tab.Navigator> | ||
| ); | ||
| }; | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| container: { | ||
| flex: 1, | ||
| paddingTop: 10, | ||
| }, | ||
| box1: { | ||
| width: 100, | ||
| height: 100, | ||
| backgroundColor: 'green', | ||
| }, | ||
| box2: { | ||
| width: 200, | ||
| height: 100, | ||
| backgroundColor: 'blue', | ||
| }, | ||
| box3: { | ||
| width: 150, | ||
| height: 250, | ||
| backgroundColor: 'red', | ||
| marginLeft: 50, | ||
| }, | ||
| }); | ||
|
|
||
| export default TabNavigatorExample; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.