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
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this);
SplashScreen.show(this, R.style.SplashScreenTheme);
super.onCreate(savedInstanceState);
}

View file

@ -7,4 +7,8 @@
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorPrimary">@color/colorPrimary</item>
</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
import * as React from 'react';
import {Image, Platform, View} from 'react-native';
import {FAB, TouchableRipple, withTheme} from 'react-native-paper';
import {Image, View} from 'react-native';
import {FAB} from 'react-native-paper';
import * as Animatable from 'react-native-animatable';
import FOCUSED_ICON from '../../../assets/tab-icon.png';
import UNFOCUSED_ICON from '../../../assets/tab-icon-outline.png';
import type {CustomThemeType} from '../../managers/ThemeManager';
type PropsType = {
focused: boolean,
onPress: () => void,
onLongPress: () => void,
theme: CustomThemeType,
tabBarHeight: number,
};
@ -84,20 +82,9 @@ class TabHomeIcon extends React.Component<PropsType> {
color: string,
}): React.Node => {
const {focused} = this.props;
if (focused)
return (
<Image
source={FOCUSED_ICON}
style={{
width: size,
height: size,
tintColor: color,
}}
/>
);
return (
<Image
source={UNFOCUSED_ICON}
source={focused ? FOCUSED_ICON : UNFOCUSED_ICON}
style={{
width: size,
height: size,
@ -115,15 +102,7 @@ class TabHomeIcon extends React.Component<PropsType> {
flex: 1,
justifyContent: 'center',
}}>
<TouchableRipple
onPress={props.onPress}
onLongPress={props.onLongPress}
borderless
rippleColor={
Platform.OS === 'android'
? props.theme.colors.primary
: 'transparent'
}
<View
style={{
position: 'absolute',
bottom: 0,
@ -137,16 +116,18 @@ class TabHomeIcon extends React.Component<PropsType> {
easing="ease-out"
animation={props.focused ? 'fabFocusIn' : 'fabFocusOut'}
icon={this.getIconRender}
onPress={props.onPress}
onLongPress={props.onLongPress}
style={{
marginTop: 15,
marginLeft: 'auto',
marginRight: 'auto',
}}
/>
</TouchableRipple>
</View>
</View>
);
}
}
export default withTheme(TabHomeIcon);
export default TabHomeIcon;

View file

@ -94,11 +94,12 @@ class TabIcon extends React.Component<PropsType> {
<TouchableRipple
onPress={props.onPress}
onLongPress={props.onLongPress}
borderless
rippleColor={props.theme.colors.primary}
borderless
style={{
flex: 1,
justifyContent: 'center',
borderRadius: 10
}}>
<View>
<Animatable.View