forked from mevlanBatusha/react-native-material-showcase-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ios.js
61 lines (47 loc) · 1.21 KB
/
index.ios.js
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
import { findNodeHandle, NativeModules } from "react-native";
const { RNMaterialShowcase } = NativeModules;
class AppTour {
static ShowSequence(sequence) {
let appTourTargets = sequence.getAll();
let viewIds = [];
let props = {};
appTourTargets &&
appTourTargets.forEach((appTourTarget, key, appTourTargets) => {
viewIds.push(appTourTarget.view);
props[key] = appTourTarget.props;
});
RNMaterialShowcase.ShowSequence(viewIds, props);
}
static ShowFor(appTourTarget) {
RNMaterialShowcase.ShowFor(appTourTarget.view, appTourTarget.props);
}
}
class AppTourSequence {
constructor() {
this.appTourTargets = new Map();
}
add(appTourTarget) {
this.appTourTargets.set(appTourTarget.view, appTourTarget);
}
remove(appTourTarget) {
this.appTourTargets.delete(appTourTarget.view);
}
removeAll() {
this.appTourTargets = new Map();
}
get(appTourTarget) {
return this.appTourTargets.get(appTourTarget);
}
getAll() {
return this.appTourTargets;
}
}
class AppTourView {
static for(view, props) {
return {
view: findNodeHandle(view),
props: props
};
}
}
export { AppTourView, AppTourSequence, AppTour };