From 54861d729d98864b38d639c690d44e41b5637b7b Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet <vergnet@etud.insa-toulouse.fr> Date: Thu, 16 Apr 2020 16:04:22 +0200 Subject: [PATCH] Added new home tab icon --- assets/tab-icon-outline.png | Bin 0 -> 2571 bytes assets/tab-icon.png | Bin 0 -> 2156 bytes src/navigation/MainTabNavigator.js | 24 ++++++++++++++++++------ 3 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 assets/tab-icon-outline.png create mode 100644 assets/tab-icon.png diff --git a/assets/tab-icon-outline.png b/assets/tab-icon-outline.png new file mode 100644 index 0000000000000000000000000000000000000000..3f5db226735196dedaa0c66cf53575d2d94b6db1 GIT binary patch literal 2571 zcmZvec{tQ-6vuyKUx&glhBEfdMY2t{>>1Y;k~NvJWFKNggdq*G&R8N#VbZP02wk#G zDSK!xH#3q^W0|sKxw6Hb{=esW&wI}KocBD>_n-H9PL`A7c~K!*ApihGQFhiYoQVJB z0(_ji*9<ev2|O{DC|3cF-4qDO<kW&ucAhZ+0Dkk!LB$9#j02%K8xP#Y$g8+GOmrX+ z7Z;}$f(?uD$3z8cMMejeubRkm1~XCC7OwFXE0s4!uGmOrr2Jj%hiG{i9vJe_PhisH z*poC{0mU|RMRkZpkxUla86+wr#Z#+HvOCq_Qmk0ylU16TrS5u6s=-wgew-K45L;cM z(SZAT;;7A+RofXi+By7jUuzN7oziW*I8qifHewv-Hh4|0|9=k~VL8J$0ixuSo8alK z5lcuf8j;i&H$qvYYlPI2=i%v-&@C}l>SeUb*d|YueWB4dkZi5L3}_9{=cjTZ<)&Oe zvn0yLH&^alIkX!cVV9=@ZEByH{lMm;cqv%q(#DYQKyUlO8I8N2v0U+G<Tz`RoGM#W z@Cn%2^k<zr%f&<-q`<CyK5TT(V(g+k<)Ks`%jM$_Ul8?o<p!c2-Ofmv%~7EynuJi6 ze-Gbuq03p8mRhYVv;aYa$-6Fd*_#rynW++epFR%ixw|#=h6PiR7q^^}dvEATGeULP zY?)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mu6Rc+;*3fe;gmdmEgA2weE1L%)B#AVwQ!y1Wb=T#Dza|tP41P{ z7T6%RaeCCg8X437lKw6A<;t=o^>}UlLT*43?^__lhHWv@#TSL#R-2QGo%V!MdkMPs zk=tJ{;pc73-oXa<xX@V3l^!zI*jO|w)Uq9>CAWgW2NEP|g4VV*$TM~?YOu!5za%7e zICHh>RZAhCZ~*A0)+^Ba%^!(S+Nxn&JBOHao}7C+J^B&&UG!wBA?aUbYNABw5j%Fe z42E`0J89<qSEW3E{DAtF(Y;RkQ+FuRS0sGmuDSFJLOZ|Df*QFDbh((GhsD$@yN1ha z`*&-6)Vmi^u1~p3)+g<y6g}OPgIfL>5U#LzHCt@ZH~DFW`z716-uPnDmCD~!?r+wU zPr=jW+jWQNTyjOuaXq>yTGge1B3<C{SJjN!(KbHI{Qw4z{(1=_dS9)yG8`ms>7mMw zetUryePzT2Rjhe@Fqr{)t5qtY{Ksgedww&DcEL*E=~sg{|GV{YARBYYe~Lv}E^u;W QauzoLW#ef5%o3gUA8%5yWdHyG literal 0 HcmV?d00001 diff --git a/assets/tab-icon.png b/assets/tab-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..8e127c8ebb7677572b0aaa234186a5251925430f GIT binary patch literal 2156 zcmZuzc|6mP8~@Cf%^6c+az-rV&e_Z?Hhq!nYjPLM5W^g?YLnb-jvT3ctGS}G$Ou_- zlpK*Gl%stkUuVC5jU4q`zrVlF>p5P}^UwP^UeEJ-GR`>JONb&w0RWJ|<FKv*OZzP_ zVS#>$3Vb6lkQfZ!9VQ?uEGS*zi;!_%F#sUh^;<wUv?Ub;L3zq40>v$oNQn=O4hG`m z<ByXf!eY(`l7o*&MqemfvqAs>bP12OaZk9ldfTht*W+OCRk3Nc5zz|qVGOj6*&||1 zfa2=!nVm-S0J9WPjP@3bflyA5M9C>X^)L>-CwEU|*tn=9AQ`S;fN(rE+H~kX46E{X zgunh0<@l!e<jeNi$(QEwd-<r<Zx7oO$Df6*$MWmBQHOi~mE{i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zxjn@jBWu*Si%~pIo(9H_0XX<ihE+HIsh(w%2_q{;>>k$vql%xsJ0LxGW$q$-M_z;h zzlUyg{7WnY0XlFjspV_yJ3^k0Fgp!!-mBDHvdlUGsm|{6v#nsOd6jo%1Kwobki(N} zh6YE_<+0xua;j(z{VTYY+;es`6X{^a?Sqt7^Pu4_3hm@?uebK<aK;iao2`|!LJb?y zC@@H00Eqm{bG0egq@3cL!2YMlyfXFZ%P`KBN7)}IxR(%HIi-6@j#@6y>|c41_QTrs XcFIs!+P6KyX8_<&Ibk1R0+Rm+2iM*k literal 0 HcmV?d00001 diff --git a/src/navigation/MainTabNavigator.js b/src/navigation/MainTabNavigator.js index 7f1f53e..26a826e 100644 --- a/src/navigation/MainTabNavigator.js +++ b/src/navigation/MainTabNavigator.js @@ -13,7 +13,7 @@ import ProximoAboutScreen from "../screens/Proximo/ProximoAboutScreen"; import PlanexScreen from '../screens/Websites/PlanexScreen'; import {MaterialCommunityIcons} from "@expo/vector-icons"; import AsyncStorageManager from "../managers/AsyncStorageManager"; -import {useTheme, withTheme} from 'react-native-paper'; +import {FAB, useTheme, withTheme} from 'react-native-paper'; import i18n from "i18n-js"; import ClubDisplayScreen from "../screens/Amicale/Clubs/ClubDisplayScreen"; import ScannerScreen from "../screens/ScannerScreen"; @@ -22,7 +22,6 @@ import FeedItemScreen from "../screens/FeedItemScreen"; import {createCollapsibleStack} from "react-navigation-collapsible"; import GroupSelectionScreen from "../screens/GroupSelectionScreen"; - const TAB_ICONS = { home: 'triangle', planning: 'calendar-range', @@ -330,18 +329,31 @@ class TabNavigator extends React.Component<Props> { this.createHomeStackComponent = () => HomeStackComponent(props.defaultRoute, props.defaultData); } + getHomeButton(focused: boolean) { + let icon = focused ? require('../../assets/tab-icon.png') : require('../../assets/tab-icon-outline.png') + return ( + <FAB + icon={icon} + small + style={{position: 'absolute', top: '-25%'}}/> + ); + } + render() { return ( <Tab.Navigator initialRouteName={this.defaultRoute} - barStyle={{backgroundColor: this.props.theme.colors.surface}} + barStyle={{backgroundColor: this.props.theme.colors.surface, overflow: 'visible'}} screenOptions={({route}) => ({ - tabBarIcon: ({focused, color, size}) => { + tabBarIcon: ({focused, color}) => { let icon = TAB_ICONS[route.name]; - // tintColor is ignoring activeColor and inactiveColor for some reason icon = focused ? icon : icon + ('-outline'); - return <MaterialCommunityIcons name={icon} color={color} size={26}/>; + if (route.name !== "home") + return <MaterialCommunityIcons name={icon} color={color} size={26}/>; + else + return this.getHomeButton(focused); }, + tabBarLabel: route.name !== 'home' ? undefined : '' })} activeColor={this.props.theme.colors.primary} inactiveColor={this.props.theme.colors.tabIcon}