Skip to content

Commit dca27d9

Browse files
committed
fix android screen size
1 parent a2270db commit dca27d9

6 files changed

Lines changed: 3445 additions & 2204 deletions

File tree

App.tsx

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const uri =
2121
// Add <TourGuideProvider/> at the root of you app!
2222
function App() {
2323
return (
24-
<TourGuideProvider {...{ borderRadius: 16 }}>
24+
<TourGuideProvider {...{ borderRadius: 16, androidStatusBarVisible: true }}>
2525
<AppContent />
2626
</TourGuideProvider>
2727
)
@@ -85,7 +85,7 @@ const AppContent = () => {
8585
</View>
8686
<View style={styles.row}>
8787
<TourGuideZone zone={4} shape={'circle'} tooltipBottomOffset={200}>
88-
<Ionicons name='ios-contact' {...iconProps} />
88+
<Ionicons name='ios-add-circle' {...iconProps} />
8989
</TourGuideZone>
9090
<Ionicons name='ios-chatbubbles' {...iconProps} />
9191
<Ionicons name='ios-globe' {...iconProps} />
@@ -96,19 +96,27 @@ const AppContent = () => {
9696
<Ionicons name='ios-rainy' {...iconProps} />
9797
</TourGuideZone>
9898
</View>
99+
<View
100+
style={[
101+
StyleSheet.absoluteFillObject,
102+
{
103+
top: 250,
104+
left: 50,
105+
width: 64,
106+
height: 64,
107+
backgroundColor: 'red',
108+
},
109+
]}
110+
/>
99111
{Platform.OS !== 'web' ? (
100112
<TourGuideZoneByPosition
101113
zone={1}
102-
shape={'rectangle_and_keep'}
114+
shape={'circle'}
103115
isTourGuide
104-
top={191}
105-
left={88}
116+
top={250}
117+
left={50}
106118
width={64}
107119
height={64}
108-
borderRadiusObject={{
109-
topLeft: 0,
110-
bottomRight: 0,
111-
}}
112120
/>
113121
) : null}
114122
</View>

src/components/AnimatedPath.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
import * as React from 'react'
2-
import { Animated, Platform } from 'react-native'
3-
import { Path, PathProps } from 'react-native-svg'
1+
import { Animated } from 'react-native'
2+
import { Path } from 'react-native-svg'
43

5-
export const AnimatedSvgPath: React.ComponentType<
6-
PathProps & { ref: any }
7-
> = Platform.select({
8-
default: Animated.createAnimatedComponent(Path),
9-
web: Path,
10-
})
4+
export const AnimatedSvgPath = Animated.createAnimatedComponent(Path)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { Path } from 'react-native-svg'
2+
3+
export const AnimatedSvgPath = Path

src/components/SvgMask.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export class SvgMask extends Component<Props, State> {
4747
size: { x: 0, y: 0 },
4848
position: { x: 0, y: 0 },
4949
maskOffset: 0,
50-
isHorizontal: false,
5150
}
5251

5352
listenerID: string
@@ -60,7 +59,10 @@ export class SvgMask extends Component<Props, State> {
6059
constructor(props: Props) {
6160
super(props)
6261

63-
this.windowDimensions = Dimensions.get('window')
62+
this.windowDimensions = Platform.select({
63+
android: Dimensions.get('screen'),
64+
default: Dimensions.get('window'),
65+
})
6466

6567
this.firstPath = `M0,0H${this.windowDimensions.width}V${
6668
this.windowDimensions.height

tsconfig.json

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"include": ["src"],
2+
"include": [
3+
"src"
4+
],
35
"compilerOptions": {
46
"declaration": true,
57
"outDir": "./lib",
@@ -28,8 +30,19 @@
2830
"resolveJsonModule": true,
2931
"noFallthroughCasesInSwitch": true,
3032
"strictPropertyInitialization": false,
31-
"lib": ["dom", "esnext"],
32-
"typeRoots": ["./node_modules/@types", "./@types"]
33+
"lib": [
34+
"dom",
35+
"esnext"
36+
],
37+
"typeRoots": [
38+
"./node_modules/@types",
39+
"./@types"
40+
]
3341
},
34-
"exclude": ["node_modules", "src/**/*.test.ts", "src/**/*.test.tsx"]
42+
"exclude": [
43+
"node_modules",
44+
"src/**/*.test.ts",
45+
"src/**/*.test.tsx"
46+
],
47+
"extends": "expo/tsconfig.base"
3548
}

0 commit comments

Comments
 (0)