Skip to content

Commit

Permalink
Merge pull request #473 from wyne/android-activity-permission
Browse files Browse the repository at this point in the history
Fix android bugs
  • Loading branch information
wyne authored Jul 24, 2024
2 parents 6c5f5dd + c5314c6 commit 9c8602c
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 23 deletions.
1 change: 1 addition & 0 deletions app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export default {
},
package: packageName,
permissions: [],
blockedPermissions: ['android.permission.ACTIVITY_RECOGNITION'],
versionCode: 80,
googleServicesFile: './google-services.json',
},
Expand Down
6 changes: 6 additions & 0 deletions eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"ios": {
"resourceClass": "m-medium"
},
"android": {
"buildType": "apk"
},
"env": {
"APP_VARIANT": "development",
"EXPO_PUBLIC_FIREBASE_ANALYTICS": "false"
Expand All @@ -34,6 +37,9 @@
"ios": {
"resourceClass": "m-medium"
},
"android": {
"buildType": "apk"
},
"channel": "preview",
"env": {
"APP_VARIANT": "preview",
Expand Down
8 changes: 3 additions & 5 deletions src/components/GameListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,12 @@ const GameListItem: React.FunctionComponent<Props> = ({ navigation, gameId, inde
index={index}
>
<ListItem key={gameId} bottomDivider
onLongPress={() => {
onLongPress={Platform.OS == 'android' ? undefined : () => {
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy);
logEvent('list_menu_open');
}}
onPress={
// Only select game if iOS because Android is handled by PopupMenu
Platform.OS == 'ios' ? chooseGameHandler : undefined
}>
onPress={Platform.OS == 'android' ? undefined : chooseGameHandler}
>
<ListItem.Content>
<ListItem.Title style={{ alignItems: 'center' }}>
{gameTitle}
Expand Down
44 changes: 29 additions & 15 deletions src/components/Headers/AppInfoHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React from 'react';

import { ParamListBase } from '@react-navigation/native';
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
import { Text, View } from 'react-native';
import { Platform, StyleSheet, Text, View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';

import { systemBlue } from '../../constants';
import HeaderButton from '../Buttons/HeaderButton';
Expand All @@ -14,22 +15,35 @@ interface Props {

const AppInfoHeader: React.FunctionComponent<Props> = ({ navigation }: Props) => {

const Wrapper = Platform.OS == 'ios' ? View : SafeAreaView;

return (
<View style={{
justifyContent: 'flex-end',
alignItems: 'center',
flexDirection: 'row',
backgroundColor: '#F2F2F7',
}}>
<HeaderButton
accessibilityLabel='Save Game'
onPress={async () => {
navigation.goBack();
}}>
<Text style={{ color: systemBlue, fontSize: 20 }}>Done</Text>
</HeaderButton>
</View>
<Wrapper style={Platform.OS == 'ios' ? undefined : styles.headerContainer} >
<View style={{
justifyContent: 'flex-end',
alignItems: 'center',
flexDirection: 'row',
backgroundColor: '#F2F2F7',
}}>
<HeaderButton
accessibilityLabel='Save Game'
onPress={async () => {
navigation.goBack();
}}>
<Text style={{ color: systemBlue, fontSize: 20 }}>Done</Text>
</HeaderButton>
</View>
</Wrapper>
);
};

export default AppInfoHeader;

const styles = StyleSheet.create({
headerContainer: {
backgroundColor: '#F2F2F7',
flexDirection: 'row',
justifyContent: 'flex-end',
textAlign: 'center',
},
});
1 change: 1 addition & 0 deletions src/components/Onboarding/OnboardingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ const styles = StyleSheet.create({
},
finishButton: {
borderColor: 'black',
borderWidth: 1,
borderRadius: 20,
padding: 10,
margin: 15,
Expand Down
2 changes: 2 additions & 0 deletions src/components/Onboarding/SkipButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useEffect } from 'react';

import {
Platform,
StyleSheet,
Text,
TouchableOpacity,
Expand Down Expand Up @@ -51,6 +52,7 @@ export default SkipButton;

const styles = StyleSheet.create({
button: {
marginTop: Platform.OS == 'ios' ? 'auto' : 30,
padding: 10,
margin: 10,
borderRadius: 20,
Expand Down
5 changes: 3 additions & 2 deletions src/components/Rounds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { useCallback, useEffect, useRef, useState } from 'react';

import { ParamListBase } from '@react-navigation/native';
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
import { LayoutChangeEvent, Platform, ScrollView, StyleSheet, View } from 'react-native';
import { TouchableOpacity } from 'react-native-gesture-handler';
import { LayoutChangeEvent, Platform, StyleSheet, View } from 'react-native';
import { TouchableOpacity, ScrollView } from 'react-native-gesture-handler';

import { selectGameById, setSortSelector } from '../../redux/GamesSlice';
import { useAppDispatch, useAppSelector } from '../../redux/hooks';
Expand Down Expand Up @@ -83,6 +83,7 @@ const Rounds: React.FunctionComponent<Props> = ({ }) => {
</TouchableOpacity>

<ScrollView horizontal={true}
nestedScrollEnabled={true}
contentContainerStyle={{ flexDirection: 'row' }}
ref={roundsScrollViewEl}>
{roundsIterator.map((item, round) => (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Sheets/GameSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ const GameSheet: React.FunctionComponent<Props> = ({ navigation, containerHeight
animatedPosition={animatedPosition}
enablePanDownToClose={false}
>
<BottomSheetScrollView >
<BottomSheetScrollView>
<SafeAreaView edges={['right', 'left']}>
<View style={styles.sheetHeaderContainer}>
<TouchableWithoutFeedback onPress={() => sheetTitlePress()}>
Expand Down

0 comments on commit 9c8602c

Please sign in to comment.