diff --git a/App.js b/App.js
index a95f7f8..20d8e0e 100644
--- a/App.js
+++ b/App.js
@@ -1,11 +1,13 @@
import React from 'react';
-import {Dimensions, StyleSheet, View, Text} from 'react-native';
-import {StyleProvider, Root} from 'native-base';
+import {StyleProvider, Root, View} from 'native-base';
import AppNavigator from './navigation/AppNavigator';
import ThemeManager from './utils/ThemeManager';
import LocaleManager from './utils/LocaleManager';
import * as Font from 'expo-font';
-
+// edited native-base-shoutem-theme according to
+// https://github.com/GeekyAnts/theme/pull/5/files/91f67c55ca6e65fe3af779586b506950c9f331be#diff-4cfc2dd4d5dae7954012899f2268a422
+// to allow for dynamic theme switching
+import { clearThemeCache } from 'native-base-shoutem-theme';
export default class App extends React.Component {
@@ -35,9 +37,10 @@ export default class App extends React.Component {
updateTheme() {
console.log('update theme called');
// Change not propagating, need to restart the app
- // this.setState({
- // currentTheme: ThemeManager.getInstance().getCurrentTheme()
- // });
+ this.setState({
+ currentTheme: ThemeManager.getInstance().getCurrentTheme()
+ });
+ clearThemeCache();
}
render() {
@@ -45,12 +48,15 @@ export default class App extends React.Component {
return ;
}
console.log('rendering');
- // console.log(this.state.currentTheme.variables.containerBgColor);
+ console.log(this.state.currentTheme.variables.containerBgColor);
return (
-
-
+
+
+
-
- );
+
+
+
+ );
}
}
diff --git a/app.json b/app.json
index 706e2ca..902f61d 100644
--- a/app.json
+++ b/app.json
@@ -12,10 +12,11 @@
"version": "0.0.1",
"orientation": "portrait",
"icon": "./assets/icon.png",
+ "primaryColor": "#e42612",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
- "backgroundColor": "#ffffff"
+ "backgroundColor": "#fff"
},
"updates": {
"fallbackToCacheTimeout": 0
@@ -24,7 +25,11 @@
"**/*"
],
"ios": {
- "supportsTablet": true
+ "supportsTablet": true,
+ "bundleIdentifier": "com.test.applicationamicale"
+ },
+ "android": {
+ "package": "com.test.applicationamicale"
}
}
}
diff --git a/assets/splash.png b/assets/splash.png
index 9cb8c72..81e9281 100644
Binary files a/assets/splash.png and b/assets/splash.png differ
diff --git a/components/CustomMaterialIcon.js b/components/CustomMaterialIcon.js
new file mode 100644
index 0000000..146d2fa
--- /dev/null
+++ b/components/CustomMaterialIcon.js
@@ -0,0 +1,30 @@
+import React from 'react';
+import {Icon} from "native-base";
+import ThemeManager from '../utils/ThemeManager';
+
+export default class CustomMaterialIcon extends React.Component {
+
+ constructor(props) {
+ super(props);
+ }
+
+ render() {
+ return (
+
+ );
+ }
+}
diff --git a/components/SideMenu.js b/components/SideMenu.js
index a5958e5..386b263 100644
--- a/components/SideMenu.js
+++ b/components/SideMenu.js
@@ -2,6 +2,7 @@ import React from 'react';
import {Platform, Dimensions, StyleSheet, Image, FlatList, Linking} from 'react-native';
import {Badge, Text, Container, Content, Icon, Left, ListItem, Right} from "native-base";
import i18n from "i18n-js";
+import CustomMaterialIcon from '../components/CustomMaterialIcon';
const deviceHeight = Dimensions.get("window").height;
@@ -101,11 +102,9 @@ export default class SideBar extends React.Component {
}}
>
-
{item.name}
diff --git a/native-base-theme/components/Button.js b/native-base-theme/components/Button.js
index 62cefe6..c373fdc 100644
--- a/native-base-theme/components/Button.js
+++ b/native-base-theme/components/Button.js
@@ -319,7 +319,7 @@ export default (variables /*: * */ = variable) => {
fontFamily: variables.btnFontFamily,
marginLeft: 0,
marginRight: 0,
- color: variables.inverseTextColor,
+ color: variables.btnTextColor,
fontSize: variables.btnTextSize,
paddingHorizontal: 16,
backgroundColor: "transparent"
@@ -327,13 +327,13 @@ export default (variables /*: * */ = variable) => {
},
"NativeBase.Icon": {
- color: variables.inverseTextColor,
+ color: variables.btnTextColor,
fontSize: 24,
marginHorizontal: 16,
paddingTop: platform === "ios" ? 2 : undefined
},
"NativeBase.IconNB": {
- color: variables.inverseTextColor,
+ color: variables.btnTextColor,
fontSize: 24,
marginHorizontal: 16,
paddingTop: platform === "ios" ? 2 : undefined
diff --git a/native-base-theme/variables/platform.js b/native-base-theme/variables/platform.js
index b5a5252..58a081a 100644
--- a/native-base-theme/variables/platform.js
+++ b/native-base-theme/variables/platform.js
@@ -35,6 +35,7 @@ export default {
// Button
btnFontFamily: platform === "ios" ? "System" : "Roboto_medium",
+ btnTextColor: '#fff',
btnDisabledBg: "#b5b5b5",
buttonPadding: 6,
get btnPrimaryBg() {
@@ -100,7 +101,7 @@ export default {
CheckboxIconSize: platform === "ios" ? 21 : 16,
CheckboxIconMarginTop: platform === "ios" ? undefined : 1,
CheckboxFontSize: platform === "ios" ? 23 / 0.9 : 17,
- checkboxBgColor: "#039BE5",
+ checkboxBgColor: "#E4202D",
checkboxSize: 20,
checkboxTickColor: "#fff",
@@ -210,7 +211,7 @@ export default {
// Radio Button
radioBtnSize: platform === "ios" ? 25 : 23,
- radioSelectedColorAndroid: "#3F51B5",
+ radioSelectedColorAndroid: "#E4202D",
radioBtnLineHeight: platform === "ios" ? 29 : 24,
get radioColor() {
return this.brandPrimary;
@@ -254,6 +255,17 @@ export default {
subtitleColor: platform === "ios" ? "#8e8e93" : "#FFF",
titleFontColor: platform === "ios" ? "#000" : "#FFF",
+
+ // CUSTOM
+ customMaterialIconColor: "#5d5d5d",
+
+ // PROXIWASH
+ proxiwashFinishedColor: "rgba(54,165,22,0.4)",
+ proxiwashReadyColor: "transparent",
+ proxiwashRunningColor: "rgba(94,104,241,0.4)",
+ proxiwashBrokenColor: "#a2a2a2",
+ proxiwashErrorColor: "rgba(204,7,0,0.4)",
+
// Other
borderRadiusBase: platform === "ios" ? 5 : 2,
borderWidth: 1 / PixelRatio.getPixelSizeForLayoutSize(1),
diff --git a/native-base-theme/variables/platformDark.js b/native-base-theme/variables/platformDark.js
index e3fe4c2..b23bc07 100644
--- a/native-base-theme/variables/platformDark.js
+++ b/native-base-theme/variables/platformDark.js
@@ -35,37 +35,38 @@ export default {
// Button
btnFontFamily: platform === "ios" ? "System" : "Roboto_medium",
+ btnTextColor: '#fff',
btnDisabledBg: "#b5b5b5",
buttonPadding: 6,
get btnPrimaryBg() {
return this.brandPrimary;
},
get btnPrimaryColor() {
- return this.inverseTextColor;
+ return this.textColor;
},
get btnInfoBg() {
return this.brandInfo;
},
get btnInfoColor() {
- return this.inverseTextColor;
+ return this.textColor;
},
get btnSuccessBg() {
return this.brandSuccess;
},
get btnSuccessColor() {
- return this.inverseTextColor;
+ return this.textColor;
},
get btnDangerBg() {
return this.brandDanger;
},
get btnDangerColor() {
- return this.inverseTextColor;
+ return this.textColor;
},
get btnWarningBg() {
return this.brandWarning;
},
get btnWarningColor() {
- return this.inverseTextColor;
+ return this.textColor;
},
get btnTextSize() {
return platform === "ios" ? this.fontSizeBase * 1.1 : this.fontSizeBase - 1;
@@ -87,8 +88,8 @@ export default {
},
// Card
- cardDefaultBg: "#2b2b2b",
- cardBorderColor: "#ccc",
+ cardDefaultBg: "#363636",
+ cardBorderColor: "#1a1a1a",
cardBorderRadius: 2,
cardItemPadding: platform === "ios" ? 10 : 12,
@@ -100,7 +101,7 @@ export default {
CheckboxIconSize: platform === "ios" ? 21 : 16,
CheckboxIconMarginTop: platform === "ios" ? undefined : 1,
CheckboxFontSize: platform === "ios" ? 23 / 0.9 : 17,
- checkboxBgColor: "#039BE5",
+ checkboxBgColor: "#E4202D",
checkboxSize: 20,
checkboxTickColor: "#fff",
@@ -114,7 +115,7 @@ export default {
brandLight: "#f4f4f4",
//Container
- containerBgColor: "#2b2b2b",
+ containerBgColor: "#333333",
//Date Picker
datePickerTextColor: "#000",
@@ -197,11 +198,11 @@ export default {
// List
listBg: "transparent",
- listBorderColor: "#c9c9c9",
+ listBorderColor: "#727272",
listDividerBg: "#f4f4f4",
listBtnUnderlayColor: "#DDD",
listItemPadding: platform === "ios" ? 10 : 12,
- listNoteColor: "#808080",
+ listNoteColor: "#acacac",
listNoteSize: 13,
// Progress Bar
@@ -210,7 +211,7 @@ export default {
// Radio Button
radioBtnSize: platform === "ios" ? 25 : 23,
- radioSelectedColorAndroid: "#3F51B5",
+ radioSelectedColorAndroid: "#E4202D",
radioBtnLineHeight: platform === "ios" ? 29 : 24,
get radioColor() {
return this.brandPrimary;
@@ -240,7 +241,7 @@ export default {
tabFontSize: 15,
// Text
- textColor: "#fff",
+ textColor: "#d6d6d6",
inverseTextColor: "#000",
noteFontSize: 14,
get defaultTextColor() {
@@ -254,6 +255,18 @@ export default {
subtitleColor: platform === "ios" ? "#8e8e93" : "#FFF",
titleFontColor: platform === "ios" ? "#000" : "#FFF",
+
+ // CUSTOM
+ customMaterialIconColor: "#b3b3b3",
+
+ // PROXIWASH
+ proxiwashFinishedColor: "rgba(12,157,13,0.72)",
+ proxiwashReadyColor: "transparent",
+ proxiwashRunningColor: "rgba(29,59,175,0.65)",
+ proxiwashBrokenColor: "#000000",
+ proxiwashErrorColor: "rgba(213,8,0,0.57)",
+
+
// Other
borderRadiusBase: platform === "ios" ? 5 : 2,
borderWidth: 1 / PixelRatio.getPixelSizeForLayoutSize(1),
diff --git a/package-lock.json b/package-lock.json
index 6d1e1c0..5856c8e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1098,6 +1098,24 @@
}
}
},
+ "@shoutem/theme": {
+ "version": "0.11.3",
+ "resolved": "https://registry.npmjs.org/@shoutem/theme/-/theme-0.11.3.tgz",
+ "integrity": "sha512-2soc/w0QYWjvm+vFOemSAuDpRAzBW/sTtNkkqwwZfz0VcNH78FWnUfyMOJetmr1aiulFoE87JYeyHlfOhxKbbw==",
+ "requires": {
+ "hoist-non-react-statics": "^1.0.5",
+ "lodash": "~4.17.4",
+ "prop-types": "^15.5.10",
+ "tinycolor2": "^1.3.0"
+ },
+ "dependencies": {
+ "hoist-non-react-statics": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-1.2.0.tgz",
+ "integrity": "sha1-qkSM8JhtVcxAdzsXF0t90GbLfPs="
+ }
+ }
+ },
"@types/fbemitter": {
"version": "2.0.32",
"resolved": "https://registry.npmjs.org/@types/fbemitter/-/fbemitter-2.0.32.tgz",
@@ -8068,6 +8086,11 @@
"resolved": "https://registry.npmjs.org/tiny-queue/-/tiny-queue-0.2.1.tgz",
"integrity": "sha1-JaZ/LG4lOyypQZd7XvdELvl6YEY="
},
+ "tinycolor2": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.1.tgz",
+ "integrity": "sha1-9PrTM0R7wLB9TcjpIJ2POaisd+g="
+ },
"tmp": {
"version": "0.0.33",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
diff --git a/package.json b/package.json
index ec49a77..f935e60 100644
--- a/package.json
+++ b/package.json
@@ -9,6 +9,7 @@
},
"dependencies": {
"@expo/vector-icons": "latest",
+ "@shoutem/theme": "latest",
"expo": "^33.0.0",
"expo-font": "^5.0.1",
"expo-localization": "^5.0.1",
@@ -16,6 +17,7 @@
"i18n-js": "^3.3.0",
"i18next": "latest",
"native-base": "latest",
+ "native-base-shoutem-theme": "latest",
"react": "16.8.3",
"react-dom": "^16.8.6",
"react-i18next": "latest",
diff --git a/screens/About/AboutScreen.js b/screens/About/AboutScreen.js
index a9187e6..13124c4 100644
--- a/screens/About/AboutScreen.js
+++ b/screens/About/AboutScreen.js
@@ -1,10 +1,11 @@
import React from 'react';
-import {Platform, StyleSheet, Linking, Alert} from 'react-native';
-import {Container, Content, Text, Card, CardItem, Body, Icon, Left, Right, Thumbnail, H1} from 'native-base';
+import {Platform, StyleSheet, Linking, Alert, FlatList} from 'react-native';
+import {Container, Content, Text, Card, CardItem, Body, Icon, Left, Right, Thumbnail, H1, ListItem} from 'native-base';
import CustomHeader from "../../components/CustomHeader";
import i18n from "i18n-js";
import appJson from '../../app';
import packageJson from '../../package';
+import CustomMaterialIcon from "../../components/CustomMaterialIcon";
const links = {
appstore: 'https://qwant.com',
@@ -19,11 +20,105 @@ const links = {
react: 'https://facebook.github.io/react-native/',
};
+function openWebLink(link) {
+ Linking.openURL(link).catch((err) => console.error('Error opening link', err));
+}
export default class AboutScreen extends React.Component {
- openWebLink(link) {
- Linking.openURL(link).catch((err) => console.error('Error opening link', err));
+ appData = [
+ {
+ onPressCallback: () => openWebLink(Platform.OS === "ios" ? links.appstore : links.playstore),
+ icon: Platform.OS === "ios" ? 'apple' : 'google-play',
+ text: Platform.OS === "ios" ? i18n.t('aboutScreen.appstore') : i18n.t('aboutScreen.playstore'),
+ showChevron: true
+ },
+ {
+ onPressCallback: () => openWebLink(links.gitlab),
+ icon: 'git',
+ text: 'Gitlab',
+ showChevron: true
+ },
+ {
+ onPressCallback: () => openWebLink(links.bugs),
+ icon: 'bug',
+ text: i18n.t('aboutScreen.bugs'),
+ showChevron: true
+ },
+ {
+ onPressCallback: () => openWebLink(links.changelog),
+ icon: 'refresh',
+ text: i18n.t('aboutScreen.changelog'),
+ showChevron: true
+ },
+ {
+ onPressCallback: () => openWebLink(links.license),
+ icon: 'file-document',
+ text: i18n.t('aboutScreen.license'),
+ showChevron: true
+ },
+ ];
+
+ authorData = [
+ {
+ onPressCallback: () => Alert.alert('Coucou', 'Whaou'),
+ icon: 'account-circle',
+ text: 'Arnaud VERGNET',
+ showChevron: false
+ },
+ {
+ onPressCallback: () => openWebLink(links.mail),
+ icon: 'email',
+ text: i18n.t('aboutScreen.mail'),
+ showChevron: true
+ },
+ {
+ onPressCallback: () => openWebLink(links.linkedin),
+ icon: 'linkedin',
+ text: 'Linkedin',
+ showChevron: true
+ },
+ {
+ onPressCallback: () => openWebLink(links.facebook),
+ icon: 'facebook',
+ text: 'Facebook',
+ showChevron: true
+ },
+ ];
+
+ technoData = [
+ {
+ onPressCallback: () => openWebLink(links.react),
+ icon: 'react',
+ text: i18n.t('aboutScreen.reactNative'),
+ showChevron: false
+ },
+ {
+ onPressCallback: () => this.props.navigation.navigate('AboutDependenciesScreen', {data: packageJson.dependencies}),
+ icon: 'developer-board',
+ text: i18n.t('aboutScreen.libs'),
+ showChevron: true
+ },
+ ];
+
+ getCardItem(onPressCallback, icon, text, showChevron) {
+ return (
+
+
+
+ {text}
+
+ {showChevron ?
+
+
+
+ :
+
+ }
+ )
+ ;
}
render() {
@@ -44,182 +139,39 @@ export default class AboutScreen extends React.Component {