Skip to content

Commit

Permalink
fix: add iPad and iOS simulator support (openwallet-foundation#885)
Browse files Browse the repository at this point in the history
Signed-off-by: Jason C. Leach <[email protected]>
  • Loading branch information
jleach authored Jul 13, 2023
1 parent c45fe23 commit 1c56070
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 21 deletions.
12 changes: 12 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
comment:
layout: "header"
behavior: "default"
max_warnings: 0
# coverage:
# precision: 2
# round: down
# range: "70...100"
# status:
# project:
# default:
# new_uncovered: 80
24 changes: 12 additions & 12 deletions packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
};
};
};
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ariesbifold" */;
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "AriesBifold" */;
compatibilityVersion = "Xcode 12.0";
developmentRegion = en;
hasScannedForEncodings = 0;
Expand Down Expand Up @@ -520,10 +520,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = G9667JTP83;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Pods/Frameworks",
);
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = AriesBifold/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -540,8 +537,12 @@
);
PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.example.AriesBifold;
PRODUCT_NAME = AriesBifold;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
Expand All @@ -555,10 +556,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = G9667JTP83;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Pods/Frameworks",
);
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = AriesBifold/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -575,7 +573,11 @@
);
PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.example.AriesBifold;
PRODUCT_NAME = AriesBifold;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
Expand Down Expand Up @@ -636,7 +638,6 @@
);
LIBRARY_SEARCH_PATHS = (
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
"\"$(inherited)\"",
);
MTL_ENABLE_DEBUG_INFO = YES;
Expand Down Expand Up @@ -694,7 +695,6 @@
);
LIBRARY_SEARCH_PATHS = (
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
"\"$(inherited)\"",
);
MTL_ENABLE_DEBUG_INFO = NO;
Expand Down Expand Up @@ -724,7 +724,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ariesbifold" */ = {
83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "AriesBifold" */ = {
isa = XCConfigurationList;
buildConfigurations = (
83CBBA201A601CBA00E9B192 /* Debug */,
Expand Down
11 changes: 9 additions & 2 deletions packages/legacy/core/App/navigators/TabStack.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { Text, useWindowDimensions, View } from 'react-native'
import { Text, useWindowDimensions, View, StyleSheet } from 'react-native'
import { SafeAreaView } from 'react-native-safe-area-context'
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'

Expand All @@ -23,8 +23,12 @@ const TabStack: React.FC = () => {
const { assertConnectedNetwork } = useNetwork()
const { ColorPallet, TabTheme } = useTheme()
const { fontScale } = useWindowDimensions()

const showLabels = fontScale * TabTheme.tabBarTextStyle.fontSize < 18
const styles = StyleSheet.create({
tabBarIcon: {
flex: 1,
},
})

return (
<SafeAreaView style={{ flex: 1, backgroundColor: ColorPallet.brand.primary }}>
Expand All @@ -43,6 +47,7 @@ const TabStack: React.FC = () => {
name={TabStacks.HomeStack}
component={HomeStack}
options={{
tabBarIconStyle: styles.tabBarIcon,
tabBarIcon: ({ color, focused }) => (
<View style={{ ...TabTheme.tabBarContainerStyle, justifyContent: showLabels ? 'flex-end' : 'center' }}>
<Icon name={focused ? 'home' : 'home-outline'} color={color} size={30} />
Expand Down Expand Up @@ -70,6 +75,7 @@ const TabStack: React.FC = () => {
<Tab.Screen
name={TabStacks.ConnectStack}
options={{
tabBarIconStyle: styles.tabBarIcon,
tabBarIcon: ({ focused }) => (
<View
style={{
Expand Down Expand Up @@ -138,6 +144,7 @@ const TabStack: React.FC = () => {
name={TabStacks.CredentialStack}
component={CredentialStack}
options={{
tabBarIconStyle: styles.tabBarIcon,
tabBarIcon: ({ color, focused }) => (
<AttachTourStep index={2}>
<View style={{ ...TabTheme.tabBarContainerStyle, justifyContent: showLabels ? 'flex-end' : 'center' }}>
Expand Down
8 changes: 4 additions & 4 deletions packages/legacy/core/App/screens/ProofRequesting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ import { testIdWithKey } from '../utils/testable'

type ProofRequestingProps = StackScreenProps<ProofRequestsStackParams, Screens.ProofRequesting>

const windowDimensions = Dimensions.get('window')

const qrContainerSize = windowDimensions.width - 20
const { width, height } = Dimensions.get('window')
const aspectRatio = height / width
const isTablet = aspectRatio < 1.6 // assume 4:3 for tablets
const qrContainerSize = isTablet ? width - width * 0.3 : width - 20
const qrSize = qrContainerSize - 20

const ProofRequesting: React.FC<ProofRequestingProps> = ({ route, navigation }) => {
Expand Down Expand Up @@ -95,7 +96,6 @@ const ProofRequesting: React.FC<ProofRequestingProps> = ({ route, navigation })
color: ColorPallet.brand.primary,
},
qrContainer: {
width: qrContainerSize,
height: qrContainerSize,
alignItems: 'center',
justifyContent: 'center',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ exports[`ProofRequesting Component generate new qr works correctly 1`] = `
"justifyContent": "center",
"marginHorizontal": 10,
"marginTop": 15,
"width": 730,
}
}
>
Expand Down Expand Up @@ -219,7 +218,6 @@ exports[`ProofRequesting Component renders correctly 1`] = `
"justifyContent": "center",
"marginHorizontal": 10,
"marginTop": 15,
"width": 730,
}
}
>
Expand Down Expand Up @@ -413,7 +411,6 @@ exports[`ProofRequesting Component renders correctly 2`] = `
"justifyContent": "center",
"marginHorizontal": 10,
"marginTop": 15,
"width": 730,
}
}
/>
Expand Down

0 comments on commit 1c56070

Please sign in to comment.