react-native-firework-sdk 2.2.5 → 2.3.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/FireworkVideoUI.xcframework/Info.plist +5 -5
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Info.plist +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.abi.json +2 -9
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/FireworkVideoUI +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Info.plist +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.abi.json +2 -9
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json +2 -9
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +9 -9
- package/android/build.gradle +9 -39
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/gradle.properties +7 -5
- package/android/proguard-rules.pro +5 -26
- package/android/src/main/AndroidManifest.xml +0 -3
- package/android/src/main/java/com/fireworksdk/bridge/FireworkSDKPackage.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/components/base/FWBaseFragment.kt +10 -0
- package/android/src/main/java/com/fireworksdk/bridge/components/storyblock/StoryBlockFragment.kt +157 -0
- package/android/src/main/java/com/fireworksdk/bridge/components/storyblock/StoryBlockFrameLayout.kt +19 -0
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +15 -5
- package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModel.kt +6 -7
- package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModelDeserializer.kt +5 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModelSerializer.kt +22 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModel.kt +3 -5
- package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModelDeserializer.kt +2 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModelSerializer.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWGradientDrawableModel.kt +8 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWGradientDrawableModelDeserializer.kt +35 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWGradientDrawableModelSerializer.kt +27 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWLiveStreamEventDetailsModel.kt +1 -5
- package/android/src/main/java/com/fireworksdk/bridge/models/FWLiveStreamMessageDetailsModel.kt +1 -5
- package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfiguration.kt +5 -15
- package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfigurationDeserializer.kt +2 -9
- package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfigurationSerializer.kt +42 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModel.kt +3 -5
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModelDeserializer.kt +2 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModelSerializer.kt +20 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResult.kt +3 -12
- package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResultDeserializer.kt +2 -13
- package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResultSerializer.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModel.kt +8 -9
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModelDeserializer.kt +17 -6
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModelSerializer.kt +59 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedItemDetailsModel.kt +1 -5
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModel.kt +14 -15
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelDeserializer.kt +14 -4
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelSerializer.kt +56 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlaybackDetails.kt +11 -8
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +11 -12
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelDeserializer.kt +11 -7
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelSerializer.kt +63 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoShoppingProduct.kt +4 -11
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoShoppingProductSerializer.kt +82 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWBadgeTextType.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWCtaButtonTextValue.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWCtaDelayType.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/{FWEventName.kt → enums/FWEventName.kt} +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWGradientDrawableOrientation.kt +24 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWPlayerLaunchBehavior.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWPlayerStyle.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWShoppingCtaResultRes.kt +19 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWSystemTypeface.kt +21 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoCompleteAction.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoFeedMode.kt +19 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoFeedSource.kt +22 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoFeedTitlePosition.kt +19 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoPlayerCTAWidth.kt +19 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/FWReactNativeSDK.kt +22 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +61 -32
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +3 -2
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWNavigatorInterface.kt +0 -1
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWVideoShoppingInterface.kt +0 -1
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FireworkSDKInterface.kt +0 -2
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWLiveStreamModule.kt +2 -2
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWNavigatorModule.kt +0 -6
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +25 -32
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +24 -47
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWEventUtils.kt +17 -44
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWBundleUtils.kt +46 -21
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +165 -86
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWFragmentUtil.kt +51 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWGlobalDataUtil.kt +1 -5
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWLanguageUtil.kt +77 -80
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWLiveStreamUtil.kt +17 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWSingletonHolder.kt +25 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWStatusBarUtil.kt +28 -0
- package/android/src/main/res/layout/fw_bridge_story_block.xml +5 -12
- package/ios/Components/VideoFeed.swift +39 -19
- package/ios/Components/VideoFeedConfiguration.swift +4 -5
- package/ios/Components/VideoFeedManager.swift +1 -1
- package/ios/Components/VideoPlayerConfiguration.swift +17 -0
- package/ios/FireworkSdk.xcodeproj/project.pbxproj +197 -205
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/Bundle+AppLanguage.swift +23 -8
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/URLSession+AppLanguage.swift +1 -18
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIImageView+AppLanguage.swift +4 -1
- package/ios/Models/NativeToRN/FireworkEventName.swift +0 -1
- package/ios/Models/NativeToRN/FireworkSDK+Json.swift +1 -1
- package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +6 -157
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+CTA.swift +1 -21
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +1 -2
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +1 -12
- package/ios/Modules/LiveStream/LiveStreamModule.m +1 -1
- package/ios/Modules/LiveStream/LiveStreamModule.swift +4 -2
- package/ios/Modules/Shopping/FWCartViewController.swift +0 -75
- package/ios/Modules/Shopping/ShoppingModule.m +1 -3
- package/ios/Modules/Shopping/ShoppingModule.swift +12 -47
- package/ios/Utils/Extensions/Swizzle/UINavigationController+FWSwizzle.swift +1 -1
- package/lib/commonjs/FireworkSDK.js +31 -15
- package/lib/commonjs/FireworkSDK.js.map +1 -1
- package/lib/commonjs/LiveStream.js.map +1 -1
- package/lib/commonjs/VideoShopping.js +43 -30
- package/lib/commonjs/VideoShopping.js.map +1 -1
- package/lib/commonjs/components/StoryBlock.js +55 -15
- package/lib/commonjs/components/StoryBlock.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +112 -24
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/GradientDrawable.js +2 -0
- package/lib/commonjs/models/GradientDrawable.js.map +1 -0
- package/lib/commonjs/models/StoryBlockConfiguration.js +6 -0
- package/lib/commonjs/models/StoryBlockConfiguration.js.map +1 -0
- package/lib/commonjs/models/VideoPlayerCTADelay.js +2 -0
- package/lib/commonjs/models/VideoPlayerCTADelay.js.map +1 -0
- package/lib/commonjs/models/VideoPlayerCTAStyle.js +6 -0
- package/lib/commonjs/models/VideoPlayerCTAStyle.js.map +1 -0
- package/lib/commonjs/models/VideoPlayerCTAWidth.js +2 -0
- package/lib/commonjs/models/VideoPlayerCTAWidth.js.map +1 -0
- package/lib/commonjs/models/VideoPlayerCompleteAction.js +2 -0
- package/lib/commonjs/models/VideoPlayerCompleteAction.js.map +1 -0
- package/lib/commonjs/models/VideoPlayerStyle.js +2 -0
- package/lib/commonjs/models/VideoPlayerStyle.js.map +1 -0
- package/lib/commonjs/modules/LiveStreamModule.js.map +1 -1
- package/lib/commonjs/modules/ShoppingModule.js.map +1 -1
- package/lib/commonjs/utils/FWGlobalState.js +47 -0
- package/lib/commonjs/utils/FWGlobalState.js.map +1 -0
- package/lib/module/FireworkSDK.js +30 -14
- package/lib/module/FireworkSDK.js.map +1 -1
- package/lib/module/LiveStream.js.map +1 -1
- package/lib/module/VideoShopping.js +43 -29
- package/lib/module/VideoShopping.js.map +1 -1
- package/lib/module/components/StoryBlock.js +54 -15
- package/lib/module/components/StoryBlock.js.map +1 -1
- package/lib/module/components/VideoFeed.js +113 -24
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/GradientDrawable.js +2 -0
- package/lib/module/models/GradientDrawable.js.map +1 -0
- package/lib/module/models/StoryBlockConfiguration.js +2 -0
- package/lib/module/models/StoryBlockConfiguration.js.map +1 -0
- package/lib/module/models/VideoPlayerCTADelay.js +2 -0
- package/lib/module/models/VideoPlayerCTADelay.js.map +1 -0
- package/lib/module/models/VideoPlayerCTAStyle.js +2 -0
- package/lib/module/models/VideoPlayerCTAStyle.js.map +1 -0
- package/lib/module/models/VideoPlayerCTAWidth.js +2 -0
- package/lib/module/models/VideoPlayerCTAWidth.js.map +1 -0
- package/lib/module/models/VideoPlayerCompleteAction.js +2 -0
- package/lib/module/models/VideoPlayerCompleteAction.js.map +1 -0
- package/lib/module/models/VideoPlayerStyle.js +2 -0
- package/lib/module/models/VideoPlayerStyle.js.map +1 -0
- package/lib/module/modules/LiveStreamModule.js.map +1 -1
- package/lib/module/modules/ShoppingModule.js.map +1 -1
- package/lib/module/utils/FWGlobalState.js +39 -0
- package/lib/module/utils/FWGlobalState.js.map +1 -0
- package/lib/typescript/FireworkSDK.d.ts +7 -7
- package/lib/typescript/LiveStream.d.ts +2 -2
- package/lib/typescript/VideoShopping.d.ts +17 -18
- package/lib/typescript/components/StoryBlock.d.ts +2 -0
- package/lib/typescript/components/VideoFeed.d.ts +7 -3
- package/lib/typescript/index.d.ts +10 -3
- package/lib/typescript/models/AdBadgeConfiguration.d.ts +9 -2
- package/lib/typescript/models/FWEvents.d.ts +9 -9
- package/lib/typescript/models/GradientDrawable.d.ts +5 -0
- package/lib/typescript/models/IOSFontInfo.d.ts +2 -0
- package/lib/typescript/models/ProductInfoViewConfiguration.d.ts +1 -1
- package/lib/typescript/models/StoryBlockConfiguration.d.ts +37 -0
- package/lib/typescript/models/VideoFeedConfiguration.d.ts +25 -4
- package/lib/typescript/models/VideoPlaybackDetails.d.ts +1 -0
- package/lib/typescript/models/VideoPlayerCTADelay.d.ts +11 -0
- package/lib/typescript/models/VideoPlayerCTAStyle.d.ts +21 -0
- package/lib/typescript/models/VideoPlayerCTAWidth.d.ts +1 -0
- package/lib/typescript/models/VideoPlayerCompleteAction.d.ts +1 -0
- package/lib/typescript/models/VideoPlayerConfiguration.d.ts +9 -34
- package/lib/typescript/models/VideoPlayerStyle.d.ts +1 -0
- package/lib/typescript/modules/LiveStreamModule.d.ts +1 -1
- package/lib/typescript/modules/ShoppingModule.d.ts +2 -3
- package/lib/typescript/utils/FWGlobalState.d.ts +10 -0
- package/package.json +5 -3
- package/react-native-firework-sdk.podspec +2 -1
- package/src/FireworkSDK.ts +47 -19
- package/src/LiveStream.ts +4 -2
- package/src/VideoShopping.ts +47 -39
- package/src/components/StoryBlock.tsx +66 -9
- package/src/components/VideoFeed.tsx +147 -23
- package/src/index.ts +14 -6
- package/src/models/AdBadgeConfiguration.ts +10 -2
- package/src/models/FWEvents.ts +11 -11
- package/src/models/GradientDrawable.ts +14 -0
- package/src/models/IOSFontInfo.ts +2 -0
- package/src/models/ProductInfoViewConfiguration.ts +1 -1
- package/src/models/StoryBlockConfiguration.ts +38 -0
- package/src/models/VideoFeedConfiguration.ts +25 -4
- package/src/models/VideoPlaybackDetails.ts +1 -0
- package/src/models/VideoPlayerCTADelay.ts +11 -0
- package/src/models/VideoPlayerCTAStyle.ts +22 -0
- package/src/models/VideoPlayerCTAWidth.ts +1 -0
- package/src/models/VideoPlayerCompleteAction.ts +1 -0
- package/src/models/VideoPlayerConfiguration.ts +9 -36
- package/src/models/VideoPlayerStyle.ts +1 -0
- package/src/modules/LiveStreamModule.ts +1 -1
- package/src/modules/ShoppingModule.ts +2 -3
- package/src/utils/FWGlobalState.ts +31 -0
- package/android/publish.gradle +0 -66
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/StoryBlockFragment.kt +0 -129
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/StoryBlockFrameLayout.kt +0 -90
- package/android/src/main/java/com/fireworksdk/bridge/constants/FWVideoPlayerConstant.kt +0 -39
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSystemTypeface.kt +0 -9
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedModel.kt +0 -7
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedSource.kt +0 -10
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedTitlePosition.kt +0 -7
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/pages/FWContainerActivity.kt +0 -53
- package/android/src/main/res/layout/fw_bridge_fragment_container.xml +0 -8
- package/ios/Modules/FWNavigatorModule/FWNavigatorContainerViewController.swift +0 -33
- package/ios/Modules/FWNavigatorModule/FWNavigatorProtocol.swift +0 -18
package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelDeserializer.kt
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
package com.fireworksdk.bridge.models
|
|
2
2
|
|
|
3
|
+
import com.fireworksdk.bridge.models.enums.FWVideoFeedMode
|
|
4
|
+
import com.fireworksdk.bridge.models.enums.FWVideoFeedSource
|
|
3
5
|
import org.json.JSONObject
|
|
4
6
|
|
|
5
7
|
object FWVideoFeedPropsModelDeserializer {
|
|
@@ -11,9 +13,11 @@ object FWVideoFeedPropsModelDeserializer {
|
|
|
11
13
|
private const val HASHTAG_FILTER_EXPRESSION_KEY = "hashtagFilterExpression"
|
|
12
14
|
private const val MODE_KEY = "mode"
|
|
13
15
|
private const val ENABLE_PIP_KEY = "enablePictureInPicture"
|
|
16
|
+
private const val MARGIN_RIGHT_KEY = "marginRight"
|
|
14
17
|
|
|
15
18
|
private const val VIDEO_FEED_CONFIGURATION_KEY = "videoFeedConfiguration"
|
|
16
19
|
private const val VIDEO_PLAYER_CONFIGURATION_KEY = "videoPlayerConfiguration"
|
|
20
|
+
private const val STORY_BLOCK_CONFIGURATION_KEY = "storyBlockConfiguration"
|
|
17
21
|
private const val DYNAMIC_CONTENT_PARAMETERS_KEY = "dynamicContentParameters"
|
|
18
22
|
|
|
19
23
|
fun deserialize(responseJson: JSONObject?): FWVideoFeedPropsModel? {
|
|
@@ -34,6 +38,9 @@ object FWVideoFeedPropsModelDeserializer {
|
|
|
34
38
|
val videoPlayerConfiguration = FWVideoPlayerConfigModelDeserializer.deserialize(
|
|
35
39
|
responseJson.optJSONObject(VIDEO_PLAYER_CONFIGURATION_KEY)
|
|
36
40
|
)
|
|
41
|
+
val storyBlockConfiguration = FWVideoPlayerConfigModelDeserializer.deserialize(
|
|
42
|
+
responseJson.optJSONObject(STORY_BLOCK_CONFIGURATION_KEY)
|
|
43
|
+
)
|
|
37
44
|
val dynamicContentParametersObject = if (responseJson.has(DYNAMIC_CONTENT_PARAMETERS_KEY)) responseJson.optJSONObject(DYNAMIC_CONTENT_PARAMETERS_KEY) else null
|
|
38
45
|
var dynamicContentParameters: Map<String, List<String>>? = null
|
|
39
46
|
|
|
@@ -55,17 +62,20 @@ object FWVideoFeedPropsModelDeserializer {
|
|
|
55
62
|
dynamicContentParameters = dynamicContentParametersMutableMap.toMap()
|
|
56
63
|
}
|
|
57
64
|
|
|
65
|
+
val marginRight = if (responseJson.has(MARGIN_RIGHT_KEY)) responseJson.optDouble(MARGIN_RIGHT_KEY) else null
|
|
66
|
+
|
|
58
67
|
return FWVideoFeedPropsModel(
|
|
59
|
-
source = source,
|
|
68
|
+
source = if (!source.isNullOrBlank()) FWVideoFeedSource.deserialize(source) else null,
|
|
60
69
|
channel = channel,
|
|
61
70
|
playlist = playlist,
|
|
62
71
|
playlistGroup = playlistGroup,
|
|
63
72
|
hashtagFilterExpression = hashtagFilterExpression,
|
|
64
|
-
mode = mode,
|
|
73
|
+
mode = if (!mode.isNullOrBlank()) FWVideoFeedMode.deserialize(mode) else null,
|
|
65
74
|
enablePictureInPicture= enablePictureInPicture,
|
|
66
75
|
videoFeedConfiguration = videoFeedConfiguration,
|
|
67
|
-
videoPlayerConfiguration = videoPlayerConfiguration,
|
|
68
|
-
dynamicContentParameters = dynamicContentParameters
|
|
76
|
+
videoPlayerConfiguration = storyBlockConfiguration ?: videoPlayerConfiguration,
|
|
77
|
+
dynamicContentParameters = dynamicContentParameters,
|
|
78
|
+
marginRight = marginRight
|
|
69
79
|
)
|
|
70
80
|
}
|
|
71
81
|
}
|
package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelSerializer.kt
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models
|
|
2
|
+
|
|
3
|
+
import com.fireworksdk.bridge.models.enums.FWVideoFeedMode
|
|
4
|
+
import com.fireworksdk.bridge.models.enums.FWVideoFeedSource
|
|
5
|
+
import org.json.JSONArray
|
|
6
|
+
import org.json.JSONObject
|
|
7
|
+
|
|
8
|
+
object FWVideoFeedPropsModelSerializer {
|
|
9
|
+
|
|
10
|
+
private const val SOURCE_KEY = "source"
|
|
11
|
+
private const val CHANNEL_KEY = "channel"
|
|
12
|
+
private const val PLAYLIST_KEY = "playlist"
|
|
13
|
+
private const val PLAYLIST_GROUP_KEY = "playlistGroup"
|
|
14
|
+
private const val HASHTAG_FILTER_EXPRESSION_KEY = "hashtagFilterExpression"
|
|
15
|
+
private const val MODE_KEY = "mode"
|
|
16
|
+
private const val ENABLE_PIP_KEY = "enablePictureInPicture"
|
|
17
|
+
private const val MARGIN_RIGHT_KEY = "marginRight"
|
|
18
|
+
|
|
19
|
+
private const val VIDEO_FEED_CONFIGURATION_KEY = "videoFeedConfiguration"
|
|
20
|
+
private const val VIDEO_PLAYER_CONFIGURATION_KEY = "videoPlayerConfiguration"
|
|
21
|
+
private const val DYNAMIC_CONTENT_PARAMETERS_KEY = "dynamicContentParameters"
|
|
22
|
+
|
|
23
|
+
fun serialize(model: FWVideoFeedPropsModel?): JSONObject? {
|
|
24
|
+
model ?: return null
|
|
25
|
+
val jsonObject = JSONObject()
|
|
26
|
+
jsonObject.put(SOURCE_KEY, FWVideoFeedSource.serialize(model.source))
|
|
27
|
+
jsonObject.put(CHANNEL_KEY, model.channel)
|
|
28
|
+
jsonObject.put(PLAYLIST_KEY, model.playlist)
|
|
29
|
+
jsonObject.put(PLAYLIST_GROUP_KEY, model.playlistGroup)
|
|
30
|
+
jsonObject.put(HASHTAG_FILTER_EXPRESSION_KEY, model.hashtagFilterExpression)
|
|
31
|
+
jsonObject.put(MODE_KEY, FWVideoFeedMode.serialize(model.mode))
|
|
32
|
+
jsonObject.put(ENABLE_PIP_KEY, model.enablePictureInPicture)
|
|
33
|
+
jsonObject.put(VIDEO_FEED_CONFIGURATION_KEY, FWVideoFeedConfigModelSerializer.serialize(model.videoFeedConfiguration))
|
|
34
|
+
jsonObject.put(VIDEO_PLAYER_CONFIGURATION_KEY, FWVideoPlayerConfigModelSerializer.serialize(model.videoPlayerConfiguration))
|
|
35
|
+
|
|
36
|
+
if (model.dynamicContentParameters != null) {
|
|
37
|
+
val dynamicContentParametersJsonObject = JSONObject()
|
|
38
|
+
val keys = model.dynamicContentParameters.keys
|
|
39
|
+
for (key in keys) {
|
|
40
|
+
val list = model.dynamicContentParameters[key]
|
|
41
|
+
if (!list.isNullOrEmpty()) {
|
|
42
|
+
val array = JSONArray()
|
|
43
|
+
for (item in list) {
|
|
44
|
+
array.put(item)
|
|
45
|
+
}
|
|
46
|
+
dynamicContentParametersJsonObject.put(key, array)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
jsonObject.put(DYNAMIC_CONTENT_PARAMETERS_KEY, dynamicContentParametersJsonObject)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
jsonObject.put(MARGIN_RIGHT_KEY, model.marginRight)
|
|
53
|
+
|
|
54
|
+
return jsonObject
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
package com.fireworksdk.bridge.models
|
|
2
2
|
|
|
3
|
-
import android.os.Parcelable
|
|
4
|
-
import kotlinx.android.parcel.Parcelize
|
|
5
|
-
|
|
6
|
-
@Parcelize
|
|
7
3
|
data class FWVideoPlaybackDetails(
|
|
8
4
|
val badge: String? = null,
|
|
9
5
|
val caption: String? = null,
|
|
6
|
+
val channelId: String? = null,
|
|
10
7
|
val duration: Double? = null,
|
|
8
|
+
val feedType: Double? = null,
|
|
11
9
|
val hasCta: Boolean? = null,
|
|
12
|
-
val
|
|
13
|
-
val
|
|
14
|
-
val
|
|
10
|
+
val hashtags: List<String>? = null,
|
|
11
|
+
val id: String? = null,
|
|
12
|
+
val isAd: String? = null,
|
|
13
|
+
val playerHeight: Int? = null,
|
|
14
|
+
val playerWidth: Int? = null,
|
|
15
|
+
val playlistId: String? = null,
|
|
15
16
|
val progress: Double? = null,
|
|
16
|
-
|
|
17
|
+
val actionUrl: String? = null,
|
|
18
|
+
val label: String? = null,
|
|
19
|
+
)
|
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
package com.fireworksdk.bridge.models
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import com.fireworksdk.bridge.models.enums.FWCtaDelayType
|
|
4
|
+
import com.fireworksdk.bridge.models.enums.FWPlayerStyle
|
|
5
|
+
import com.fireworksdk.bridge.models.enums.FWVideoCompleteAction
|
|
6
|
+
import com.fireworksdk.bridge.models.enums.FWVideoPlayerCTAWidth
|
|
5
7
|
|
|
6
|
-
@Parcelize
|
|
7
8
|
data class FWVideoPlayerConfigModel(
|
|
8
|
-
val playerStyle:
|
|
9
|
-
val videoCompleteAction:
|
|
9
|
+
val playerStyle: FWPlayerStyle? = null,
|
|
10
|
+
val videoCompleteAction: FWVideoCompleteAction? = null,
|
|
10
11
|
val showShareButton: Boolean? = null,
|
|
11
12
|
val ctaButtonStyle: FWCtaButtonStyleModel? = null,
|
|
12
13
|
val showMuteButton: Boolean? = null,
|
|
13
14
|
val showPlaybackButton: Boolean? = null,
|
|
14
|
-
val launchBehavior: String? = null,
|
|
15
15
|
val showBranding: Boolean? = null,
|
|
16
16
|
val ctaDelay: FWCtaDelayModel? = null,
|
|
17
17
|
val ctaHighlightDelay: FWCtaDelayModel? = null,
|
|
18
18
|
val shareBaseUrl: String? = null,
|
|
19
|
-
|
|
19
|
+
val ctaWidth: FWVideoPlayerCTAWidth? = null,
|
|
20
|
+
) {
|
|
20
21
|
|
|
21
|
-
@Parcelize
|
|
22
22
|
data class FWCtaButtonStyleModel(
|
|
23
23
|
val backgroundColor: String? = null,
|
|
24
24
|
val fontSize: Int? = null,
|
|
25
25
|
val textColor: String? = null,
|
|
26
|
-
)
|
|
26
|
+
)
|
|
27
27
|
|
|
28
|
-
@Parcelize
|
|
29
28
|
data class FWCtaDelayModel(
|
|
30
|
-
val type:
|
|
29
|
+
val type: FWCtaDelayType? = null,
|
|
31
30
|
val value: Double? = null,
|
|
32
|
-
)
|
|
31
|
+
)
|
|
33
32
|
}
|
package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelDeserializer.kt
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
package com.fireworksdk.bridge.models
|
|
2
2
|
|
|
3
|
+
import com.fireworksdk.bridge.models.enums.FWCtaDelayType
|
|
4
|
+
import com.fireworksdk.bridge.models.enums.FWPlayerStyle
|
|
5
|
+
import com.fireworksdk.bridge.models.enums.FWVideoCompleteAction
|
|
6
|
+
import com.fireworksdk.bridge.models.enums.FWVideoPlayerCTAWidth
|
|
3
7
|
import org.json.JSONObject
|
|
4
8
|
|
|
5
9
|
object FWVideoPlayerConfigModelDeserializer {
|
|
@@ -10,11 +14,11 @@ object FWVideoPlayerConfigModelDeserializer {
|
|
|
10
14
|
private const val CTA_BUTTON_STYLE_KEY = "ctaButtonStyle"
|
|
11
15
|
private const val SHOW_MUTE_BUTTON_KEY = "showMuteButton"
|
|
12
16
|
private const val SHOW_PLAYBACK_BUTTON_KEY = "showPlaybackButton"
|
|
13
|
-
private const val LAUNCH_BEHAVIOR_KEY = "launchBehavior"
|
|
14
17
|
private const val SHOW_BRANDING_KEY = "showBranding"
|
|
15
18
|
private const val CTA_DELAY_KEY = "ctaDelay"
|
|
16
19
|
private const val CTA_HIGHLIGHT_DELAY_KEY = "ctaHighlightDelay"
|
|
17
20
|
private const val SHARE_BASE_URL_KEY = "shareBaseURL"
|
|
21
|
+
private const val CTA_WIDTH_KEY = "ctaWidth"
|
|
18
22
|
|
|
19
23
|
private const val BACKGROUND_COLOR_KEY = "backgroundColor"
|
|
20
24
|
private const val FONT_SIZE_KEY = "fontSize"
|
|
@@ -32,24 +36,24 @@ object FWVideoPlayerConfigModelDeserializer {
|
|
|
32
36
|
val ctaButtonStyle = deserializeCtaButtonStyle(responseJson.optJSONObject(CTA_BUTTON_STYLE_KEY))
|
|
33
37
|
val showMuteButton = if (responseJson.has(SHOW_MUTE_BUTTON_KEY)) responseJson.optBoolean(SHOW_MUTE_BUTTON_KEY) else null
|
|
34
38
|
val showPlaybackButton = if (responseJson.has(SHOW_PLAYBACK_BUTTON_KEY)) responseJson.optBoolean(SHOW_PLAYBACK_BUTTON_KEY) else null
|
|
35
|
-
val launchBehavior = if (responseJson.has(LAUNCH_BEHAVIOR_KEY)) responseJson.optString(LAUNCH_BEHAVIOR_KEY) else null
|
|
36
39
|
val showBranding = if (responseJson.has(SHOW_BRANDING_KEY)) responseJson.optBoolean(SHOW_BRANDING_KEY) else null
|
|
37
40
|
val ctaDelay = deserializeCtaDelay(responseJson.optJSONObject(CTA_DELAY_KEY))
|
|
38
41
|
val ctaHighlightDelay = deserializeCtaDelay(responseJson.optJSONObject(CTA_HIGHLIGHT_DELAY_KEY))
|
|
39
42
|
val shareBaseUrl = if (responseJson.has(SHARE_BASE_URL_KEY)) responseJson.optString(SHARE_BASE_URL_KEY) else null
|
|
43
|
+
val ctaWidth = if (responseJson.has(CTA_WIDTH_KEY)) responseJson.optString(CTA_WIDTH_KEY) else null
|
|
40
44
|
|
|
41
45
|
return FWVideoPlayerConfigModel(
|
|
42
|
-
playerStyle = playerStyle,
|
|
43
|
-
videoCompleteAction = videoCompleteAction,
|
|
46
|
+
playerStyle = if (!playerStyle.isNullOrBlank()) FWPlayerStyle.deserialize(playerStyle) else null,
|
|
47
|
+
videoCompleteAction = if (!videoCompleteAction.isNullOrBlank()) FWVideoCompleteAction.deserialize(videoCompleteAction) else null,
|
|
44
48
|
showShareButton = showShareButton,
|
|
45
49
|
ctaButtonStyle = ctaButtonStyle,
|
|
46
50
|
showMuteButton = showMuteButton,
|
|
47
51
|
showPlaybackButton = showPlaybackButton,
|
|
48
|
-
launchBehavior = launchBehavior,
|
|
49
52
|
showBranding = showBranding,
|
|
50
53
|
ctaDelay = ctaDelay,
|
|
51
54
|
ctaHighlightDelay = ctaHighlightDelay,
|
|
52
55
|
shareBaseUrl = shareBaseUrl,
|
|
56
|
+
ctaWidth = if (!ctaWidth.isNullOrBlank()) FWVideoPlayerCTAWidth.deserialize(ctaWidth) else null,
|
|
53
57
|
)
|
|
54
58
|
}
|
|
55
59
|
|
|
@@ -71,10 +75,10 @@ object FWVideoPlayerConfigModelDeserializer {
|
|
|
71
75
|
ctaDelayJson ?: return FWVideoPlayerConfigModel.FWCtaDelayModel()
|
|
72
76
|
|
|
73
77
|
val type = if (ctaDelayJson.has(TYPE_KEY)) ctaDelayJson.optString(TYPE_KEY) else null
|
|
74
|
-
val value = if (ctaDelayJson.
|
|
78
|
+
val value = if (!ctaDelayJson.isNull(VALUE_KEY)) ctaDelayJson.optDouble(VALUE_KEY) else null
|
|
75
79
|
|
|
76
80
|
return FWVideoPlayerConfigModel.FWCtaDelayModel(
|
|
77
|
-
type = type,
|
|
81
|
+
type = if (!type.isNullOrBlank()) FWCtaDelayType.deserialize(type) else null,
|
|
78
82
|
value = value,
|
|
79
83
|
)
|
|
80
84
|
}
|
package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelSerializer.kt
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models
|
|
2
|
+
|
|
3
|
+
import com.fireworksdk.bridge.models.enums.FWCtaDelayType
|
|
4
|
+
import com.fireworksdk.bridge.models.enums.FWPlayerStyle
|
|
5
|
+
import com.fireworksdk.bridge.models.enums.FWVideoCompleteAction
|
|
6
|
+
import com.fireworksdk.bridge.models.enums.FWVideoPlayerCTAWidth
|
|
7
|
+
import org.json.JSONObject
|
|
8
|
+
|
|
9
|
+
object FWVideoPlayerConfigModelSerializer {
|
|
10
|
+
|
|
11
|
+
private const val PLAYER_STYLE_KEY = "playerStyle"
|
|
12
|
+
private const val VIDEO_COMPLETE_ACTION_KEY = "videoCompleteAction"
|
|
13
|
+
private const val SHOW_SHARE_BUTTON_KEY = "showShareButton"
|
|
14
|
+
private const val CTA_BUTTON_STYLE_KEY = "ctaButtonStyle"
|
|
15
|
+
private const val SHOW_MUTE_BUTTON_KEY = "showMuteButton"
|
|
16
|
+
private const val SHOW_PLAYBACK_BUTTON_KEY = "showPlaybackButton"
|
|
17
|
+
private const val SHOW_BRANDING_KEY = "showBranding"
|
|
18
|
+
private const val CTA_DELAY_KEY = "ctaDelay"
|
|
19
|
+
private const val CTA_HIGHLIGHT_DELAY_KEY = "ctaHighlightDelay"
|
|
20
|
+
private const val SHARE_BASE_URL_KEY = "shareBaseURL"
|
|
21
|
+
private const val CTA_WIDTH_KEY = "ctaWidth"
|
|
22
|
+
|
|
23
|
+
private const val BACKGROUND_COLOR_KEY = "backgroundColor"
|
|
24
|
+
private const val FONT_SIZE_KEY = "fontSize"
|
|
25
|
+
private const val TEXT_COLOR_KEY = "textColor"
|
|
26
|
+
|
|
27
|
+
private const val TYPE_KEY = "type"
|
|
28
|
+
private const val VALUE_KEY = "value"
|
|
29
|
+
|
|
30
|
+
fun serialize(model: FWVideoPlayerConfigModel?): JSONObject? {
|
|
31
|
+
model ?: return null
|
|
32
|
+
val jsonObject = JSONObject()
|
|
33
|
+
jsonObject.put(PLAYER_STYLE_KEY, FWPlayerStyle.serialize(model.playerStyle))
|
|
34
|
+
jsonObject.put(VIDEO_COMPLETE_ACTION_KEY, FWVideoCompleteAction.serialize(model.videoCompleteAction))
|
|
35
|
+
jsonObject.put(SHOW_SHARE_BUTTON_KEY, model.showShareButton)
|
|
36
|
+
jsonObject.put(CTA_BUTTON_STYLE_KEY, serializeCtaButtonStyle(model.ctaButtonStyle))
|
|
37
|
+
jsonObject.put(SHOW_MUTE_BUTTON_KEY, model.showMuteButton)
|
|
38
|
+
jsonObject.put(SHOW_PLAYBACK_BUTTON_KEY, model.showPlaybackButton)
|
|
39
|
+
jsonObject.put(SHOW_BRANDING_KEY, model.showBranding)
|
|
40
|
+
jsonObject.put(CTA_DELAY_KEY, serializeCtaDelay(model.ctaDelay))
|
|
41
|
+
jsonObject.put(CTA_HIGHLIGHT_DELAY_KEY, serializeCtaDelay(model.ctaHighlightDelay))
|
|
42
|
+
jsonObject.put(SHARE_BASE_URL_KEY, model.shareBaseUrl)
|
|
43
|
+
jsonObject.put(CTA_WIDTH_KEY, FWVideoPlayerCTAWidth.serialize(model.ctaWidth))
|
|
44
|
+
return jsonObject
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
private fun serializeCtaButtonStyle(model: FWVideoPlayerConfigModel.FWCtaButtonStyleModel?): JSONObject? {
|
|
48
|
+
model ?: return null
|
|
49
|
+
val jsonObject = JSONObject()
|
|
50
|
+
jsonObject.put(BACKGROUND_COLOR_KEY, model.backgroundColor)
|
|
51
|
+
jsonObject.put(FONT_SIZE_KEY, model.fontSize)
|
|
52
|
+
jsonObject.put(TEXT_COLOR_KEY, model.textColor)
|
|
53
|
+
return jsonObject
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
private fun serializeCtaDelay(model: FWVideoPlayerConfigModel.FWCtaDelayModel?): JSONObject? {
|
|
57
|
+
model ?: return null
|
|
58
|
+
val jsonObject = JSONObject()
|
|
59
|
+
jsonObject.put(TYPE_KEY, FWCtaDelayType.serialize(model.type))
|
|
60
|
+
jsonObject.put(VALUE_KEY, model.value)
|
|
61
|
+
return jsonObject
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
package com.fireworksdk.bridge.models
|
|
2
2
|
|
|
3
|
-
import android.os.Parcelable
|
|
4
|
-
import kotlinx.android.parcel.Parcelize
|
|
5
|
-
|
|
6
|
-
@Parcelize
|
|
7
3
|
data class FWVideoShoppingProduct(
|
|
8
4
|
val productId: String? = null,
|
|
9
5
|
val name: String? = null,
|
|
10
6
|
val description: String? = null,
|
|
11
7
|
val units: List<FWVideoProductUnit>? = null,
|
|
12
8
|
val isAvailable: Boolean = true,
|
|
13
|
-
)
|
|
9
|
+
) {
|
|
14
10
|
|
|
15
|
-
@Parcelize
|
|
16
11
|
data class FWVideoProductUnit(
|
|
17
12
|
val unitId: String? = null,
|
|
18
13
|
val name: String? = null,
|
|
@@ -21,17 +16,15 @@ data class FWVideoShoppingProduct(
|
|
|
21
16
|
val imageUrl: String? = null,
|
|
22
17
|
val options: List<FWVideoProductOption>? = null,
|
|
23
18
|
val isAvailable: Boolean = true,
|
|
24
|
-
)
|
|
19
|
+
)
|
|
25
20
|
|
|
26
|
-
@Parcelize
|
|
27
21
|
data class FWVideoProductPrice(
|
|
28
22
|
val amount: Double? = null,
|
|
29
23
|
val currencyCode: String? = null,
|
|
30
|
-
)
|
|
24
|
+
)
|
|
31
25
|
|
|
32
|
-
@Parcelize
|
|
33
26
|
data class FWVideoProductOption(
|
|
34
27
|
val name: String? = null,
|
|
35
28
|
val value: String? = null,
|
|
36
|
-
)
|
|
29
|
+
)
|
|
37
30
|
}
|
package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoShoppingProductSerializer.kt
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models
|
|
2
|
+
|
|
3
|
+
import org.json.JSONArray
|
|
4
|
+
import org.json.JSONObject
|
|
5
|
+
|
|
6
|
+
object FWVideoShoppingProductSerializer {
|
|
7
|
+
|
|
8
|
+
private const val PRODUCT_ID_KEY = "productId"
|
|
9
|
+
private const val NAME_KEY = "name"
|
|
10
|
+
private const val DESCRIPTION_KEY = "description"
|
|
11
|
+
private const val UNITS_KEY = "units"
|
|
12
|
+
private const val IS_AVAILABLE_KEY = "isAvailable"
|
|
13
|
+
|
|
14
|
+
private const val UNIT_ID_KEY = "unitId"
|
|
15
|
+
private const val PRICE_KEY = "price"
|
|
16
|
+
private const val URL_KEY = "url"
|
|
17
|
+
private const val IMAGE_URL_KEY = "imageUrl"
|
|
18
|
+
private const val OPTIONS_KEY = "options"
|
|
19
|
+
|
|
20
|
+
private const val AMOUNT_KEY = "amount"
|
|
21
|
+
private const val CURRENCY_CODE_KEY = "currencyCode"
|
|
22
|
+
|
|
23
|
+
private const val VALUE_KEY = "value"
|
|
24
|
+
|
|
25
|
+
fun serialize(model: FWVideoShoppingProduct?): JSONObject? {
|
|
26
|
+
model ?: return null
|
|
27
|
+
val jsonObject = JSONObject()
|
|
28
|
+
jsonObject.put(PRODUCT_ID_KEY, model.productId)
|
|
29
|
+
jsonObject.put(NAME_KEY, model.name)
|
|
30
|
+
jsonObject.put(DESCRIPTION_KEY, model.description)
|
|
31
|
+
jsonObject.put(UNITS_KEY, serializeUnits(model.units))
|
|
32
|
+
jsonObject.put(IS_AVAILABLE_KEY, model.isAvailable)
|
|
33
|
+
return jsonObject
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
private fun serializeUnits(list: List<FWVideoShoppingProduct.FWVideoProductUnit>?): JSONArray? {
|
|
37
|
+
list ?: return null
|
|
38
|
+
val jsonArray = JSONArray()
|
|
39
|
+
for (item in list) {
|
|
40
|
+
jsonArray.put(serializeUnit(item))
|
|
41
|
+
}
|
|
42
|
+
return jsonArray
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
private fun serializeUnit(model: FWVideoShoppingProduct.FWVideoProductUnit?): JSONObject? {
|
|
46
|
+
model ?: return null
|
|
47
|
+
val jsonObject = JSONObject()
|
|
48
|
+
jsonObject.put(UNIT_ID_KEY, model.unitId)
|
|
49
|
+
jsonObject.put(NAME_KEY, model.name)
|
|
50
|
+
jsonObject.put(PRICE_KEY, serializePrice(model.price))
|
|
51
|
+
jsonObject.put(URL_KEY, model.url)
|
|
52
|
+
jsonObject.put(IMAGE_URL_KEY, model.imageUrl)
|
|
53
|
+
jsonObject.put(OPTIONS_KEY, serializeOptions(model.options))
|
|
54
|
+
jsonObject.put(IS_AVAILABLE_KEY, model.isAvailable)
|
|
55
|
+
return jsonObject
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
private fun serializePrice(model: FWVideoShoppingProduct.FWVideoProductPrice?): JSONObject? {
|
|
59
|
+
model ?: return null
|
|
60
|
+
val jsonObject = JSONObject()
|
|
61
|
+
jsonObject.put(AMOUNT_KEY, model.amount)
|
|
62
|
+
jsonObject.put(CURRENCY_CODE_KEY, model.currencyCode)
|
|
63
|
+
return jsonObject
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
private fun serializeOptions(list: List<FWVideoShoppingProduct.FWVideoProductOption>?): JSONArray? {
|
|
67
|
+
list ?: return null
|
|
68
|
+
val jsonArray = JSONArray()
|
|
69
|
+
for (item in list) {
|
|
70
|
+
jsonArray.put(serializeOption(item))
|
|
71
|
+
}
|
|
72
|
+
return jsonArray
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
private fun serializeOption(model: FWVideoShoppingProduct.FWVideoProductOption?): JSONObject? {
|
|
76
|
+
model ?: return null
|
|
77
|
+
val jsonObject = JSONObject()
|
|
78
|
+
jsonObject.put(NAME_KEY, model.name)
|
|
79
|
+
jsonObject.put(VALUE_KEY, model.value)
|
|
80
|
+
return jsonObject
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models.enums
|
|
2
|
+
|
|
3
|
+
enum class FWBadgeTextType(val rawValue: String) {
|
|
4
|
+
Ad("ad"),
|
|
5
|
+
Sponsored("sponsored");
|
|
6
|
+
|
|
7
|
+
companion object {
|
|
8
|
+
fun deserialize(rawValue: String?): FWBadgeTextType? {
|
|
9
|
+
rawValue ?: return null
|
|
10
|
+
return FWBadgeTextType.values().first { it.rawValue == rawValue }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
fun serialize(model: FWBadgeTextType?): String? {
|
|
14
|
+
model ?: return null
|
|
15
|
+
return model.rawValue
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models.enums
|
|
2
|
+
|
|
3
|
+
enum class FWCtaButtonTextValue(val rawValue: String) {
|
|
4
|
+
AddToCart("addToCart"),
|
|
5
|
+
ShopNow("shopNow");
|
|
6
|
+
|
|
7
|
+
companion object {
|
|
8
|
+
fun deserialize(rawValue: String?): FWCtaButtonTextValue? {
|
|
9
|
+
rawValue ?: return null
|
|
10
|
+
return values().first { it.rawValue == rawValue }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
fun serialize(model: FWCtaButtonTextValue?): String? {
|
|
14
|
+
model ?: return null
|
|
15
|
+
return model.rawValue
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models.enums
|
|
2
|
+
|
|
3
|
+
enum class FWCtaDelayType(val rawValue: String) {
|
|
4
|
+
Constant("constant"),
|
|
5
|
+
Percentage("percentage");
|
|
6
|
+
|
|
7
|
+
companion object {
|
|
8
|
+
fun deserialize(rawValue: String?): FWCtaDelayType? {
|
|
9
|
+
rawValue ?: return null
|
|
10
|
+
return FWCtaDelayType.values().first { it.rawValue == rawValue }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
fun serialize(model: FWCtaDelayType?): String? {
|
|
14
|
+
model ?: return null
|
|
15
|
+
return model.rawValue
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWGradientDrawableOrientation.kt
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models.enums
|
|
2
|
+
|
|
3
|
+
enum class FWGradientDrawableOrientation(val rawValue: String) {
|
|
4
|
+
TOP_BOTTOM("TOP_BOTTOM"),
|
|
5
|
+
TR_BL("TR_BL"),
|
|
6
|
+
RIGHT_LEFT("RIGHT_LEFT"),
|
|
7
|
+
BR_TL("BR_TL"),
|
|
8
|
+
BOTTOM_TOP("BOTTOM_TOP"),
|
|
9
|
+
BL_TR("BL_TR"),
|
|
10
|
+
LEFT_RIGHT("LEFT_RIGHT"),
|
|
11
|
+
TL_BR("TL_BR");
|
|
12
|
+
|
|
13
|
+
companion object {
|
|
14
|
+
fun deserialize(rawValue: String?): FWGradientDrawableOrientation? {
|
|
15
|
+
rawValue ?: return null
|
|
16
|
+
return FWGradientDrawableOrientation.values().first { it.rawValue == rawValue }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
fun serialize(model: FWGradientDrawableOrientation?): String? {
|
|
20
|
+
model ?: return null
|
|
21
|
+
return model.rawValue
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models.enums
|
|
2
|
+
|
|
3
|
+
enum class FWPlayerLaunchBehavior(val rawValue: String) {
|
|
4
|
+
Default("default"),
|
|
5
|
+
MuteOnFirstLaunch("muteOnFirstLaunch");
|
|
6
|
+
|
|
7
|
+
companion object {
|
|
8
|
+
fun deserialize(rawValue: String?): FWPlayerLaunchBehavior? {
|
|
9
|
+
rawValue ?: return null
|
|
10
|
+
return FWPlayerLaunchBehavior.values().first { it.rawValue == rawValue }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
fun serialize(model: FWPlayerLaunchBehavior?): String? {
|
|
14
|
+
model ?: return null
|
|
15
|
+
return model.rawValue
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models.enums
|
|
2
|
+
|
|
3
|
+
enum class FWPlayerStyle(val rawValue: String) {
|
|
4
|
+
Full("full"),
|
|
5
|
+
Fit("fit");
|
|
6
|
+
|
|
7
|
+
companion object {
|
|
8
|
+
fun deserialize(rawValue: String?): FWPlayerStyle? {
|
|
9
|
+
rawValue ?: return null
|
|
10
|
+
return FWPlayerStyle.values().first { it.rawValue == rawValue }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
fun serialize(model: FWPlayerStyle?): String? {
|
|
14
|
+
model ?: return null
|
|
15
|
+
return model.rawValue
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models.enums
|
|
2
|
+
|
|
3
|
+
enum class FWShoppingCtaResultRes(val rawValue: String) {
|
|
4
|
+
Success("success"),
|
|
5
|
+
Fail("fail"),
|
|
6
|
+
Loading("loading");
|
|
7
|
+
|
|
8
|
+
companion object {
|
|
9
|
+
fun deserialize(rawValue: String?): FWShoppingCtaResultRes? {
|
|
10
|
+
rawValue ?: return null
|
|
11
|
+
return FWShoppingCtaResultRes.values().first { it.rawValue == rawValue }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
fun serialize(model: FWShoppingCtaResultRes?): String? {
|
|
15
|
+
model ?: return null
|
|
16
|
+
return model.rawValue
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models.enums
|
|
2
|
+
|
|
3
|
+
enum class FWSystemTypeface(val rawValue: String) {
|
|
4
|
+
Default("DEFAULT"),
|
|
5
|
+
DefaultBold("DEFAULT_BOLD"),
|
|
6
|
+
SansSerif("SANS_SERIF"),
|
|
7
|
+
Serif("SERIF"),
|
|
8
|
+
Monospace("MONOSPACE");
|
|
9
|
+
|
|
10
|
+
companion object {
|
|
11
|
+
fun deserialize(rawValue: String?): FWSystemTypeface? {
|
|
12
|
+
rawValue ?: return null
|
|
13
|
+
return FWSystemTypeface.values().first { it.rawValue == rawValue }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
fun serialize(model: FWSystemTypeface?): String? {
|
|
17
|
+
model ?: return null
|
|
18
|
+
return model.rawValue
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models.enums
|
|
2
|
+
|
|
3
|
+
enum class FWVideoCompleteAction(val rawValue: String) {
|
|
4
|
+
Loop("loop"),
|
|
5
|
+
AdvanceToNext("advanceToNext");
|
|
6
|
+
|
|
7
|
+
companion object {
|
|
8
|
+
fun deserialize(rawValue: String?): FWVideoCompleteAction? {
|
|
9
|
+
rawValue ?: return null
|
|
10
|
+
return FWVideoCompleteAction.values().first { it.rawValue == rawValue }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
fun serialize(model: FWVideoCompleteAction?): String? {
|
|
14
|
+
model ?: return null
|
|
15
|
+
return model.rawValue
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models.enums
|
|
2
|
+
|
|
3
|
+
enum class FWVideoFeedMode(val rawValue: String) {
|
|
4
|
+
Row("row"),
|
|
5
|
+
Column("column"),
|
|
6
|
+
Grid("grid");
|
|
7
|
+
|
|
8
|
+
companion object {
|
|
9
|
+
fun deserialize(rawValue: String?): FWVideoFeedMode? {
|
|
10
|
+
rawValue ?: return null
|
|
11
|
+
return FWVideoFeedMode.values().first { it.rawValue == rawValue }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
fun serialize(model: FWVideoFeedMode?): String? {
|
|
15
|
+
model ?: return null
|
|
16
|
+
return model.rawValue
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models.enums
|
|
2
|
+
|
|
3
|
+
enum class FWVideoFeedSource(val rawValue: String) {
|
|
4
|
+
Discover("discover"),
|
|
5
|
+
Channel("channel"),
|
|
6
|
+
Playlist("playlist"),
|
|
7
|
+
DynamicContent("dynamicContent"),
|
|
8
|
+
PlaylistGroup("playlistGroup"),
|
|
9
|
+
HashtagPlaylist("hashtagPlaylist");
|
|
10
|
+
|
|
11
|
+
companion object {
|
|
12
|
+
fun deserialize(rawValue: String?): FWVideoFeedSource? {
|
|
13
|
+
rawValue ?: return null
|
|
14
|
+
return FWVideoFeedSource.values().first { it.rawValue == rawValue }
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
fun serialize(model: FWVideoFeedSource?): String? {
|
|
18
|
+
model ?: return null
|
|
19
|
+
return model.rawValue
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|