Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/mobile #305

Merged
merged 41 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
67bec75
chore: Refactor ForgotPassword screen to remove unused code and impro…
u21631532 Aug 8, 2024
ad4904b
chore: Update Appearance screen with color picker for custom accent c…
u21631532 Aug 8, 2024
f708946
chore: Add reanimated-color-picker npm dependency for custom accent c…
u21631532 Aug 8, 2024
91b2962
chore: Update FAQPage with back button functionality and header styling
u21631532 Aug 8, 2024
581461e
chore: Update login screen navigation to home and improve UI layout
KamogeloMoeketse Aug 8, 2024
b27c3e5
Merge branch 'fix/mobile' of https://github.com/COS301-SE-2024/occupi…
KamogeloMoeketse Aug 8, 2024
777fb78
chore: Update npm dependencies and add location functionality
u21631532 Aug 8, 2024
9ff910b
feat: Add location functionality to Onboarding1 screen
u21631532 Aug 8, 2024
3e96965
Merge branch 'fix/mobile' of https://github.com/COS301-SE-2024/occupi…
u21631532 Aug 8, 2024
8a2242e
feat: Add info screen to settings menu and update navigation
KamogeloMoeketse Aug 8, 2024
49823d1
Merge branch 'fix/mobile' of https://github.com/COS301-SE-2024/occupi…
KamogeloMoeketse Aug 8, 2024
b58bbb6
feat: Add address logging functionality to Onboarding1 screen
u21631532 Aug 9, 2024
5e6d4ff
Merge branch 'fix/mobile' of https://github.com/COS301-SE-2024/occupi…
u21631532 Aug 9, 2024
054bcc3
chore: Update Dashboard component to handle cases with no bookings found
u21631532 Aug 9, 2024
bf352ad
feat: Add location checking for auto checkin and restyling notiificat…
KamogeloMoeketse Aug 9, 2024
8ea2416
Merge branch 'fix/mobile' of https://github.com/COS301-SE-2024/occupi…
KamogeloMoeketse Aug 9, 2024
0bbf3f0
feat: Add error message for empty bookings list in ViewBookings screen
u21631532 Aug 9, 2024
924c3d3
Merge branch 'fix/mobile' of https://github.com/COS301-SE-2024/occupi…
u21631532 Aug 9, 2024
bb3fd5a
feat: Include pdf download/sharing for booking
KamogeloMoeketse Aug 9, 2024
2e571c7
Merge branch 'fix/mobile' of https://github.com/COS301-SE-2024/occupi…
KamogeloMoeketse Aug 9, 2024
9a23d4f
feat: Add error message for empty bookings list in ViewBookings screen
KamogeloMoeketse Aug 9, 2024
102aa28
chore: Remove unused test files for NavBar, FAQPage, and Profile comp…
u21631532 Aug 9, 2024
d076a05
chore: Update router paths for login and onboarding screens
KamogeloMoeketse Aug 9, 2024
5dc7841
feat: Add back tap functionality for security settings
u21631532 Aug 9, 2024
87bde8d
feat: Add expo-sensors and expo-haptics dependencies
u21631532 Aug 9, 2024
381cb22
Merge branch 'fix/mobile' of https://github.com/COS301-SE-2024/occupi…
u21631532 Aug 9, 2024
d9291d6
chore: Update Dashboard.tsx to improve readability and consistency
u21631532 Aug 9, 2024
b460022
feat: Add expo-notifications plugin for push notifications
KamogeloMoeketse Aug 9, 2024
7abd851
Merge branch 'fix/mobile' of https://github.com/COS301-SE-2024/occupi…
KamogeloMoeketse Aug 9, 2024
79eaa64
feat: Force user to check terms of service and privacy policy
KamogeloMoeketse Aug 10, 2024
97dd6fb
chore: Kepp CHeckin value consistent across app
KamogeloMoeketse Aug 10, 2024
ea4a830
feat: Add isPointInPolygon function for location check-in
KamogeloMoeketse Aug 11, 2024
19f2bb9
chore: Update router paths for login and onboarding screens
KamogeloMoeketse Aug 11, 2024
81173b9
feat: add bar graph and switching between weekly and hourly data
KamogeloMoeketse Aug 11, 2024
5cf651a
feat: updating test files
u21631532 Aug 11, 2024
5f81e42
chore: Remove unused test files and update package dependencies
u21631532 Aug 11, 2024
9ee9426
chore: update generated pdf
KamogeloMoeketse Aug 11, 2024
1b5d082
Merge branch 'fix/mobile' of https://github.com/COS301-SE-2024/occupi…
KamogeloMoeketse Aug 11, 2024
7c60a07
fix: color code prediction level and other aesthetic changes
KamogeloMoeketse Aug 11, 2024
7ca1b7d
chore: Remove unused test files and update package dependencies
KamogeloMoeketse Aug 11, 2024
2360606
chore: Linting errors
KamogeloMoeketse Aug 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions frontend/occupi-mobile4/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@
"usesNonExemptEncryption": false
},
"infoPlist": {
"NSFaceIDUsageDescription": "This app uses Face ID or Touch ID to confirm bookings."
"NSFaceIDUsageDescription": "This app uses Face ID or Touch ID to confirm bookings.",
"NSLocationWhenInUseUsageDescription": "This app uses your location to provide relevant information."
}
},
"android": {
"permissions": [
"USE_BIOMETRIC",
"USE_FINGERPRINT"
"USE_FINGERPRINT",
"ACCESS_COARSE_LOCATION",
"ACCESS_FINE_LOCATION"
],
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive-icon.png",
Expand All @@ -40,12 +43,10 @@
},
"plugins": [
"expo-router",
[
"expo-secure-store",
{
"faceIDPermission": "Allow $(PRODUCT_NAME) to access your Face ID biometric data."
}
]
"expo-secure-store",
"expo-location",
"expo-notifications",
"expo-sensors"
],
"experiments": {
"typedRoutes": true
Expand Down
1 change: 1 addition & 0 deletions frontend/occupi-mobile4/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default function RootLayout() {
<Stack.Screen name="set-appearance" options={{ headerShown: false }} />
<Stack.Screen name="notiftester" options={{ headerShown: false }} />
<Stack.Screen name="changepassword" options={{ headerShown: false }} />
<Stack.Screen name="info" options={{ headerShown: false }} />
</Stack>
</NavBarProvider>
</ThemeProvider>
Expand Down
5 changes: 5 additions & 0 deletions frontend/occupi-mobile4/app/info.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Info from '../screens/Settings/Info';

export default function Home() {
return <Info />;
}
71 changes: 71 additions & 0 deletions frontend/occupi-mobile4/components/BarGraph.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import React, { useEffect, useState } from 'react'
import { widthPercentageToDP as wp, heightPercentageToDP as hp } from 'react-native-responsive-screen';
import {
View, Text
} from '@gluestack-ui/themed';
import * as SecureStore from 'expo-secure-store';
import { BarChart } from "react-native-gifted-charts"
import { useColorScheme } from 'react-native';
import { useTheme } from './ThemeContext';
import { convertValues } from '@/utils/occupancy';


const BarGraph = (data) => {
const colorscheme = useColorScheme();
const { theme } = useTheme();
const currentTheme = theme === "system" ? colorscheme : theme;
// console.log(data.data);
const labels = currentTheme === 'dark' ? "lightgray" : "darkgrey";
const [accentColour, setAccentColour] = useState<string>('greenyellow');
// console.log(convertValues(data.data));
useEffect(() => {
const getAccentColour = async () => {
let accentcolour = await SecureStore.getItemAsync('accentColour');
setAccentColour(accentcolour);
};
getAccentColour();
}, []);
return (
<View
style={{ width: wp('100%'), height: hp('35%'), flexDirection: 'column' }}
// style={{
// // marginVertical: 100,
// paddingVertical: 20,
// backgroundColor: '#414141',
// }}
>
<Text color={currentTheme === "dark" ? 'white' : 'black'} fontWeight="$medium" underline mb="$4" alignSelf='center'>Predicted Occupancy by Number</Text>
<BarChart
isAnimated
width={wp('80%')}
color={accentColour}
maxValue={1500}
noOfSections={5}
// hideRules
// animateOnDataChange={true}
animationDuration={500}
// onDataChangeAnimationDuration={100}
endSpacing={0}
yAxisTextStyle={{color: labels}}
xAxisLabelTextStyle={{color: labels}}
data={convertValues(data.data)}
showGradient
frontColor={currentTheme === 'dark' ? "lightgray" : "darkgrey"}
gradientColor={accentColour}
// barBorderTopLeftRadius={5}
// barBorderTopRightRadius={5}
spacing={20}
backgroundColor={currentTheme === 'dark' ? "#414141" : "white"}
// showVerticalLines
// verticalLinesColor="rgba(14,164,164,0.5)"
// rulesColor="gray"
rulesType="dashed"
initialSpacing={16}
yAxisColor={currentTheme === 'dark' ? "lightgray" : "darkgrey"}
xAxisColor={currentTheme === 'dark' ? "lightgray" : "darkgrey"}
/>
</View>
)
}

export default BarGraph
6 changes: 4 additions & 2 deletions frontend/occupi-mobile4/components/LineGraph.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React, { useEffect, useState } from 'react'
import { widthPercentageToDP as wp, heightPercentageToDP as hp } from 'react-native-responsive-screen';
import {
View,
View, Text
} from '@gluestack-ui/themed';
import * as SecureStore from 'expo-secure-store';
import { LineChart } from "react-native-gifted-charts"
import { useColorScheme } from 'react-native';
import { useTheme } from './ThemeContext';


const LineGraph = (data) => {
const colorscheme = useColorScheme();
const { theme } = useTheme();
Expand All @@ -31,6 +32,7 @@ const LineGraph = (data) => {
// backgroundColor: '#414141',
// }}
>
<Text color={currentTheme === "dark" ? 'white' : 'black'} fontWeight="$medium" underline mb="$4" alignSelf='center'>Predicted Occupancy by level</Text>
<LineChart
isAnimated
width={wp('80%')}
Expand Down Expand Up @@ -58,7 +60,7 @@ const LineGraph = (data) => {
// verticalLinesColor="rgba(14,164,164,0.5)"
// rulesColor="gray"
rulesType="dashed"
initialSpacing={20}
initialSpacing={16}
yAxisColor={currentTheme === 'dark' ? "lightgray" : "darkgrey"}
xAxisColor={currentTheme === 'dark' ? "lightgray" : "darkgrey"}
/>
Expand Down
40 changes: 40 additions & 0 deletions frontend/occupi-mobile4/components/SpinningLogo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Keyboard, Animated, Easing } from 'react-native';

Check warning on line 1 in frontend/occupi-mobile4/components/SpinningLogo.tsx

View workflow job for this annotation

GitHub Actions / 🌸 Lint

'Keyboard' is defined but never used
import { widthPercentageToDP as wp, heightPercentageToDP as hp } from 'react-native-responsive-screen';

Check warning on line 2 in frontend/occupi-mobile4/components/SpinningLogo.tsx

View workflow job for this annotation

GitHub Actions / 🌸 Lint

'hp' is defined but never used
import React, { useEffect, useRef } from 'react'
import { HStack, Image } from '@gluestack-ui/themed';
import Logo from '../screens/Login/assets/images/Occupi/Occupi-gradient.png';

const SpinningLogo = () => {

const spinValue = useRef(new Animated.Value(0)).current;

useEffect(() => {
Animated.loop(
Animated.timing(spinValue, {
toValue: 2,
duration: 10000,
easing: Easing.linear,
useNativeDriver: true,
})
).start();
}, [spinValue]);

const spin = spinValue.interpolate({
inputRange: [0, 1],
outputRange: ['0deg', '360deg'],
});

return (
<HStack space="md" alignItems="center" justifyContent="center">
<Animated.View style={{ transform: [{ rotate: spin }] }}>
<Image
alt="Occupi Logo"
source={Logo}
style={{ width: wp('40%'), height: wp('40%') }}
/>
</Animated.View>
</HStack>
)
}

export default SpinningLogo
23 changes: 0 additions & 23 deletions frontend/occupi-mobile4/components/__tests__/NavBar-test.tsx

This file was deleted.

Loading
Loading