-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(android): take whole screen, refactor measurements (#236)
* feat: take whole screen, refactor measurements * feat: use ViewPager * fix: remove custom shadow nodes measurements * feat: add changesets * fix: use optional chaining for 0.77 RC * fix: use TabViewImpl to share code across architectures * fix: remove TabViewAdapter as its no longer needed * feat: use LinearLayout, make measurements better * feat: migrate off viewpager to frame layout (WIP)
- Loading branch information
1 parent
f210909
commit d9e6590
Showing
30 changed files
with
452 additions
and
634 deletions.
There are no files selected for viewing
This file contains 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,5 @@ | ||
--- | ||
'react-native-bottom-tabs': minor | ||
--- | ||
|
||
feat: refactor android, change views on the native side, add page animations |
This file contains 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 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 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,63 @@ | ||
import { Article } from '../Screens/Article'; | ||
import { Albums } from '../Screens/Albums'; | ||
import { Contacts } from '../Screens/Contacts'; | ||
import { Chat } from '../Screens/Chat'; | ||
import { createNativeBottomTabNavigator } from '@bottom-tabs/react-navigation'; | ||
import React from 'react'; | ||
import { Alert } from 'react-native'; | ||
|
||
const Tab = createNativeBottomTabNavigator(); | ||
|
||
function NativeBottomTabsUnmounting() { | ||
const [isTabMounted, setIsTabMounted] = React.useState(true); | ||
|
||
React.useEffect(() => { | ||
const id = setTimeout(() => { | ||
setIsTabMounted(false); | ||
Alert.alert('Tab is unmounted'); | ||
}, 1000); | ||
|
||
return () => clearTimeout(id); | ||
}, []); | ||
return ( | ||
<Tab.Navigator initialRouteName="Chat" labeled={true}> | ||
<Tab.Screen | ||
name="Article" | ||
component={Article} | ||
options={{ | ||
tabBarButtonTestID: 'articleTestID', | ||
tabBarBadge: '10', | ||
tabBarIcon: ({ focused }) => | ||
focused | ||
? require('../../assets/icons/person_dark.png') | ||
: require('../../assets/icons/article_dark.png'), | ||
}} | ||
/> | ||
<Tab.Screen | ||
name="Albums" | ||
component={Albums} | ||
options={{ | ||
tabBarIcon: () => require('../../assets/icons/grid_dark.png'), | ||
}} | ||
/> | ||
<Tab.Screen | ||
name="Contacts" | ||
component={Contacts} | ||
options={{ | ||
tabBarIcon: () => require('../../assets/icons/person_dark.png'), | ||
}} | ||
/> | ||
{isTabMounted && ( | ||
<Tab.Screen | ||
name="Chat" | ||
component={Chat} | ||
options={{ | ||
tabBarIcon: () => require('../../assets/icons/chat_dark.png'), | ||
}} | ||
/> | ||
)} | ||
</Tab.Navigator> | ||
); | ||
} | ||
|
||
export default NativeBottomTabsUnmounting; |
This file contains 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 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.