Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion app/android/android-passport-reader/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ dependencies {
implementation 'commons-codec:commons-codec:1.13'

//Camera
implementation 'io.fotoapparat:fotoapparat:2.7.0'
implementation "com.github.RedApparat:Fotoapparat:2.7.0"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi @remicolin fixes android package install issue

Screenshot 2025-04-23 at 8 22 46 PM


implementation 'androidx.multidex:multidex:2.0.1'

Expand Down
2 changes: 1 addition & 1 deletion app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ dependencies {
implementation 'com.google.android.gms:play-services-mlkit-text-recognition-common:19.1.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
implementation 'io.fotoapparat:fotoapparat:2.7.0'
implementation "com.github.RedApparat:Fotoapparat:2.7.0"

implementation "androidx.concurrent:concurrent-futures:1.1.0"
implementation "com.google.guava:guava:31.1-android"
Expand Down
3 changes: 2 additions & 1 deletion app/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ allprojects {
}
configurations.configureEach {
resolutionStrategy.dependencySubstitution {
substitute(platform(module('com.gemalto.jp2:jp2-android'))) using module('com.github.Tgo1014:JP2ForAndroid:1.0.4')
substitute(platform(module('com.gemalto.jp2:jp2-android'))) using module('com.github.Tgo1014:JP2ForAndroid:1.0.4')
substitute module('io.fotoapparat:fotoapparat') using module('com.github.RedApparat:Fotoapparat:2.7.0')
}
resolutionStrategy.force 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
}
Expand Down
10 changes: 6 additions & 4 deletions app/src/Sentry.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { SENTRY_DSN } from '@env';
import * as Sentry from '@sentry/react-native';

export const isSentryDisabled = !SENTRY_DSN;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simplify sentry check


export const initSentry = () => {
if (!SENTRY_DSN) {
if (isSentryDisabled) {
return null;
}

Expand Down Expand Up @@ -32,7 +34,7 @@ export const captureException = (
error: Error,
context?: Record<string, any>,
) => {
if (!SENTRY_DSN) {
if (isSentryDisabled) {
return;
}
Sentry.captureException(error, {
Expand All @@ -44,7 +46,7 @@ export const captureMessage = (
message: string,
context?: Record<string, any>,
) => {
if (!SENTRY_DSN) {
if (isSentryDisabled) {
return;
}
Sentry.captureMessage(message, {
Expand All @@ -53,5 +55,5 @@ export const captureMessage = (
};

export const wrapWithSentry = (App: React.ComponentType) => {
return SENTRY_DSN ? Sentry.wrap(App) : App;
return isSentryDisabled ? App : Sentry.wrap(App);
};
2 changes: 1 addition & 1 deletion app/src/hooks/useAesopRedesign.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IS_TEST_BUILD } from '@env';

export const shouldShowAesopRedesign = (): boolean => {
return IS_TEST_BUILD === 'true';
return JSON.parse(IS_TEST_BUILD);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix new design trigger

};

export const useAesopRedesign = (): boolean => {
Expand Down
19 changes: 10 additions & 9 deletions app/src/hooks/useAppUpdates.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useNavigation } from '@react-navigation/native';
import { useState } from 'react';
import { useEffect, useState } from 'react';
import { Linking } from 'react-native';
import { checkVersion } from 'react-native-check-version';

Expand All @@ -8,11 +8,13 @@ export const useAppUpdates = (): [boolean, () => void, boolean] => {
const [newVersionUrl, setNewVersionUrl] = useState<string | null>(null);
const [isModalDismissed, setIsModalDismissed] = useState(false);

checkVersion().then(version => {
if (version.needsUpdate) {
setNewVersionUrl(version.url);
}
});
useEffect(() => {
checkVersion().then(version => {
if (version.needsUpdate) {
setNewVersionUrl(version.url);
}
});
}, []);

const showAppUpdateModal = () => {
navigation.navigate('Modal', {
Expand All @@ -22,9 +24,8 @@ export const useAppUpdates = (): [boolean, () => void, boolean] => {
buttonText: 'Update and restart',
onButtonPress: async () => {
if (newVersionUrl !== null) {
await Linking.openURL(
newVersionUrl, // TODO or use: `Platform.OS === 'ios' ? appStoreUrl : playStoreUrl`
);
// TODO or use: `Platform.OS === 'ios' ? appStoreUrl : playStoreUrl`
await Linking.openURL(newVersionUrl);
}
},
onModalDismiss: () => {
Expand Down
10 changes: 5 additions & 5 deletions app/src/hooks/useConnectionModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { useNetInfo } from '@react-native-community/netinfo';
import { useEffect } from 'react';
import { Linking, Platform } from 'react-native';

import { useModal } from '../hooks/useModal';
import { navigationRef } from '../Navigation';
import { useModal } from './useModal';

const connectionModalParams = {
titleText: 'Internet connection error',
Expand All @@ -21,20 +21,20 @@ const connectionModalParams = {
} as const;

export default function useConnectionModal() {
const { isInternetReachable } = useNetInfo();
const { isConnected } = useNetInfo();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isInternetReachable started flaking in the simulator. isConnected seemed more reliable

const { showModal, dismissModal, visible } = useModal(connectionModalParams);

useEffect(() => {
if (!navigationRef.isReady()) {
return;
}

if (isInternetReachable === false && !visible) {
if (isConnected === false && !visible) {
showModal();
} else if (visible && isInternetReachable !== false) {
} else if (visible && isConnected !== false) {
dismissModal();
}
}, [isInternetReachable, dismissModal, visible, navigationRef.isReady()]);
}, [isConnected, dismissModal, visible, navigationRef.isReady()]);

return {
visible,
Expand Down
32 changes: 30 additions & 2 deletions app/src/layouts/ExpandableBottomLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
import React from 'react';
import { StatusBar, StyleSheet } from 'react-native';
import {
Dimensions,
PixelRatio,
ScrollView,
StatusBar,
StyleSheet,
} from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { View, ViewProps } from 'tamagui';

import { black, white } from '../utils/colors';

// Get the current font scale factor
const fontScale = PixelRatio.getFontScale();
// fontScale > 1 means the user has increased text size in accessibility settings
const isLargerTextEnabled = fontScale > 1;

interface ExpandableBottomLayoutProps extends ViewProps {
children: React.ReactNode;
backgroundColor: string;
Expand Down Expand Up @@ -90,12 +101,29 @@ const BottomSection: React.FC<BottomSectionProps> = ({
const { bottom: safeAreaBottom } = useSafeAreaInsets();
const incomingBottom = props.paddingBottom ?? props.pb ?? 0;
const minBottom = Math.max(safeAreaBottom, 10);

const totalBottom =
typeof incomingBottom === 'number' ? minBottom + incomingBottom : minBottom;

let panelHeight: number | 'auto' = 'auto';
// set bottom section height to 38% of screen height
// and wrap children in a scroll view if larger text is enabled
if (isLargerTextEnabled) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is phone has large text enabled, set the bottom panel height and wrap the children within a ScrollView

const windowHeight = Dimensions.get('window').height;
panelHeight = windowHeight * 0.38;
children = (
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{ flexGrow: 1 }}
>
{children}
</ScrollView>
);
}

return (
<View
{...props}
height={panelHeight}
style={[styles.bottomSection, style]}
paddingBottom={totalBottom}
>
Expand Down
5 changes: 3 additions & 2 deletions app/src/screens/Settings/ModalScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ interface ModalScreenProps extends StaticScreenProps<ModalParams> {}

const ModalScreen: React.FC<ModalScreenProps> = ({ route: { params } }) => {
const navigation = useNavigation();

const onButtonPressed = useCallback(async () => {
confirmTap();
try {
Expand All @@ -43,13 +44,13 @@ const ModalScreen: React.FC<ModalScreenProps> = ({ route: { params } }) => {
} catch (error) {
console.error(error);
}
}, []);
}, [params?.onButtonPress]);

const onClose = useCallback(() => {
impactLight();
navigation.goBack();
params?.onModalDismiss();
}, [params]);
}, [params?.onModalDismiss]);

return (
<ModalBackDrop>
Expand Down