Compare commits

..

4 commits

Author SHA1 Message Date
Arnaud Vergnet
89c65d7070 Improve android splash screen style 2020-09-21 19:01:32 +02:00
Arnaud Vergnet
97d6e1dffc Make tab touch feedback rounded 2020-09-21 18:57:12 +02:00
Arnaud Vergnet
85b0b9de29 Remove unused imports 2020-09-21 18:53:46 +02:00
Arnaud Vergnet
5c1052fbd4 Improve tab home button display 2020-09-21 18:53:25 +02:00
4 changed files with 16 additions and 30 deletions

View file

@ -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);
} }

View file

@ -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>

View file

@ -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;

View file

@ -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