Compare commits
No commits in common. "89c65d70705abf6c1517c303f0fbef373fc6e1b4" and "5b13eacc12b2fe03f5a0e96e87197d630b927c88" have entirely different histories.
89c65d7070
...
5b13eacc12
4 changed files with 30 additions and 16 deletions
|
|
@ -23,7 +23,7 @@ public class MainActivity extends ReactActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
SplashScreen.show(this, R.style.SplashScreenTheme);
|
SplashScreen.show(this);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,4 @@
|
||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
</style>
|
</style>
|
||||||
<style name="SplashScreenTheme" parent="SplashScreen_SplashTheme">
|
|
||||||
<item name="android:navigationBarColor">@color/activityBackground</item>
|
|
||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
|
||||||
</style>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
@ -20,16 +20,18 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import {Image, View} from 'react-native';
|
import {Image, Platform, View} from 'react-native';
|
||||||
import {FAB} from 'react-native-paper';
|
import {FAB, TouchableRipple, withTheme} from 'react-native-paper';
|
||||||
import * as Animatable from 'react-native-animatable';
|
import * as Animatable from 'react-native-animatable';
|
||||||
import FOCUSED_ICON from '../../../assets/tab-icon.png';
|
import FOCUSED_ICON from '../../../assets/tab-icon.png';
|
||||||
import UNFOCUSED_ICON from '../../../assets/tab-icon-outline.png';
|
import UNFOCUSED_ICON from '../../../assets/tab-icon-outline.png';
|
||||||
|
import type {CustomThemeType} from '../../managers/ThemeManager';
|
||||||
|
|
||||||
type PropsType = {
|
type PropsType = {
|
||||||
focused: boolean,
|
focused: boolean,
|
||||||
onPress: () => void,
|
onPress: () => void,
|
||||||
onLongPress: () => void,
|
onLongPress: () => void,
|
||||||
|
theme: CustomThemeType,
|
||||||
tabBarHeight: number,
|
tabBarHeight: number,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -82,9 +84,20 @@ class TabHomeIcon extends React.Component<PropsType> {
|
||||||
color: string,
|
color: string,
|
||||||
}): React.Node => {
|
}): React.Node => {
|
||||||
const {focused} = this.props;
|
const {focused} = this.props;
|
||||||
|
if (focused)
|
||||||
return (
|
return (
|
||||||
<Image
|
<Image
|
||||||
source={focused ? FOCUSED_ICON : UNFOCUSED_ICON}
|
source={FOCUSED_ICON}
|
||||||
|
style={{
|
||||||
|
width: size,
|
||||||
|
height: size,
|
||||||
|
tintColor: color,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
return (
|
||||||
|
<Image
|
||||||
|
source={UNFOCUSED_ICON}
|
||||||
style={{
|
style={{
|
||||||
width: size,
|
width: size,
|
||||||
height: size,
|
height: size,
|
||||||
|
|
@ -102,7 +115,15 @@ class TabHomeIcon extends React.Component<PropsType> {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
}}>
|
}}>
|
||||||
<View
|
<TouchableRipple
|
||||||
|
onPress={props.onPress}
|
||||||
|
onLongPress={props.onLongPress}
|
||||||
|
borderless
|
||||||
|
rippleColor={
|
||||||
|
Platform.OS === 'android'
|
||||||
|
? props.theme.colors.primary
|
||||||
|
: 'transparent'
|
||||||
|
}
|
||||||
style={{
|
style={{
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
|
|
@ -116,18 +137,16 @@ class TabHomeIcon extends React.Component<PropsType> {
|
||||||
easing="ease-out"
|
easing="ease-out"
|
||||||
animation={props.focused ? 'fabFocusIn' : 'fabFocusOut'}
|
animation={props.focused ? 'fabFocusIn' : 'fabFocusOut'}
|
||||||
icon={this.getIconRender}
|
icon={this.getIconRender}
|
||||||
onPress={props.onPress}
|
|
||||||
onLongPress={props.onLongPress}
|
|
||||||
style={{
|
style={{
|
||||||
marginTop: 15,
|
marginTop: 15,
|
||||||
marginLeft: 'auto',
|
marginLeft: 'auto',
|
||||||
marginRight: 'auto',
|
marginRight: 'auto',
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</View>
|
</TouchableRipple>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default TabHomeIcon;
|
export default withTheme(TabHomeIcon);
|
||||||
|
|
|
||||||
|
|
@ -94,12 +94,11 @@ class TabIcon extends React.Component<PropsType> {
|
||||||
<TouchableRipple
|
<TouchableRipple
|
||||||
onPress={props.onPress}
|
onPress={props.onPress}
|
||||||
onLongPress={props.onLongPress}
|
onLongPress={props.onLongPress}
|
||||||
rippleColor={props.theme.colors.primary}
|
|
||||||
borderless
|
borderless
|
||||||
|
rippleColor={props.theme.colors.primary}
|
||||||
style={{
|
style={{
|
||||||
flex: 1,
|
flex: 1,
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
borderRadius: 10
|
|
||||||
}}>
|
}}>
|
||||||
<View>
|
<View>
|
||||||
<Animatable.View
|
<Animatable.View
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue