react-native-tvos 0.64.2-4 → 0.64.2-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
- package/README.md +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/ReactAndroidHWInputDeviceHelper.java +30 -2
- package/ReactCommon/react/renderer/components/rncore/ComponentDescriptors.h +32 -0
- package/ReactCommon/react/renderer/components/rncore/ComponentDescriptors.h.bak +32 -0
- package/ReactCommon/react/renderer/components/rncore/EventEmitters.cpp +149 -0
- package/ReactCommon/react/renderer/components/rncore/EventEmitters.cpp.bak +149 -0
- package/ReactCommon/react/renderer/components/rncore/EventEmitters.h +237 -0
- package/ReactCommon/react/renderer/components/rncore/EventEmitters.h.bak +237 -0
- package/ReactCommon/react/renderer/components/rncore/Props.cpp +218 -0
- package/ReactCommon/react/renderer/components/rncore/Props.cpp.bak +218 -0
- package/ReactCommon/react/renderer/components/rncore/Props.h +576 -0
- package/ReactCommon/react/renderer/components/rncore/Props.h.bak +576 -0
- package/ReactCommon/react/renderer/components/rncore/RCTComponentViewHelpers.h +273 -0
- package/ReactCommon/react/renderer/components/rncore/RCTComponentViewHelpers.h.bak +273 -0
- package/ReactCommon/react/renderer/components/rncore/ShadowNodes.cpp +29 -0
- package/ReactCommon/react/renderer/components/rncore/ShadowNodes.cpp.bak +29 -0
- package/ReactCommon/react/renderer/components/rncore/ShadowNodes.h +126 -0
- package/ReactCommon/react/renderer/components/rncore/ShadowNodes.h.bak +126 -0
- package/android/com/facebook/react/react-native/{0.64.2-4/react-native-0.64.2-4-sources.jar → 0.64.2-5/react-native-0.64.2-5-sources.jar} +0 -0
- package/android/com/facebook/react/react-native/0.64.2-5/react-native-0.64.2-5-sources.jar.md5 +1 -0
- package/android/com/facebook/react/react-native/0.64.2-5/react-native-0.64.2-5-sources.jar.sha1 +1 -0
- package/android/com/facebook/react/react-native/0.64.2-5/react-native-0.64.2-5.aar +0 -0
- package/android/com/facebook/react/react-native/0.64.2-5/react-native-0.64.2-5.aar.md5 +1 -0
- package/android/com/facebook/react/react-native/0.64.2-5/react-native-0.64.2-5.aar.sha1 +1 -0
- package/android/com/facebook/react/react-native/{0.64.2-4/react-native-0.64.2-4.pom → 0.64.2-5/react-native-0.64.2-5.pom} +1 -1
- package/android/com/facebook/react/react-native/0.64.2-5/react-native-0.64.2-5.pom.md5 +1 -0
- package/android/com/facebook/react/react-native/0.64.2-5/react-native-0.64.2-5.pom.sha1 +1 -0
- package/android/com/facebook/react/react-native/maven-metadata.xml +3 -3
- package/android/com/facebook/react/react-native/maven-metadata.xml.md5 +1 -1
- package/android/com/facebook/react/react-native/maven-metadata.xml.sha1 +1 -1
- package/local-cli/cli.js +0 -0
- package/package.json +1 -1
- package/template/ios/HelloWorld.xcodeproj/project.pbxproj.rej +1034 -0
- package/template/package.json +1 -1
- package/Libraries/.npmignore +0 -1
- package/Libraries/Components/AppleTV/TVFocusGuideView.js.orig +0 -61
- package/ReactAndroid/.npmignore +0 -3
- package/ReactAndroid/src/main/jni/first-party/fbjni/.gitignore +0 -2
- package/ReactCommon/hermes/inspector/tools/msggen/.gitignore +0 -3
- package/android/com/facebook/react/react-native/0.64.2-4/react-native-0.64.2-4-sources.jar.md5 +0 -1
- package/android/com/facebook/react/react-native/0.64.2-4/react-native-0.64.2-4-sources.jar.sha1 +0 -1
- package/android/com/facebook/react/react-native/0.64.2-4/react-native-0.64.2-4.aar +0 -0
- package/android/com/facebook/react/react-native/0.64.2-4/react-native-0.64.2-4.aar.md5 +0 -1
- package/android/com/facebook/react/react-native/0.64.2-4/react-native-0.64.2-4.aar.sha1 +0 -1
- package/android/com/facebook/react/react-native/0.64.2-4/react-native-0.64.2-4.pom.md5 +0 -1
- package/android/com/facebook/react/react-native/0.64.2-4/react-native-0.64.2-4.pom.sha1 +0 -1
- package/third-party-podspecs/hermes-engine.podspec +0 -45
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Going forward, Apple TV support for React Native will be maintained here and in the corresponding `react-native-tvos` NPM package, and not in the [core repo](https://github.com/facebook/react-native/). This is a full fork of the main repository, with only the changes needed to support Apple TV.
|
|
4
4
|
|
|
5
|
-
Releases of `react-native-tvos` will be based on a public release of `react-native`; e.g. the 0.64.2-
|
|
5
|
+
Releases of `react-native-tvos` will be based on a public release of `react-native`; e.g. the 0.64.2-5 release of this package will be derived from the 0.64.2 release of `react-native`. All releases of this repo will follow the 0.xx.x-y format, where x digits are from a specific RN core release, and y represents the additional versioning from this repo.
|
|
6
6
|
|
|
7
7
|
Releases will be published on npmjs.org and you may find the latest release version here: https://www.npmjs.com/package/react-native-tvos?activeTab=versions or use the tag `@latest`
|
|
8
8
|
|
|
@@ -14,6 +14,7 @@ import com.facebook.react.bridge.ReactContext;
|
|
|
14
14
|
import com.facebook.react.bridge.WritableMap;
|
|
15
15
|
import com.facebook.react.bridge.WritableNativeMap;
|
|
16
16
|
import com.facebook.react.common.MapBuilder;
|
|
17
|
+
import com.facebook.react.common.SystemClock;
|
|
17
18
|
|
|
18
19
|
import java.util.Map;
|
|
19
20
|
|
|
@@ -28,6 +29,8 @@ public class ReactAndroidHWInputDeviceHelper {
|
|
|
28
29
|
MapBuilder.<Integer, String>builder()
|
|
29
30
|
.put(KeyEvent.KEYCODE_DPAD_CENTER, "select")
|
|
30
31
|
.put(KeyEvent.KEYCODE_ENTER, "select")
|
|
32
|
+
.put(KeyEvent.KEYCODE_NUMPAD_ENTER, "select")
|
|
33
|
+
.put(KeyEvent.KEYCODE_BUTTON_SELECT, "select")
|
|
31
34
|
.put(KeyEvent.KEYCODE_SPACE, "select")
|
|
32
35
|
.put(KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE, "playPause")
|
|
33
36
|
.put(KeyEvent.KEYCODE_MEDIA_PLAY, "play")
|
|
@@ -48,15 +51,40 @@ public class ReactAndroidHWInputDeviceHelper {
|
|
|
48
51
|
*/
|
|
49
52
|
private int mLastFocusedViewId = View.NO_ID;
|
|
50
53
|
|
|
54
|
+
private long mLastKeyDownTime = 0;
|
|
55
|
+
private long mPressedDelta = 1000;
|
|
56
|
+
|
|
51
57
|
public ReactAndroidHWInputDeviceHelper() {}
|
|
52
58
|
|
|
59
|
+
private boolean isSelectEvent(int eventKeyCode) {
|
|
60
|
+
return eventKeyCode == KeyEvent.KEYCODE_DPAD_CENTER ||
|
|
61
|
+
eventKeyCode == KeyEvent.KEYCODE_BUTTON_SELECT ||
|
|
62
|
+
eventKeyCode == KeyEvent.KEYCODE_NUMPAD_ENTER ||
|
|
63
|
+
eventKeyCode == KeyEvent.KEYCODE_ENTER;
|
|
64
|
+
}
|
|
65
|
+
|
|
53
66
|
/** Called from {@link com.facebook.react.ReactRootView}. This is the main place the key events are handled. */
|
|
54
67
|
public void handleKeyEvent(KeyEvent ev, ReactContext context) {
|
|
55
68
|
int eventKeyCode = ev.getKeyCode();
|
|
56
69
|
int eventKeyAction = ev.getAction();
|
|
57
|
-
|
|
70
|
+
long time = SystemClock.uptimeMillis();
|
|
71
|
+
|
|
72
|
+
// Simple implementation of long press detection
|
|
73
|
+
if ((eventKeyAction == KeyEvent.ACTION_DOWN)
|
|
74
|
+
&& isSelectEvent(eventKeyCode) && mLastKeyDownTime == 0) {
|
|
75
|
+
mLastKeyDownTime = time;
|
|
76
|
+
}
|
|
77
|
+
// We only need the up event for Android TV
|
|
78
|
+
// if ((eventKeyAction == KeyEvent.ACTION_UP || eventKeyAction == KeyEvent.ACTION_DOWN)
|
|
79
|
+
if ((eventKeyAction == KeyEvent.ACTION_UP)
|
|
58
80
|
&& KEY_EVENTS_ACTIONS.containsKey(eventKeyCode)) {
|
|
59
|
-
|
|
81
|
+
long delta = time - mLastKeyDownTime;
|
|
82
|
+
if (isSelectEvent(eventKeyCode) && (delta > mPressedDelta)) {
|
|
83
|
+
dispatchEvent("longSelect", mLastFocusedViewId, eventKeyAction, context);
|
|
84
|
+
} else {
|
|
85
|
+
dispatchEvent(KEY_EVENTS_ACTIONS.get(eventKeyCode), mLastFocusedViewId, eventKeyAction, context);
|
|
86
|
+
}
|
|
87
|
+
mLastKeyDownTime = 0;
|
|
60
88
|
}
|
|
61
89
|
}
|
|
62
90
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateComponentDescriptorH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include <react/renderer/components/rncore/ShadowNodes.h>
|
|
14
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
+
|
|
16
|
+
namespace facebook {
|
|
17
|
+
namespace react {
|
|
18
|
+
|
|
19
|
+
using ActivityIndicatorViewComponentDescriptor = ConcreteComponentDescriptor<ActivityIndicatorViewShadowNode>;
|
|
20
|
+
using DatePickerComponentDescriptor = ConcreteComponentDescriptor<DatePickerShadowNode>;
|
|
21
|
+
using AndroidDrawerLayoutComponentDescriptor = ConcreteComponentDescriptor<AndroidDrawerLayoutShadowNode>;
|
|
22
|
+
using RCTMaskedViewComponentDescriptor = ConcreteComponentDescriptor<RCTMaskedViewShadowNode>;
|
|
23
|
+
using RCTProgressViewComponentDescriptor = ConcreteComponentDescriptor<RCTProgressViewShadowNode>;
|
|
24
|
+
using AndroidSwipeRefreshLayoutComponentDescriptor = ConcreteComponentDescriptor<AndroidSwipeRefreshLayoutShadowNode>;
|
|
25
|
+
using PullToRefreshViewComponentDescriptor = ConcreteComponentDescriptor<PullToRefreshViewShadowNode>;
|
|
26
|
+
using AndroidHorizontalScrollContentViewComponentDescriptor = ConcreteComponentDescriptor<AndroidHorizontalScrollContentViewShadowNode>;
|
|
27
|
+
using RCTSegmentedControlComponentDescriptor = ConcreteComponentDescriptor<RCTSegmentedControlShadowNode>;
|
|
28
|
+
using SwitchComponentDescriptor = ConcreteComponentDescriptor<SwitchShadowNode>;
|
|
29
|
+
using UnimplementedNativeViewComponentDescriptor = ConcreteComponentDescriptor<UnimplementedNativeViewShadowNode>;
|
|
30
|
+
|
|
31
|
+
} // namespace react
|
|
32
|
+
} // namespace facebook
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateComponentDescriptorH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include <react/renderer/components/FBReactNativeSpec/ShadowNodes.h>
|
|
14
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
+
|
|
16
|
+
namespace facebook {
|
|
17
|
+
namespace react {
|
|
18
|
+
|
|
19
|
+
using ActivityIndicatorViewComponentDescriptor = ConcreteComponentDescriptor<ActivityIndicatorViewShadowNode>;
|
|
20
|
+
using DatePickerComponentDescriptor = ConcreteComponentDescriptor<DatePickerShadowNode>;
|
|
21
|
+
using AndroidDrawerLayoutComponentDescriptor = ConcreteComponentDescriptor<AndroidDrawerLayoutShadowNode>;
|
|
22
|
+
using RCTMaskedViewComponentDescriptor = ConcreteComponentDescriptor<RCTMaskedViewShadowNode>;
|
|
23
|
+
using RCTProgressViewComponentDescriptor = ConcreteComponentDescriptor<RCTProgressViewShadowNode>;
|
|
24
|
+
using AndroidSwipeRefreshLayoutComponentDescriptor = ConcreteComponentDescriptor<AndroidSwipeRefreshLayoutShadowNode>;
|
|
25
|
+
using PullToRefreshViewComponentDescriptor = ConcreteComponentDescriptor<PullToRefreshViewShadowNode>;
|
|
26
|
+
using AndroidHorizontalScrollContentViewComponentDescriptor = ConcreteComponentDescriptor<AndroidHorizontalScrollContentViewShadowNode>;
|
|
27
|
+
using RCTSegmentedControlComponentDescriptor = ConcreteComponentDescriptor<RCTSegmentedControlShadowNode>;
|
|
28
|
+
using SwitchComponentDescriptor = ConcreteComponentDescriptor<SwitchShadowNode>;
|
|
29
|
+
using UnimplementedNativeViewComponentDescriptor = ConcreteComponentDescriptor<UnimplementedNativeViewShadowNode>;
|
|
30
|
+
|
|
31
|
+
} // namespace react
|
|
32
|
+
} // namespace facebook
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateEventEmitterCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/rncore/EventEmitters.h>
|
|
12
|
+
|
|
13
|
+
namespace facebook {
|
|
14
|
+
namespace react {
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
void DatePickerEventEmitter::onChange(OnChange event) const {
|
|
18
|
+
dispatchEvent("change", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
19
|
+
auto payload = jsi::Object(runtime);
|
|
20
|
+
payload.setProperty(runtime, "timestamp", event.timestamp);
|
|
21
|
+
return payload;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
void AndroidDrawerLayoutEventEmitter::onDrawerSlide(OnDrawerSlide event) const {
|
|
25
|
+
dispatchEvent("drawerSlide", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
26
|
+
auto payload = jsi::Object(runtime);
|
|
27
|
+
payload.setProperty(runtime, "offset", event.offset);
|
|
28
|
+
return payload;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
void AndroidDrawerLayoutEventEmitter::onDrawerStateChanged(OnDrawerStateChanged event) const {
|
|
32
|
+
dispatchEvent("drawerStateChanged", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
33
|
+
auto payload = jsi::Object(runtime);
|
|
34
|
+
payload.setProperty(runtime, "drawerState", event.drawerState);
|
|
35
|
+
return payload;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
void AndroidDrawerLayoutEventEmitter::onDrawerOpen(OnDrawerOpen event) const {
|
|
39
|
+
dispatchEvent("drawerOpen", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
40
|
+
auto payload = jsi::Object(runtime);
|
|
41
|
+
|
|
42
|
+
return payload;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
void AndroidDrawerLayoutEventEmitter::onDrawerClose(OnDrawerClose event) const {
|
|
46
|
+
dispatchEvent("drawerClose", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
47
|
+
auto payload = jsi::Object(runtime);
|
|
48
|
+
|
|
49
|
+
return payload;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
void AndroidSwipeRefreshLayoutEventEmitter::onRefresh(OnRefresh event) const {
|
|
56
|
+
dispatchEvent("refresh", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
57
|
+
auto payload = jsi::Object(runtime);
|
|
58
|
+
|
|
59
|
+
return payload;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
void PullToRefreshViewEventEmitter::onRefresh(OnRefresh event) const {
|
|
63
|
+
dispatchEvent("refresh", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
64
|
+
auto payload = jsi::Object(runtime);
|
|
65
|
+
|
|
66
|
+
return payload;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
void RCTSegmentedControlEventEmitter::onChange(OnChange event) const {
|
|
72
|
+
dispatchEvent("change", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
73
|
+
auto payload = jsi::Object(runtime);
|
|
74
|
+
payload.setProperty(runtime, "value", event.value);
|
|
75
|
+
payload.setProperty(runtime, "selectedSegmentIndex", event.selectedSegmentIndex);
|
|
76
|
+
return payload;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
void SliderEventEmitter::onChange(OnChange event) const {
|
|
80
|
+
dispatchEvent("change", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
81
|
+
auto payload = jsi::Object(runtime);
|
|
82
|
+
payload.setProperty(runtime, "value", event.value);
|
|
83
|
+
payload.setProperty(runtime, "fromUser", event.fromUser);
|
|
84
|
+
return payload;
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
void SliderEventEmitter::onValueChange(OnValueChange event) const {
|
|
88
|
+
dispatchEvent("valueChange", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
89
|
+
auto payload = jsi::Object(runtime);
|
|
90
|
+
payload.setProperty(runtime, "value", event.value);
|
|
91
|
+
payload.setProperty(runtime, "fromUser", event.fromUser);
|
|
92
|
+
return payload;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
void SliderEventEmitter::onSlidingComplete(OnSlidingComplete event) const {
|
|
96
|
+
dispatchEvent("slidingComplete", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
97
|
+
auto payload = jsi::Object(runtime);
|
|
98
|
+
payload.setProperty(runtime, "value", event.value);
|
|
99
|
+
payload.setProperty(runtime, "fromUser", event.fromUser);
|
|
100
|
+
return payload;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
void AndroidSwitchEventEmitter::onChange(OnChange event) const {
|
|
104
|
+
dispatchEvent("change", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
105
|
+
auto payload = jsi::Object(runtime);
|
|
106
|
+
payload.setProperty(runtime, "value", event.value);
|
|
107
|
+
return payload;
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
void SwitchEventEmitter::onChange(OnChange event) const {
|
|
111
|
+
dispatchEvent("change", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
112
|
+
auto payload = jsi::Object(runtime);
|
|
113
|
+
payload.setProperty(runtime, "value", event.value);
|
|
114
|
+
return payload;
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
void ModalHostViewEventEmitter::onRequestClose(OnRequestClose event) const {
|
|
120
|
+
dispatchEvent("requestClose", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
121
|
+
auto payload = jsi::Object(runtime);
|
|
122
|
+
|
|
123
|
+
return payload;
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
void ModalHostViewEventEmitter::onShow(OnShow event) const {
|
|
127
|
+
dispatchEvent("show", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
128
|
+
auto payload = jsi::Object(runtime);
|
|
129
|
+
|
|
130
|
+
return payload;
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
void ModalHostViewEventEmitter::onDismiss(OnDismiss event) const {
|
|
134
|
+
dispatchEvent("dismiss", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
135
|
+
auto payload = jsi::Object(runtime);
|
|
136
|
+
|
|
137
|
+
return payload;
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
void ModalHostViewEventEmitter::onOrientationChange(OnOrientationChange event) const {
|
|
141
|
+
dispatchEvent("orientationChange", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
142
|
+
auto payload = jsi::Object(runtime);
|
|
143
|
+
payload.setProperty(runtime, "orientation", toString(event.orientation));
|
|
144
|
+
return payload;
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
} // namespace react
|
|
149
|
+
} // namespace facebook
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateEventEmitterCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/FBReactNativeSpec/EventEmitters.h>
|
|
12
|
+
|
|
13
|
+
namespace facebook {
|
|
14
|
+
namespace react {
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
void DatePickerEventEmitter::onChange(OnChange event) const {
|
|
18
|
+
dispatchEvent("change", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
19
|
+
auto payload = jsi::Object(runtime);
|
|
20
|
+
payload.setProperty(runtime, "timestamp", event.timestamp);
|
|
21
|
+
return payload;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
void AndroidDrawerLayoutEventEmitter::onDrawerSlide(OnDrawerSlide event) const {
|
|
25
|
+
dispatchEvent("drawerSlide", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
26
|
+
auto payload = jsi::Object(runtime);
|
|
27
|
+
payload.setProperty(runtime, "offset", event.offset);
|
|
28
|
+
return payload;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
void AndroidDrawerLayoutEventEmitter::onDrawerStateChanged(OnDrawerStateChanged event) const {
|
|
32
|
+
dispatchEvent("drawerStateChanged", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
33
|
+
auto payload = jsi::Object(runtime);
|
|
34
|
+
payload.setProperty(runtime, "drawerState", event.drawerState);
|
|
35
|
+
return payload;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
void AndroidDrawerLayoutEventEmitter::onDrawerOpen(OnDrawerOpen event) const {
|
|
39
|
+
dispatchEvent("drawerOpen", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
40
|
+
auto payload = jsi::Object(runtime);
|
|
41
|
+
|
|
42
|
+
return payload;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
void AndroidDrawerLayoutEventEmitter::onDrawerClose(OnDrawerClose event) const {
|
|
46
|
+
dispatchEvent("drawerClose", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
47
|
+
auto payload = jsi::Object(runtime);
|
|
48
|
+
|
|
49
|
+
return payload;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
void AndroidSwipeRefreshLayoutEventEmitter::onRefresh(OnRefresh event) const {
|
|
56
|
+
dispatchEvent("refresh", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
57
|
+
auto payload = jsi::Object(runtime);
|
|
58
|
+
|
|
59
|
+
return payload;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
void PullToRefreshViewEventEmitter::onRefresh(OnRefresh event) const {
|
|
63
|
+
dispatchEvent("refresh", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
64
|
+
auto payload = jsi::Object(runtime);
|
|
65
|
+
|
|
66
|
+
return payload;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
void RCTSegmentedControlEventEmitter::onChange(OnChange event) const {
|
|
72
|
+
dispatchEvent("change", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
73
|
+
auto payload = jsi::Object(runtime);
|
|
74
|
+
payload.setProperty(runtime, "value", event.value);
|
|
75
|
+
payload.setProperty(runtime, "selectedSegmentIndex", event.selectedSegmentIndex);
|
|
76
|
+
return payload;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
void SliderEventEmitter::onChange(OnChange event) const {
|
|
80
|
+
dispatchEvent("change", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
81
|
+
auto payload = jsi::Object(runtime);
|
|
82
|
+
payload.setProperty(runtime, "value", event.value);
|
|
83
|
+
payload.setProperty(runtime, "fromUser", event.fromUser);
|
|
84
|
+
return payload;
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
void SliderEventEmitter::onValueChange(OnValueChange event) const {
|
|
88
|
+
dispatchEvent("valueChange", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
89
|
+
auto payload = jsi::Object(runtime);
|
|
90
|
+
payload.setProperty(runtime, "value", event.value);
|
|
91
|
+
payload.setProperty(runtime, "fromUser", event.fromUser);
|
|
92
|
+
return payload;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
void SliderEventEmitter::onSlidingComplete(OnSlidingComplete event) const {
|
|
96
|
+
dispatchEvent("slidingComplete", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
97
|
+
auto payload = jsi::Object(runtime);
|
|
98
|
+
payload.setProperty(runtime, "value", event.value);
|
|
99
|
+
payload.setProperty(runtime, "fromUser", event.fromUser);
|
|
100
|
+
return payload;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
void AndroidSwitchEventEmitter::onChange(OnChange event) const {
|
|
104
|
+
dispatchEvent("change", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
105
|
+
auto payload = jsi::Object(runtime);
|
|
106
|
+
payload.setProperty(runtime, "value", event.value);
|
|
107
|
+
return payload;
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
void SwitchEventEmitter::onChange(OnChange event) const {
|
|
111
|
+
dispatchEvent("change", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
112
|
+
auto payload = jsi::Object(runtime);
|
|
113
|
+
payload.setProperty(runtime, "value", event.value);
|
|
114
|
+
return payload;
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
void ModalHostViewEventEmitter::onRequestClose(OnRequestClose event) const {
|
|
120
|
+
dispatchEvent("requestClose", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
121
|
+
auto payload = jsi::Object(runtime);
|
|
122
|
+
|
|
123
|
+
return payload;
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
void ModalHostViewEventEmitter::onShow(OnShow event) const {
|
|
127
|
+
dispatchEvent("show", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
128
|
+
auto payload = jsi::Object(runtime);
|
|
129
|
+
|
|
130
|
+
return payload;
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
void ModalHostViewEventEmitter::onDismiss(OnDismiss event) const {
|
|
134
|
+
dispatchEvent("dismiss", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
135
|
+
auto payload = jsi::Object(runtime);
|
|
136
|
+
|
|
137
|
+
return payload;
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
void ModalHostViewEventEmitter::onOrientationChange(OnOrientationChange event) const {
|
|
141
|
+
dispatchEvent("orientationChange", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
142
|
+
auto payload = jsi::Object(runtime);
|
|
143
|
+
payload.setProperty(runtime, "orientation", toString(event.orientation));
|
|
144
|
+
return payload;
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
} // namespace react
|
|
149
|
+
} // namespace facebook
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateEventEmitterH.js
|
|
9
|
+
*/
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
13
|
+
|
|
14
|
+
namespace facebook {
|
|
15
|
+
namespace react {
|
|
16
|
+
|
|
17
|
+
class ActivityIndicatorViewEventEmitter : public ViewEventEmitter {
|
|
18
|
+
public:
|
|
19
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
};
|
|
25
|
+
class DatePickerEventEmitter : public ViewEventEmitter {
|
|
26
|
+
public:
|
|
27
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
28
|
+
|
|
29
|
+
struct OnChange {
|
|
30
|
+
Float timestamp;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
void onChange(OnChange value) const;
|
|
34
|
+
};
|
|
35
|
+
class AndroidDrawerLayoutEventEmitter : public ViewEventEmitter {
|
|
36
|
+
public:
|
|
37
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
38
|
+
|
|
39
|
+
struct OnDrawerSlide {
|
|
40
|
+
Float offset;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
struct OnDrawerStateChanged {
|
|
44
|
+
int drawerState;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
struct OnDrawerOpen {
|
|
48
|
+
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
struct OnDrawerClose {
|
|
52
|
+
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
void onDrawerSlide(OnDrawerSlide value) const;
|
|
56
|
+
|
|
57
|
+
void onDrawerStateChanged(OnDrawerStateChanged value) const;
|
|
58
|
+
|
|
59
|
+
void onDrawerOpen(OnDrawerOpen value) const;
|
|
60
|
+
|
|
61
|
+
void onDrawerClose(OnDrawerClose value) const;
|
|
62
|
+
};
|
|
63
|
+
class RCTMaskedViewEventEmitter : public ViewEventEmitter {
|
|
64
|
+
public:
|
|
65
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
};
|
|
71
|
+
class AndroidProgressBarEventEmitter : public ViewEventEmitter {
|
|
72
|
+
public:
|
|
73
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
};
|
|
79
|
+
class RCTProgressViewEventEmitter : public ViewEventEmitter {
|
|
80
|
+
public:
|
|
81
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
};
|
|
87
|
+
class AndroidSwipeRefreshLayoutEventEmitter : public ViewEventEmitter {
|
|
88
|
+
public:
|
|
89
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
90
|
+
|
|
91
|
+
struct OnRefresh {
|
|
92
|
+
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
void onRefresh(OnRefresh value) const;
|
|
96
|
+
};
|
|
97
|
+
class PullToRefreshViewEventEmitter : public ViewEventEmitter {
|
|
98
|
+
public:
|
|
99
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
100
|
+
|
|
101
|
+
struct OnRefresh {
|
|
102
|
+
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
void onRefresh(OnRefresh value) const;
|
|
106
|
+
};
|
|
107
|
+
class SafeAreaViewEventEmitter : public ViewEventEmitter {
|
|
108
|
+
public:
|
|
109
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
};
|
|
115
|
+
class AndroidHorizontalScrollContentViewEventEmitter : public ViewEventEmitter {
|
|
116
|
+
public:
|
|
117
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
};
|
|
123
|
+
class RCTSegmentedControlEventEmitter : public ViewEventEmitter {
|
|
124
|
+
public:
|
|
125
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
126
|
+
|
|
127
|
+
struct OnChange {
|
|
128
|
+
int value;
|
|
129
|
+
int selectedSegmentIndex;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
void onChange(OnChange value) const;
|
|
133
|
+
};
|
|
134
|
+
class SliderEventEmitter : public ViewEventEmitter {
|
|
135
|
+
public:
|
|
136
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
137
|
+
|
|
138
|
+
struct OnChange {
|
|
139
|
+
double value;
|
|
140
|
+
bool fromUser;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
struct OnValueChange {
|
|
144
|
+
double value;
|
|
145
|
+
bool fromUser;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
struct OnSlidingComplete {
|
|
149
|
+
double value;
|
|
150
|
+
bool fromUser;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
void onChange(OnChange value) const;
|
|
154
|
+
|
|
155
|
+
void onValueChange(OnValueChange value) const;
|
|
156
|
+
|
|
157
|
+
void onSlidingComplete(OnSlidingComplete value) const;
|
|
158
|
+
};
|
|
159
|
+
class AndroidSwitchEventEmitter : public ViewEventEmitter {
|
|
160
|
+
public:
|
|
161
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
162
|
+
|
|
163
|
+
struct OnChange {
|
|
164
|
+
bool value;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
void onChange(OnChange value) const;
|
|
168
|
+
};
|
|
169
|
+
class SwitchEventEmitter : public ViewEventEmitter {
|
|
170
|
+
public:
|
|
171
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
172
|
+
|
|
173
|
+
struct OnChange {
|
|
174
|
+
bool value;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
void onChange(OnChange value) const;
|
|
178
|
+
};
|
|
179
|
+
class InputAccessoryEventEmitter : public ViewEventEmitter {
|
|
180
|
+
public:
|
|
181
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
};
|
|
187
|
+
class UnimplementedNativeViewEventEmitter : public ViewEventEmitter {
|
|
188
|
+
public:
|
|
189
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
};
|
|
195
|
+
class ModalHostViewEventEmitter : public ViewEventEmitter {
|
|
196
|
+
public:
|
|
197
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
198
|
+
|
|
199
|
+
struct OnRequestClose {
|
|
200
|
+
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
struct OnShow {
|
|
204
|
+
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
struct OnDismiss {
|
|
208
|
+
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
enum class OnOrientationChangeOrientation {
|
|
212
|
+
Portrait,
|
|
213
|
+
Landscape
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
static char const *toString(const OnOrientationChangeOrientation value) {
|
|
217
|
+
switch (value) {
|
|
218
|
+
case OnOrientationChangeOrientation::Portrait: return "portrait";
|
|
219
|
+
case OnOrientationChangeOrientation::Landscape: return "landscape";
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
struct OnOrientationChange {
|
|
224
|
+
OnOrientationChangeOrientation orientation;
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
void onRequestClose(OnRequestClose value) const;
|
|
228
|
+
|
|
229
|
+
void onShow(OnShow value) const;
|
|
230
|
+
|
|
231
|
+
void onDismiss(OnDismiss value) const;
|
|
232
|
+
|
|
233
|
+
void onOrientationChange(OnOrientationChange value) const;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
} // namespace react
|
|
237
|
+
} // namespace facebook
|