react-native-firework-sdk 2.17.0-beta.8 → 2.17.0
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/android/build.gradle +1 -0
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +23 -2
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +14 -2
- package/package.json +1 -1
- package/react_native_firework_sdk.podspec +1 -1
package/android/build.gradle
CHANGED
package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt
CHANGED
|
@@ -53,13 +53,34 @@ class FWStoryBlockManager : ViewGroupManager<StoryBlockFrameLayout>() {
|
|
|
53
53
|
return map
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
override fun receiveCommand(
|
|
57
|
+
root: StoryBlockFrameLayout,
|
|
58
|
+
commandId: Int,
|
|
59
|
+
args: ReadableArray?
|
|
60
|
+
) {
|
|
61
|
+
super.receiveCommand(root, commandId, args)
|
|
62
|
+
FWLogUtils.d { "FWStoryBlockManager receiveCommand, args (StoryBlockFrameLayout, Int, ReadableArray?), commandId: $commandId, root.isAttachedToWindow: ${root.isAttachedToWindow}" }
|
|
63
|
+
when (commandId) {
|
|
64
|
+
COMMAND_CREATE -> {
|
|
65
|
+
val reactNativeViewId = requireNotNull(args).getInt(0)
|
|
66
|
+
createFragment(root, reactNativeViewId)
|
|
67
|
+
}
|
|
68
|
+
COMMAND_PLAY -> root.storyBlockFragment?.play()
|
|
69
|
+
COMMAND_PAUSE -> root.storyBlockFragment?.pause()
|
|
70
|
+
COMMAND_OPEN_FULL_SCREEN -> root.storyBlockFragment?.openFullscreen()
|
|
71
|
+
COMMAND_ON_VIEWPORT_ENTERED -> root.storyBlockFragment?.onViewportEntered()
|
|
72
|
+
COMMAND_ON_VIEWPORT_LEFT -> root.storyBlockFragment?.onViewportLeft()
|
|
73
|
+
else -> {}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
56
77
|
override fun receiveCommand(
|
|
57
78
|
root: StoryBlockFrameLayout,
|
|
58
79
|
commandId: String?,
|
|
59
80
|
args: ReadableArray?
|
|
60
81
|
) {
|
|
61
82
|
super.receiveCommand(root, commandId, args)
|
|
62
|
-
FWLogUtils.d { "FWStoryBlockManager receiveCommand commandId: $commandId, root.isAttachedToWindow: ${root.isAttachedToWindow}" }
|
|
83
|
+
FWLogUtils.d { "FWStoryBlockManager receiveCommand, args (StoryBlockFrameLayout, String?, ReadableArray?), commandId: $commandId, root.isAttachedToWindow: ${root.isAttachedToWindow}" }
|
|
63
84
|
when (commandId?.toInt()) {
|
|
64
85
|
COMMAND_CREATE -> {
|
|
65
86
|
val reactNativeViewId = requireNotNull(args).getInt(0)
|
|
@@ -289,7 +310,7 @@ class FWStoryBlockManager : ViewGroupManager<StoryBlockFrameLayout>() {
|
|
|
289
310
|
super.onDropViewInstance(storyBlockFrameLayout)
|
|
290
311
|
}
|
|
291
312
|
|
|
292
|
-
override fun getExportedCustomBubblingEventTypeConstants():
|
|
313
|
+
override fun getExportedCustomBubblingEventTypeConstants(): Map<String, Any>? {
|
|
293
314
|
return MapBuilder.builder<String, Any>()
|
|
294
315
|
.put(FWStoryBlockEventName.StoryBlockLoadFinished.rawValue, MapBuilder.of("phasedRegistrationNames", MapBuilder.of("bubbled", FWStoryBlockEventName.StoryBlockLoadFinished.rawValue)))
|
|
295
316
|
.put(FWStoryBlockEventName.StoryBlockFullScreenStateChanged.rawValue, MapBuilder.of("phasedRegistrationNames", MapBuilder.of("bubbled", FWStoryBlockEventName.StoryBlockFullScreenStateChanged.rawValue)))
|
package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt
CHANGED
|
@@ -242,9 +242,21 @@ class FWVideoFeedManager : SimpleViewManager<FWVideoFeed>() {
|
|
|
242
242
|
return map
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
+
override fun receiveCommand(root: FWVideoFeed, commandId: Int, args: ReadableArray?) {
|
|
246
|
+
super.receiveCommand(root, commandId, args)
|
|
247
|
+
FWLogUtils.d { "FWVideoFeedManager receiveCommand, args (FWVideoFeed, Int, ReadableArray?), commandId: $commandId" }
|
|
248
|
+
when (commandId) {
|
|
249
|
+
COMMAND_REFRESH -> {
|
|
250
|
+
FWLogUtils.d { "FWVideoFeedManager call refresh" }
|
|
251
|
+
root.refresh()
|
|
252
|
+
}
|
|
253
|
+
else -> {}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
245
257
|
override fun receiveCommand(root: FWVideoFeed, commandId: String?, args: ReadableArray?) {
|
|
246
258
|
super.receiveCommand(root, commandId, args)
|
|
247
|
-
FWLogUtils.d { "FWVideoFeedManager receiveCommand commandId: $commandId" }
|
|
259
|
+
FWLogUtils.d { "FWVideoFeedManager receiveCommand, args (FWVideoFeed, String?, ReadableArray?), commandId: $commandId" }
|
|
248
260
|
when (commandId?.toInt()) {
|
|
249
261
|
COMMAND_REFRESH -> {
|
|
250
262
|
FWLogUtils.d { "FWVideoFeedManager call refresh" }
|
|
@@ -259,7 +271,7 @@ class FWVideoFeedManager : SimpleViewManager<FWVideoFeed>() {
|
|
|
259
271
|
* first onVideoFeedLoadFinished is event name
|
|
260
272
|
* second onVideoFeedLoadFinished is callback prop in JavaScript
|
|
261
273
|
*/
|
|
262
|
-
override fun getExportedCustomBubblingEventTypeConstants():
|
|
274
|
+
override fun getExportedCustomBubblingEventTypeConstants(): Map<String, Any>? {
|
|
263
275
|
return MapBuilder.builder<String, Any>()
|
|
264
276
|
.put(FWFeedViewEventName.VideoFeedLoadFinished.rawValue, MapBuilder.of("phasedRegistrationNames", MapBuilder.of("bubbled", FWFeedViewEventName.VideoFeedLoadFinished.rawValue)))
|
|
265
277
|
.put(FWFeedViewEventName.VideoFeedEmpty.rawValue, MapBuilder.of("phasedRegistrationNames", MapBuilder.of("bubbled", FWFeedViewEventName.VideoFeedEmpty.rawValue)))
|
package/package.json
CHANGED