-
-
Notifications
You must be signed in to change notification settings - Fork 643
Expand file tree
/
Copy pathtest-svm-configures-scroll-view.tsx
More file actions
80 lines (75 loc) · 2.21 KB
/
test-svm-configures-scroll-view.tsx
File metadata and controls
80 lines (75 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import React from 'react';
import type { ScenarioDescription } from '@apps/tests/shared/helpers';
import { createScenario } from '@apps/tests/shared/helpers';
import { ScrollView, StyleSheet, Text, View } from 'react-native';
import { ScrollViewMarker } from 'react-native-screens/experimental';
import { StackContainer } from '@apps/shared/gamma/containers/stack';
import { Rectangle } from '@apps/shared/Rectangle';
import { Colors } from '@apps/shared/styling';
import { generateNextColor } from '@apps/shared/utils/color-generator';
const scenarioDescription: ScenarioDescription = {
name: 'Basic functionality',
key: 'test-svm-configures-scroll-view',
details:
'Allows to test the basic functionality of ScrollViewMarker component. ' +
'It utilizes the StackContainer, to allow for observation of edge effects ' +
'applied to the container edges. On Android this test serves only as a setup ' +
'for native debugging.',
platforms: ['ios', 'android'],
};
export function App() {
return (
<StackContainer
routeConfigs={[
{
name: 'Content',
Component: ContentScreen,
options: {},
},
]}
/>
);
}
export function ContentScreen() {
return (
<View
style={[
styles.container,
styles.fillParent,
{ backgroundColor: Colors.White },
]}>
<Text>Interrupt "first descendant chain" heuristic</Text>
<ScrollViewMarker
style={[styles.fillParent]}
scrollEdgeEffects={{ top: 'hard' }}>
<ScrollView
style={[styles.fillParent]}
contentInsetAdjustmentBehavior="automatic">
{Array.from({ length: 12 }).map((_, index) => {
return (
<Rectangle
key={index}
color={generateNextColor()}
width={'100%'}
height={96}
/>
);
})}
</ScrollView>
</ScrollViewMarker>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
fillParent: {
flex: 1,
width: '100%',
height: '100%',
},
});
export default createScenario(App, scenarioDescription);