Skip to content

Commit

Permalink
fix(android): 🚑 Fix de nombreux bugs 7.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ecnivtwelve committed Feb 27, 2025
1 parent 1684113 commit f28dd45
Show file tree
Hide file tree
Showing 14 changed files with 168 additions and 30 deletions.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"conventionalCommits.scopes": [
"android"
]
}
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<data android:scheme="papillon"/>
<data android:scheme="xyz.getpapillon.app"/>
<data android:scheme="izly"/>
<data android:scheme="exp+papillonvex"/>
</intent-filter>
<intent-filter data-generated="true">
<action android:name="android.intent.action.VIEW"/>
Expand Down
6 changes: 6 additions & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ export default (): ExpoConfig => ({
}
}
],
[
"expo-dev-client",
{
"launchMode": "most-recent"
}
],
"./plugins/notifee-mod.js",
[
"expo-font",
Expand Down
6 changes: 6 additions & 0 deletions ios/Papillon/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
<string>izly</string>
</array>
</dict>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>exp+papillonvex</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
Expand Down
83 changes: 76 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"expo-clipboard": "~6.0.3",
"expo-constants": "~16.0.2",
"expo-crypto": "~13.0.2",
"expo-dev-client": "~4.0.29",
"expo-dev-menu": "^5.0.23",
"expo-device": "~6.0.2",
"expo-file-system": "~17.0.1",
Expand Down Expand Up @@ -95,7 +96,7 @@
"react-native-qrcode-svg": "^6.3.1",
"react-native-reanimated": "~3.10.1",
"react-native-safe-area-context": "4.10.5",
"react-native-screens": "^4.6.0",
"react-native-screens": "^4.9.1",
"react-native-share": "^12.0.3",
"react-native-svg": "^15.2.0",
"react-native-url-polyfill": "^2.0.0",
Expand Down
9 changes: 9 additions & 0 deletions react-native.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
dependencies: {
"react-native-ios-visual-effect-view": {
platforms: {
android: null, // Ignore Android
},
},
},
};
4 changes: 2 additions & 2 deletions src/components/Global/AnimatedNumber.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { StyleProp, TextStyle, ViewStyle } from "react-native";
import { Platform, type StyleProp, type TextStyle, type ViewStyle } from "react-native";
import { NativeText } from "@/components/Global/NativeComponents";
import { animPapillon } from "@/utils/ui/animations";
import Reanimated, {
Expand Down Expand Up @@ -28,7 +28,7 @@ const AnimatedNumber: React.FC<AnimatedNumberProps> = ({
}
}, []);

const shouldAnimate = !isFirstRender.current;
const shouldAnimate = !isFirstRender.current && Platform.OS !== "android";

return (
<Reanimated.View
Expand Down
2 changes: 1 addition & 1 deletion src/router/helpers/create-screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const navigatorScreenOptions: NativeStackNavigationOptions = {
fontFamily: "semibold",
},
headerBackTitle: "Retour",
animation: Platform.OS === "android" ? "slide_from_right" : "default",
animation: Platform.OS === "android" ? "default" : "default",
};

const createScreen = <ScreenName extends keyof RouteParameters>(
Expand Down
6 changes: 5 additions & 1 deletion src/router/helpers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ export type RouteParameters = {
PronoteAuthenticationSelector: undefined;
PronoteGeolocation: undefined;
PronoteManualLocation: undefined;
PronoteInstanceSelector: CurrentPosition;
PronoteInstanceSelector: {
longitude: number;
latitude: number;
hideDistance: boolean;
};
PronoteCredentials: { instanceURL: string; information: pronote.Instance };
PronoteManualURL?: { url?: string; method?: string };
PronoteQRCode: undefined;
Expand Down
21 changes: 19 additions & 2 deletions src/router/screens/settings/navigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import { createNativeStackNavigator } from "@react-navigation/native-stack";
import screens from ".";
import { navigatorScreenOptions } from "@/router/helpers/create-screen";
import AlertProvider from "@/providers/AlertProvider";
import { Platform, View } from "react-native";

export const SettingsStack = createNativeStackNavigator<RouteParameters>();
export const SettingsScreen: Screen<"SettingStack"> = ({ route }) => {
return (
<AlertProvider>
<ConditionnalAlertProvider>
<SettingsStack.Navigator screenOptions={navigatorScreenOptions}>
{screens.map((screen) => (
// @ts-expect-error : type not compatible, but it works fine.
Expand All @@ -18,6 +19,22 @@ export const SettingsScreen: Screen<"SettingStack"> = ({ route }) => {
/>
))}
</SettingsStack.Navigator>
</AlertProvider>
</ConditionnalAlertProvider>
);
};

const ConditionnalAlertProvider = (props: any) => {
if(Platform.OS === "android") {
return (
<View style={{flex: 1}}>
{props.children}
</View>
);
}

return (
<AlertProvider>
{props.children}
</AlertProvider>
);
};
16 changes: 4 additions & 12 deletions src/router/screens/views/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,32 +74,24 @@ export default [
}),
createScreen("LessonDocument", LessonDocument, {
headerTitle: "Cours",
presentation: "formSheet",
gestureDirection: "vertical",
animation: "slide_from_bottom",
presentation: "modal",
headerShown: false,
sheetCornerRadius: 16,
}),
createScreen("HomeworksDocument", HomeworksDocument, {
headerTitle: "Devoir",
presentation: "formSheet",
gestureDirection: "vertical",
animation: "slide_from_bottom",
presentation: "modal",
headerShown: false,
sheetCornerRadius: 16,
}),
createScreen("GradeSubject", GradeSubjectScreen, {
headerTitle: "Détail de la matière",
presentation: "formSheet",
gestureDirection: "vertical",
animation: "slide_from_bottom",
presentation: "modal",
sheetCornerRadius: 16,
}),
createScreen("GradeDocument", GradeDocument, {
headerTitle: "Détail de la note",
presentation: "formSheet",
gestureDirection: "vertical",
animation: "slide_from_bottom",
presentation: "modal",
headerShown: Platform.OS !== "ios",
sheetCornerRadius: 24,
}),
Expand Down
Loading

0 comments on commit f28dd45

Please sign in to comment.