diff --git a/assets/swimmer.jpg b/assets/swimmer.jpg new file mode 100644 index 0000000..0775bd2 Binary files /dev/null and b/assets/swimmer.jpg differ diff --git a/components/NewAppMain.js b/components/NewAppMain.js index 218a9a5..7c39ab5 100644 --- a/components/NewAppMain.js +++ b/components/NewAppMain.js @@ -6,7 +6,7 @@ import { createStackNavigator } from '@react-navigation/stack'; import MainMenuView from "../views/MainMenuView"; import SettingsView from "../views/SettingsView"; import TrainingView from "../views/TrainingView"; - +import LastSessionsView from "../views/LastSessionsView"; const Stack = createStackNavigator(); function NewAppMain(props) { @@ -16,25 +16,30 @@ function NewAppMain(props) { } return ( - - - - - - - + + + + + + + + ) }; diff --git a/package-lock.json b/package-lock.json index 955a4b5..10aa142 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8021,6 +8021,11 @@ "resolved": "https://registry.npmjs.org/react-native-svg-web/-/react-native-svg-web-1.0.8.tgz", "integrity": "sha512-oi+u8gNZvqkP35/XJNs8CDIlucqD6n1uhQZjQ+9J/m2abQ3YOAZSzZ23/8YeOsNDabl0pYsZFinG89K4E6EMgA==" }, + "react-native-swipe-list-view": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/react-native-swipe-list-view/-/react-native-swipe-list-view-3.2.3.tgz", + "integrity": "sha512-f0B92eZiO0mCk7ZFtn8tbLz4lb+mR8xzcfjFqCVSDeXnuNw7GenUMsccGnclIOhnxnip5BHvUHavlD41peGqig==" + }, "react-native-unimodules": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/react-native-unimodules/-/react-native-unimodules-0.8.1.tgz", diff --git a/package.json b/package.json index 3bc4dba..1592cd8 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "react-native-screens": "~2.2.0", "react-native-svg": "11.0.1", "react-native-svg-web": "^1.0.7", + "react-native-swipe-list-view": "^3.2.3", "react-native-unimodules": "~0.8.1", "react-native-web": "^0.11.7", "react-redux": "^7.2.0", diff --git a/state/Reducer.js b/state/Reducer.js index 63c4edc..624a9e0 100644 --- a/state/Reducer.js +++ b/state/Reducer.js @@ -27,8 +27,8 @@ export const stopSession = () => ({ const INITIAL_SETTINGS = { theme: "hot", username: "", - //swimTrackerHost: "192.168.178.107", - swimTrackerHost: "192.168.178.110", + //swimTrackerHost: "192.168.178.107", // am pool + swimTrackerHost: "192.168.178.110", // testgeraet analysis: { peaksPerLap: 30, diff --git a/views/ImageHeader.js b/views/ImageHeader.js new file mode 100644 index 0000000..c85414c --- /dev/null +++ b/views/ImageHeader.js @@ -0,0 +1,56 @@ +import React from "react"; +import { + View, + ImageBackground, + Text, + TouchableOpacity, + StyleSheet, +} from "react-native"; +import EntypoIcon from "react-native-vector-icons/Entypo"; + + +function ImageHeader(props) { + return ( + + + + props.navigation.goBack()}> + + + {props.text} + + + + ) +} + + +const imageHeaderStyles = StyleSheet.create({ + container: { + flex: 1, + minHeight: 175, + maxHeight: 175, + height: 175, + width: "100%", + }, + row: { + paddingTop: 30, + flexDirection: "row", + }, + icon: { + color: "white", + fontSize: 40, + paddingRight: 10, + paddingLeft: 10, + }, + text: { + color: "white", + fontSize: 30, + }, +}); + +export default ImageHeader; \ No newline at end of file diff --git a/views/LastSessionView.js b/views/LastSessionView.js deleted file mode 100644 index e69de29..0000000 diff --git a/views/LastSessionsView.js b/views/LastSessionsView.js new file mode 100644 index 0000000..358b7b8 --- /dev/null +++ b/views/LastSessionsView.js @@ -0,0 +1,182 @@ +import React from "react"; +import { + StyleSheet, + View, + StatusBar, + Text, + TouchableOpacity, +} from "react-native"; +import themeColors from './themeColors'; +import EntypoIcon from "react-native-vector-icons/Entypo"; +import AntDesignIcon from "react-native-vector-icons/AntDesign"; +import FaIcon from "react-native-vector-icons/FontAwesome5"; +import ImageHeader from "./ImageHeader"; +import { SwipeListView } from 'react-native-swipe-list-view'; + +function SessionCard(props) { + return ( + + + {props.textFirstLine} + + + + + + {props.activeTime} + + + + {props.momentum} + + + + {props.laps} + + + + ) +} + +function SessionCardBehindSwipe(props) { + return ( + + deleteRow(rowMap, data.item.key)} + > + Löschen + + + ); +} + +const sessionCardStyles = StyleSheet.create({ + card: { + backgroundColor: "#559ac8", + borderRadius: 12, + height: 100, + maxHeight: 100, + flex: 1, + flexDirection: "column", + justifyContent: "space-around", + padding: 10, + margin: 10, + paddingLeft: 20, + }, + firstLineText: { + color: "white", + fontSize: 22 + }, + iconTextPair: { + maxWidth: 100, + flex: 1, + flexDirection: "row", + alignItems: "center", + }, + secondLine: { + flex: 1, + justifyContent: "space-between", + alignContent: "center", + flexDirection: "row", + maxHeight: 30, + marginTop: 14, + }, + icon: { + fontSize: 30, + color: "white", + paddingRight: 10, + }, + secondLineText: { + color: "white", + fontSize: 18, + }, + spacerHidden: { + flex: 1, + color: "black", + }, + rowBack: { + alignItems: 'center', + backgroundColor: themeColors['ALIZARIN'], + flex: 1, + flexDirection: 'row', + justifyContent: 'space-between', + height: 100, + padding: 10, + margin: 10, + paddingLeft: 20, + borderRadius: 12, + }, + deleteButton: { + alignItems: 'center', + bottom: 0, + justifyContent: 'center', + position: 'absolute', + backgroundColor: themeColors['ALIZARIN'], + top: 0, + width: 150, + right: 0, + borderTopRightRadius: 12, + borderBottomRightRadius: 12, + }, +}) + +// --------------------------------------------------------------------------------------------- + + +function LastSessionsView(props) { + const data = [ + { + textFirstLine: "Gestern 19:12 Uhr", + laps: "31", + activeTime: "26:13", + laps: "35", + momentum: "120", + }, + { + textFirstLine: "Montag 18:10 Uhr", + laps: "27", + activeTime: "26:13", + laps: "35", + momentum: "120", + }, + ] + + const renderHiddenItem = (data, rowMap) => ( + + ); + + return ( + + + ) +} + +export default LastSessionsView; \ No newline at end of file diff --git a/views/MainMenuView.js b/views/MainMenuView.js index 9410f7b..d858293 100644 --- a/views/MainMenuView.js +++ b/views/MainMenuView.js @@ -215,7 +215,10 @@ function MainMenuView(props) { > - props.navigation.navigate('Settings')} /> + props.navigation.navigate('Settings')} + onLastSessionsPress = {() => props.navigation.navigate("LastSessions")} + /> - - - props.navigation.goBack()}> - - - {props.text} - - - - ) -} - -const imageHeaderStyles = StyleSheet.create({ - container: { - flex: 1, - minHeight: 175, - maxHeight: 175, - height: 175, - width: "100%", - }, - row: { - paddingTop: 30, - flexDirection: "row", - }, - icon: { - color: "white", - fontSize: 40, - paddingRight: 10, - paddingLeft: 10, - }, - text: { - color: "white", - fontSize: 30, - }, -}); - // --------------------------------------------------------------------------------------------- function SettingsTextInput(props) { @@ -86,7 +44,7 @@ function SettingsSwitch(props) { value={isEnabled} //thumbColor={themeColors["WET ASPHALT"]} onValueChange={toggleSwitch} - trackColor={{ false: "#767577", true: themeColors["NEPHRITIS"] }} + trackColor={{ false: "#767577", true: themeColors["NEPHRITIS"] }} //thumbColor={isEnabled ? "#f5dd4b" : "#f4f3f4"} ios_backgroundColor="grey" style={settingsGroupStyles.switch} @@ -187,7 +145,12 @@ function SettingsView(props) {