Compare commits
4 commits
5b13eacc12
...
89c65d7070
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89c65d7070 | ||
|
|
97d6e1dffc | ||
|
|
85b0b9de29 | ||
|
|
5c1052fbd4 |
4 changed files with 16 additions and 30 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);
|
SplashScreen.show(this, R.style.SplashScreenTheme);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,8 @@
|
||||||
<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>
|
||||||
</resources>
|
<style name="SplashScreenTheme" parent="SplashScreen_SplashTheme">
|
||||||
|
<item name="android:navigationBarColor">@color/activityBackground</item>
|
||||||
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
||||||
|
|
|
||||||
|
|
@ -20,18 +20,16 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import {Image, Platform, View} from 'react-native';
|
import {Image, View} from 'react-native';
|
||||||
import {FAB, TouchableRipple, withTheme} from 'react-native-paper';
|
import {FAB} 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,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -84,20 +82,9 @@ 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 (
|
|
||||||
<Image
|
|
||||||
source={FOCUSED_ICON}
|
|
||||||
style={{
|
|
||||||
width: size,
|
|
||||||
height: size,
|
|
||||||
tintColor: color,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
return (
|
return (
|
||||||
<Image
|
<Image
|
||||||
source={UNFOCUSED_ICON}
|
source={focused ? FOCUSED_ICON : UNFOCUSED_ICON}
|
||||||
style={{
|
style={{
|
||||||
width: size,
|
width: size,
|
||||||
height: size,
|
height: size,
|
||||||
|
|
@ -115,15 +102,7 @@ class TabHomeIcon extends React.Component<PropsType> {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
}}>
|
}}>
|
||||||
<TouchableRipple
|
<View
|
||||||
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,
|
||||||
|
|
@ -137,16 +116,18 @@ 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',
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</TouchableRipple>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default withTheme(TabHomeIcon);
|
export default TabHomeIcon;
|
||||||
|
|
|
||||||
|
|
@ -94,11 +94,12 @@ class TabIcon extends React.Component<PropsType> {
|
||||||
<TouchableRipple
|
<TouchableRipple
|
||||||
onPress={props.onPress}
|
onPress={props.onPress}
|
||||||
onLongPress={props.onLongPress}
|
onLongPress={props.onLongPress}
|
||||||
borderless
|
|
||||||
rippleColor={props.theme.colors.primary}
|
rippleColor={props.theme.colors.primary}
|
||||||
|
borderless
|
||||||
style={{
|
style={{
|
||||||
flex: 1,
|
flex: 1,
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
|
borderRadius: 10
|
||||||
}}>
|
}}>
|
||||||
<View>
|
<View>
|
||||||
<Animatable.View
|
<Animatable.View
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue