Compare commits
No commits in common. "01e3195be7c16a8aedb648ab56d0bffc23f765f1" and "a3a1b2e29c36a7fbabaa2cb3bd61ecae892f3d4f" have entirely different histories.
01e3195be7
...
a3a1b2e29c
11 changed files with 185 additions and 93 deletions
54
App.js
54
App.js
|
|
@ -1,14 +1,15 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import {Platform, StatusBar, YellowBox} from 'react-native';
|
import {Platform, StatusBar, View, YellowBox} from 'react-native';
|
||||||
import LocaleManager from './src/managers/LocaleManager';
|
import LocaleManager from './src/managers/LocaleManager';
|
||||||
import AsyncStorageManager from "./src/managers/AsyncStorageManager";
|
import AsyncStorageManager from "./src/managers/AsyncStorageManager";
|
||||||
import CustomIntroSlider from "./src/components/Overrides/CustomIntroSlider";
|
import CustomIntroSlider from "./src/components/Overrides/CustomIntroSlider";
|
||||||
import {AppLoading} from 'expo';
|
import {SplashScreen} from 'expo';
|
||||||
import type {CustomTheme} from "./src/managers/ThemeManager";
|
import type {CustomTheme} from "./src/managers/ThemeManager";
|
||||||
import ThemeManager from './src/managers/ThemeManager';
|
import ThemeManager from './src/managers/ThemeManager';
|
||||||
import {NavigationContainer} from '@react-navigation/native';
|
import {NavigationContainer} from '@react-navigation/native';
|
||||||
|
import {createStackNavigator} from '@react-navigation/stack';
|
||||||
import DrawerNavigator from './src/navigation/DrawerNavigator';
|
import DrawerNavigator from './src/navigation/DrawerNavigator';
|
||||||
import {initExpoToken} from "./src/utils/Notifications";
|
import {initExpoToken} from "./src/utils/Notifications";
|
||||||
import {Provider as PaperProvider} from 'react-native-paper';
|
import {Provider as PaperProvider} from 'react-native-paper';
|
||||||
|
|
@ -17,11 +18,7 @@ import Update from "./src/constants/Update";
|
||||||
import ConnectionManager from "./src/managers/ConnectionManager";
|
import ConnectionManager from "./src/managers/ConnectionManager";
|
||||||
import URLHandler from "./src/utils/URLHandler";
|
import URLHandler from "./src/utils/URLHandler";
|
||||||
import {setSafeBounceHeight} from "react-navigation-collapsible";
|
import {setSafeBounceHeight} from "react-navigation-collapsible";
|
||||||
import {enableScreens} from 'react-native-screens';
|
import * as Animatable from 'react-native-animatable';
|
||||||
|
|
||||||
// Native optimizations https://reactnavigation.org/docs/react-native-screens
|
|
||||||
enableScreens();
|
|
||||||
|
|
||||||
|
|
||||||
YellowBox.ignoreWarnings([ // collapsible headers cause this warning, just ignore as it is not an issue
|
YellowBox.ignoreWarnings([ // collapsible headers cause this warning, just ignore as it is not an issue
|
||||||
'Non-serializable values were found in the navigation state',
|
'Non-serializable values were found in the navigation state',
|
||||||
|
|
@ -37,6 +34,8 @@ type State = {
|
||||||
currentTheme: CustomTheme | null,
|
currentTheme: CustomTheme | null,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const Stack = createStackNavigator();
|
||||||
|
|
||||||
export default class App extends React.Component<Props, State> {
|
export default class App extends React.Component<Props, State> {
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
|
|
@ -60,7 +59,7 @@ export default class App extends React.Component<Props, State> {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
LocaleManager.initTranslations();
|
LocaleManager.initTranslations();
|
||||||
// SplashScreen.preventAutoHide();
|
SplashScreen.preventAutoHide();
|
||||||
this.navigatorRef = React.createRef();
|
this.navigatorRef = React.createRef();
|
||||||
this.defaultHomeRoute = null;
|
this.defaultHomeRoute = null;
|
||||||
this.defaultHomeData = {};
|
this.defaultHomeData = {};
|
||||||
|
|
@ -68,9 +67,6 @@ export default class App extends React.Component<Props, State> {
|
||||||
this.urlHandler = new URLHandler(this.onInitialURLParsed, this.onDetectURL);
|
this.urlHandler = new URLHandler(this.onInitialURLParsed, this.onDetectURL);
|
||||||
this.urlHandler.listen();
|
this.urlHandler.listen();
|
||||||
setSafeBounceHeight(Platform.OS === 'ios' ? 100 : 20);
|
setSafeBounceHeight(Platform.OS === 'ios' ? 100 : 20);
|
||||||
this.loadAssetsAsync().then(() => {
|
|
||||||
this.onLoadFinished();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -138,12 +134,18 @@ export default class App extends React.Component<Props, State> {
|
||||||
this.storageManager.savePref(this.storageManager.preferences.showAprilFoolsStart.key, '0');
|
this.storageManager.savePref(this.storageManager.preferences.showAprilFoolsStart.key, '0');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
this.loadAssetsAsync().then(() => {
|
||||||
|
this.onLoadFinished();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads every async data
|
* Loads every async data
|
||||||
*
|
*
|
||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
loadAssetsAsync = async () => {
|
async loadAssetsAsync() {
|
||||||
await this.storageManager.loadPreferences();
|
await this.storageManager.loadPreferences();
|
||||||
await initExpoToken();
|
await initExpoToken();
|
||||||
try {
|
try {
|
||||||
|
|
@ -159,8 +161,7 @@ export default class App extends React.Component<Props, State> {
|
||||||
// Only show intro if this is the first time starting the app
|
// Only show intro if this is the first time starting the app
|
||||||
this.createDrawerNavigator = () => <DrawerNavigator
|
this.createDrawerNavigator = () => <DrawerNavigator
|
||||||
defaultHomeRoute={this.defaultHomeRoute}
|
defaultHomeRoute={this.defaultHomeRoute}
|
||||||
defaultHomeData={this.defaultHomeData}
|
defaultHomeData={this.defaultHomeData}/>;
|
||||||
/>;
|
|
||||||
ThemeManager.getInstance().setUpdateThemeCallback(this.onUpdateTheme);
|
ThemeManager.getInstance().setUpdateThemeCallback(this.onUpdateTheme);
|
||||||
// Status bar goes dark if set too fast on ios
|
// Status bar goes dark if set too fast on ios
|
||||||
if (Platform.OS === 'ios')
|
if (Platform.OS === 'ios')
|
||||||
|
|
@ -181,7 +182,7 @@ export default class App extends React.Component<Props, State> {
|
||||||
*/
|
*/
|
||||||
render() {
|
render() {
|
||||||
if (this.state.isLoading) {
|
if (this.state.isLoading) {
|
||||||
return <AppLoading/>;
|
return null;
|
||||||
} else if (this.state.showIntro || this.state.showUpdate || this.state.showAprilFools) {
|
} else if (this.state.showIntro || this.state.showUpdate || this.state.showAprilFools) {
|
||||||
return <CustomIntroSlider
|
return <CustomIntroSlider
|
||||||
onDone={this.onIntroDone}
|
onDone={this.onIntroDone}
|
||||||
|
|
@ -191,12 +192,27 @@ export default class App extends React.Component<Props, State> {
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<PaperProvider theme={this.state.currentTheme}>
|
<PaperProvider theme={this.state.currentTheme}>
|
||||||
|
<View style={{
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: ThemeManager.getCurrentTheme().colors.background
|
||||||
|
}}>
|
||||||
|
<Animatable.View
|
||||||
|
style={{flex: 1,}}
|
||||||
|
animation={"fadeIn"}
|
||||||
|
duration={1000}
|
||||||
|
useNativeDriver
|
||||||
|
onAnimationBegin={() => {
|
||||||
|
// delay the hiding even 1ms is enough to prevent flickering
|
||||||
|
setTimeout(() => SplashScreen.hide(), 1);
|
||||||
|
}}
|
||||||
|
>
|
||||||
<NavigationContainer theme={this.state.currentTheme} ref={this.navigatorRef}>
|
<NavigationContainer theme={this.state.currentTheme} ref={this.navigatorRef}>
|
||||||
<DrawerNavigator
|
<Stack.Navigator headerMode="none">
|
||||||
defaultHomeRoute={this.defaultHomeRoute}
|
<Stack.Screen name="Root" component={this.createDrawerNavigator}/>
|
||||||
defaultHomeData={this.defaultHomeData}
|
</Stack.Navigator>
|
||||||
/>
|
|
||||||
</NavigationContainer>
|
</NavigationContainer>
|
||||||
|
</Animatable.View>
|
||||||
|
</View>
|
||||||
</PaperProvider>
|
</PaperProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,9 @@ class AnimatedBottomBar extends React.Component<Props, State> {
|
||||||
onHideChange = (shouldHide: boolean) => {
|
onHideChange = (shouldHide: boolean) => {
|
||||||
if (this.ref.current != null) {
|
if (this.ref.current != null) {
|
||||||
if (shouldHide)
|
if (shouldHide)
|
||||||
this.ref.current.fadeOutDown(500);
|
this.ref.current.bounceOutDown(1000);
|
||||||
else
|
else
|
||||||
this.ref.current.fadeInUp(500);
|
this.ref.current.bounceInUp(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -105,6 +105,7 @@ class AnimatedBottomBar extends React.Component<Props, State> {
|
||||||
iterationDelay={500}
|
iterationDelay={500}
|
||||||
iterationCount="infinite"
|
iterationCount="infinite"
|
||||||
useNativeDriver
|
useNativeDriver
|
||||||
|
// useNativeDriver={true}
|
||||||
style={styles.fab}
|
style={styles.fab}
|
||||||
icon="account-clock"
|
icon="account-clock"
|
||||||
onPress={() => this.props.navigation.navigate('group-select')}
|
onPress={() => this.props.navigation.navigate('group-select')}
|
||||||
|
|
|
||||||
55
src/components/Animations/AnimatedFocusView.js
Normal file
55
src/components/Animations/AnimatedFocusView.js
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
// @flow
|
||||||
|
|
||||||
|
import * as React from 'react';
|
||||||
|
import * as Animatable from "react-native-animatable";
|
||||||
|
import {CommonActions} from "@react-navigation/native";
|
||||||
|
import {StackNavigationProp} from "@react-navigation/stack";
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
navigation: StackNavigationProp,
|
||||||
|
route: { params?: any, ... },
|
||||||
|
children: React.Node
|
||||||
|
}
|
||||||
|
|
||||||
|
export default class AnimatedFocusView extends React.Component<Props> {
|
||||||
|
|
||||||
|
ref: { current: null | Animatable.View };
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.ref = React.createRef();
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
this.props.navigation.addListener('focus', this.onScreenFocus);
|
||||||
|
}
|
||||||
|
|
||||||
|
onScreenFocus = () => {
|
||||||
|
if (this.props.route.params != null) {
|
||||||
|
if (this.props.route.params.animationDir && this.ref.current) {
|
||||||
|
if (this.props.route.params.animationDir === "right")
|
||||||
|
this.ref.current.fadeInRight(300);
|
||||||
|
else
|
||||||
|
this.ref.current.fadeInLeft(300);
|
||||||
|
// reset params to prevent infinite loop
|
||||||
|
this.props.navigation.dispatch(CommonActions.setParams({animationDir: null}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<Animatable.View
|
||||||
|
ref={this.ref}
|
||||||
|
style={{
|
||||||
|
width: "100%",
|
||||||
|
height: "100%",
|
||||||
|
}}
|
||||||
|
useNativeDriver
|
||||||
|
>
|
||||||
|
{this.props.children}
|
||||||
|
</Animatable.View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -7,19 +7,18 @@ import {TouchableRipple} from "react-native-paper";
|
||||||
import ConnectionManager from "../../managers/ConnectionManager";
|
import ConnectionManager from "../../managers/ConnectionManager";
|
||||||
import LogoutDialog from "../Amicale/LogoutDialog";
|
import LogoutDialog from "../Amicale/LogoutDialog";
|
||||||
import SideBarSection from "./SideBarSection";
|
import SideBarSection from "./SideBarSection";
|
||||||
import {DrawerNavigationProp} from "@react-navigation/drawer";
|
|
||||||
|
|
||||||
const deviceWidth = Dimensions.get("window").width;
|
const deviceWidth = Dimensions.get("window").width;
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
navigation: DrawerNavigationProp,
|
navigation: Object,
|
||||||
state: {[key: string] : any},
|
|
||||||
theme?: Object,
|
theme?: Object,
|
||||||
};
|
};
|
||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
isLoggedIn: boolean,
|
isLoggedIn: boolean,
|
||||||
dialogVisible: boolean,
|
dialogVisible: boolean,
|
||||||
|
activeRoute: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -28,7 +27,7 @@ type State = {
|
||||||
class SideBar extends React.Component<Props, State> {
|
class SideBar extends React.Component<Props, State> {
|
||||||
|
|
||||||
dataSet: Array<Object>;
|
dataSet: Array<Object>;
|
||||||
activeRoute: string;
|
|
||||||
/**
|
/**
|
||||||
* Generate the dataset
|
* Generate the dataset
|
||||||
*
|
*
|
||||||
|
|
@ -36,7 +35,6 @@ class SideBar extends React.Component<Props, State> {
|
||||||
*/
|
*/
|
||||||
constructor(props: Props) {
|
constructor(props: Props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.activeRoute = 'main';
|
|
||||||
// Dataset used to render the drawer
|
// Dataset used to render the drawer
|
||||||
const mainData = [
|
const mainData = [
|
||||||
{
|
{
|
||||||
|
|
@ -181,24 +179,28 @@ class SideBar extends React.Component<Props, State> {
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
ConnectionManager.getInstance().addLoginStateListener(this.onLoginStateChange);
|
ConnectionManager.getInstance().addLoginStateListener(this.onLoginStateChange);
|
||||||
|
this.props.navigation.addListener('state', this.onRouteChange);
|
||||||
this.state = {
|
this.state = {
|
||||||
isLoggedIn: ConnectionManager.getInstance().isLoggedIn(),
|
isLoggedIn: ConnectionManager.getInstance().isLoggedIn(),
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
|
activeRoute: 'Main',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldComponentUpdate(nextProps: Props, nextState: State): boolean {
|
onRouteChange = (event: Object) => {
|
||||||
const nextNavigationState = nextProps.state;
|
try {
|
||||||
const nextRoute = nextNavigationState.routes[nextNavigationState.index].name;
|
const state = event.data.state.routes[0].state; // Get the Drawer's state if it exists
|
||||||
|
// Get the current route name. This will only show Drawer routes.
|
||||||
const currentNavigationState = this.props.state;
|
// Tabbar routes will be shown as 'Main'
|
||||||
const currentRoute = currentNavigationState.routes[currentNavigationState.index].name;
|
const routeName = state.routeNames[state.index];
|
||||||
|
if (this.state.activeRoute !== routeName)
|
||||||
this.activeRoute = nextRoute;
|
this.setState({activeRoute: routeName});
|
||||||
return (nextState !== this.state)
|
} catch (e) {
|
||||||
|| (nextRoute !== currentRoute);
|
this.setState({activeRoute: 'Main'});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
showDisconnectDialog = () => this.setState({dialogVisible: true});
|
showDisconnectDialog = () => this.setState({dialogVisible: true});
|
||||||
|
|
||||||
hideDisconnectDialog = () => this.setState({dialogVisible: false});
|
hideDisconnectDialog = () => this.setState({dialogVisible: false});
|
||||||
|
|
@ -215,7 +217,7 @@ class SideBar extends React.Component<Props, State> {
|
||||||
return <SideBarSection
|
return <SideBarSection
|
||||||
{...this.props}
|
{...this.props}
|
||||||
listKey={item.key}
|
listKey={item.key}
|
||||||
activeRoute={this.activeRoute}
|
activeRoute={this.state.activeRoute}
|
||||||
isLoggedIn={this.state.isLoggedIn}
|
isLoggedIn={this.state.isLoggedIn}
|
||||||
sectionName={item.name}
|
sectionName={item.name}
|
||||||
startOpen={item.startOpen}
|
startOpen={item.startOpen}
|
||||||
|
|
@ -237,7 +239,7 @@ class SideBar extends React.Component<Props, State> {
|
||||||
{/*$FlowFixMe*/}
|
{/*$FlowFixMe*/}
|
||||||
<FlatList
|
<FlatList
|
||||||
data={this.dataSet}
|
data={this.dataSet}
|
||||||
extraData={this.state.isLoggedIn.toString() + this.activeRoute}
|
extraData={this.state.isLoggedIn.toString() + this.state.activeRoute}
|
||||||
renderItem={this.getRenderItem}
|
renderItem={this.getRenderItem}
|
||||||
/>
|
/>
|
||||||
<LogoutDialog
|
<LogoutDialog
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,10 @@ class CustomTabBar extends React.Component<Props, State> {
|
||||||
});
|
});
|
||||||
if (currentIndex !== destIndex && !event.defaultPrevented) {
|
if (currentIndex !== destIndex && !event.defaultPrevented) {
|
||||||
this.state.translateY = new Animated.Value(0);
|
this.state.translateY = new Animated.Value(0);
|
||||||
this.props.navigation.navigate(route.name);
|
this.props.navigation.navigate(route.name, {
|
||||||
|
screen: 'index',
|
||||||
|
params: {animationDir: currentIndex < destIndex ? "right" : "left"}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -541,10 +541,7 @@ export default class DrawerNavigator extends React.Component<Props> {
|
||||||
this.createTabNavigator = () => <TabNavigator {...props}/>
|
this.createTabNavigator = () => <TabNavigator {...props}/>
|
||||||
}
|
}
|
||||||
|
|
||||||
getDrawerContent = (props: {
|
getDrawerContent = (props: { navigation: DrawerNavigationProp }) => <Sidebar {...props}/>
|
||||||
navigation: DrawerNavigationProp,
|
|
||||||
state: {[key: string] : any}
|
|
||||||
}) => <Sidebar {...props}/>
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,9 @@ import ConnectionManager from "../../managers/ConnectionManager";
|
||||||
import {CommonActions} from '@react-navigation/native';
|
import {CommonActions} from '@react-navigation/native';
|
||||||
import MaterialHeaderButtons, {Item} from "../../components/Overrides/CustomHeaderButton";
|
import MaterialHeaderButtons, {Item} from "../../components/Overrides/CustomHeaderButton";
|
||||||
import AnimatedFAB from "../../components/Animations/AnimatedFAB";
|
import AnimatedFAB from "../../components/Animations/AnimatedFAB";
|
||||||
|
import AnimatedFocusView from "../../components/Animations/AnimatedFocusView";
|
||||||
import {StackNavigationProp} from "@react-navigation/stack";
|
import {StackNavigationProp} from "@react-navigation/stack";
|
||||||
import type {CustomTheme} from "../../managers/ThemeManager";
|
import type {CustomTheme} from "../../managers/ThemeManager";
|
||||||
import {View} from "react-native-animatable";
|
|
||||||
// import DATA from "../dashboard_data.json";
|
// import DATA from "../dashboard_data.json";
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -166,11 +166,17 @@ class HomeScreen extends React.Component<Props> {
|
||||||
};
|
};
|
||||||
|
|
||||||
onProxiwashClick = () => {
|
onProxiwashClick = () => {
|
||||||
this.props.navigation.navigate("proxiwash");
|
this.props.navigation.navigate("proxiwash", {
|
||||||
|
screen: 'index',
|
||||||
|
params: {animationDir: "right"} // Play tab animation
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onProximoClick = () => {
|
onProximoClick = () => {
|
||||||
this.props.navigation.navigate("proximo");
|
this.props.navigation.navigate("proximo", {
|
||||||
|
screen: 'index',
|
||||||
|
params: {animationDir: "left"} // Play tab animation
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onTutorInsaClick = () => this.props.navigation.navigate('tutorinsa');
|
onTutorInsaClick = () => this.props.navigation.navigate('tutorinsa');
|
||||||
|
|
@ -507,8 +513,8 @@ class HomeScreen extends React.Component<Props> {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<View
|
<AnimatedFocusView
|
||||||
style={{flex: 1}}
|
{...this.props}
|
||||||
>
|
>
|
||||||
<WebSectionList
|
<WebSectionList
|
||||||
{...this.props}
|
{...this.props}
|
||||||
|
|
@ -526,7 +532,7 @@ class HomeScreen extends React.Component<Props> {
|
||||||
icon="qrcode-scan"
|
icon="qrcode-scan"
|
||||||
onPress={this.openScanner}
|
onPress={this.openScanner}
|
||||||
/>
|
/>
|
||||||
</View>
|
</AnimatedFocusView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import DateManager from "../../managers/DateManager";
|
||||||
import AnimatedBottomBar from "../../components/Animations/AnimatedBottomBar";
|
import AnimatedBottomBar from "../../components/Animations/AnimatedBottomBar";
|
||||||
import {CommonActions} from "@react-navigation/native";
|
import {CommonActions} from "@react-navigation/native";
|
||||||
import ErrorView from "../../components/Screens/ErrorView";
|
import ErrorView from "../../components/Screens/ErrorView";
|
||||||
|
import AnimatedFocusView from "../../components/Animations/AnimatedFocusView";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
navigation: Object,
|
navigation: Object,
|
||||||
|
|
@ -299,8 +300,8 @@ class PlanexScreen extends React.Component<Props, State> {
|
||||||
render() {
|
render() {
|
||||||
const {containerPaddingTop} = this.props.collapsibleStack;
|
const {containerPaddingTop} = this.props.collapsibleStack;
|
||||||
return (
|
return (
|
||||||
<View
|
<AnimatedFocusView
|
||||||
style={{flex: 1}}
|
{...this.props}
|
||||||
>
|
>
|
||||||
<Banner
|
<Banner
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -339,7 +340,7 @@ class PlanexScreen extends React.Component<Props, State> {
|
||||||
onPress={this.sendMessage}
|
onPress={this.sendMessage}
|
||||||
seekAttention={this.state.currentGroup.id === -1}
|
seekAttention={this.state.currentGroup.id === -1}
|
||||||
/>
|
/>
|
||||||
</View>
|
</AnimatedFocusView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import {
|
||||||
} from '../../utils/Planning';
|
} from '../../utils/Planning';
|
||||||
import {Avatar, Divider, List} from 'react-native-paper';
|
import {Avatar, Divider, List} from 'react-native-paper';
|
||||||
import CustomAgenda from "../../components/Overrides/CustomAgenda";
|
import CustomAgenda from "../../components/Overrides/CustomAgenda";
|
||||||
|
import AnimatedFocusView from "../../components/Animations/AnimatedFocusView";
|
||||||
|
|
||||||
LocaleConfig.locales['fr'] = {
|
LocaleConfig.locales['fr'] = {
|
||||||
monthNames: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
|
monthNames: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
|
||||||
|
|
@ -230,6 +231,9 @@ class PlanningScreen extends React.Component<Props, State> {
|
||||||
render() {
|
render() {
|
||||||
// console.log("rendering PlanningScreen");
|
// console.log("rendering PlanningScreen");
|
||||||
return (
|
return (
|
||||||
|
<AnimatedFocusView
|
||||||
|
{...this.props}
|
||||||
|
>
|
||||||
<CustomAgenda
|
<CustomAgenda
|
||||||
{...this.props}
|
{...this.props}
|
||||||
// the list of items that have to be displayed in agenda. If you want to render item as empty date
|
// the list of items that have to be displayed in agenda. If you want to render item as empty date
|
||||||
|
|
@ -258,6 +262,7 @@ class PlanningScreen extends React.Component<Props, State> {
|
||||||
// ref to this agenda in order to handle back button event
|
// ref to this agenda in order to handle back button event
|
||||||
onRef={this.onAgendaRef}
|
onRef={this.onAgendaRef}
|
||||||
/>
|
/>
|
||||||
|
</AnimatedFocusView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import i18n from "i18n-js";
|
||||||
import WebSectionList from "../../components/Screens/WebSectionList";
|
import WebSectionList from "../../components/Screens/WebSectionList";
|
||||||
import {List, withTheme} from 'react-native-paper';
|
import {List, withTheme} from 'react-native-paper';
|
||||||
import MaterialHeaderButtons, {Item} from "../../components/Overrides/CustomHeaderButton";
|
import MaterialHeaderButtons, {Item} from "../../components/Overrides/CustomHeaderButton";
|
||||||
|
import AnimatedFocusView from "../../components/Animations/AnimatedFocusView";
|
||||||
|
|
||||||
const DATA_URL = "https://etud.insa-toulouse.fr/~proximo/data/stock-v2.json";
|
const DATA_URL = "https://etud.insa-toulouse.fr/~proximo/data/stock-v2.json";
|
||||||
const LIST_ITEM_HEIGHT = 84;
|
const LIST_ITEM_HEIGHT = 84;
|
||||||
|
|
@ -233,6 +234,9 @@ class ProximoMainScreen extends React.Component<Props, State> {
|
||||||
render() {
|
render() {
|
||||||
const nav = this.props.navigation;
|
const nav = this.props.navigation;
|
||||||
return (
|
return (
|
||||||
|
<AnimatedFocusView
|
||||||
|
{...this.props}
|
||||||
|
>
|
||||||
<WebSectionList
|
<WebSectionList
|
||||||
createDataset={this.createDataset}
|
createDataset={this.createDataset}
|
||||||
navigation={nav}
|
navigation={nav}
|
||||||
|
|
@ -240,6 +244,7 @@ class ProximoMainScreen extends React.Component<Props, State> {
|
||||||
refreshOnFocus={false}
|
refreshOnFocus={false}
|
||||||
fetchUrl={DATA_URL}
|
fetchUrl={DATA_URL}
|
||||||
renderItem={this.getRenderItem}/>
|
renderItem={this.getRenderItem}/>
|
||||||
|
</AnimatedFocusView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import AprilFoolsManager from "../../managers/AprilFoolsManager";
|
||||||
import MaterialHeaderButtons, {Item} from "../../components/Overrides/CustomHeaderButton";
|
import MaterialHeaderButtons, {Item} from "../../components/Overrides/CustomHeaderButton";
|
||||||
import ProxiwashSectionHeader from "../../components/Lists/Proxiwash/ProxiwashSectionHeader";
|
import ProxiwashSectionHeader from "../../components/Lists/Proxiwash/ProxiwashSectionHeader";
|
||||||
import {withCollapsible} from "../../utils/withCollapsible";
|
import {withCollapsible} from "../../utils/withCollapsible";
|
||||||
|
import AnimatedFocusView from "../../components/Animations/AnimatedFocusView";
|
||||||
|
|
||||||
const DATA_URL = "https://etud.insa-toulouse.fr/~amicale_app/washinsa/washinsa.json";
|
const DATA_URL = "https://etud.insa-toulouse.fr/~amicale_app/washinsa/washinsa.json";
|
||||||
|
|
||||||
|
|
@ -421,8 +422,8 @@ class ProxiwashScreen extends React.Component<Props, State> {
|
||||||
const nav = this.props.navigation;
|
const nav = this.props.navigation;
|
||||||
const {containerPaddingTop} = this.props.collapsibleStack;
|
const {containerPaddingTop} = this.props.collapsibleStack;
|
||||||
return (
|
return (
|
||||||
<View
|
<AnimatedFocusView
|
||||||
style={{flex: 1}}
|
{...this.props}
|
||||||
>
|
>
|
||||||
<Banner
|
<Banner
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -454,7 +455,7 @@ class ProxiwashScreen extends React.Component<Props, State> {
|
||||||
autoRefreshTime={REFRESH_TIME}
|
autoRefreshTime={REFRESH_TIME}
|
||||||
refreshOnFocus={true}
|
refreshOnFocus={true}
|
||||||
updateData={this.state.machinesWatched.length}/>
|
updateData={this.state.machinesWatched.length}/>
|
||||||
</View>
|
</AnimatedFocusView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue