react-native-firework-sdk 2.2.5 → 2.3.1
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/FireworkVideoUI/Podfile +1 -1
- package/ios/FireworkVideoUI/Podfile.lock +4 -4
- 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
|
@@ -6,47 +6,17 @@ import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
|
6
6
|
import com.facebook.react.uimanager.events.RCTEventEmitter
|
|
7
7
|
import com.firework.common.product.Product
|
|
8
8
|
import com.fireworksdk.bridge.models.*
|
|
9
|
-
import com.fireworksdk.bridge.
|
|
10
|
-
import com.fireworksdk.bridge.
|
|
9
|
+
import com.fireworksdk.bridge.models.enums.FWEventName
|
|
10
|
+
import com.fireworksdk.bridge.models.enums.FWFeedViewEventName
|
|
11
|
+
import com.fireworksdk.bridge.models.enums.FWSDKInitSubEventName
|
|
12
|
+
import com.fireworksdk.bridge.models.enums.FWStoryBlockEventName
|
|
13
|
+
import com.fireworksdk.bridge.models.enums.FWVideoShoppingEventName
|
|
11
14
|
import com.fireworksdk.bridge.utils.FWDateUtils
|
|
12
|
-
import com.fireworksdk.bridge.utils.FWGlobalDataUtil
|
|
13
15
|
import com.fireworksdk.bridge.utils.FWLogUtils
|
|
14
16
|
import java.util.*
|
|
15
17
|
|
|
16
18
|
object FWEventUtils {
|
|
17
19
|
|
|
18
|
-
fun pushNativeContainer(reactContext: ReactContext, props: ReadableMap?, promise: Promise?) {
|
|
19
|
-
FWLogUtils.d { "FWNavigatorModule pushNativeContainer: $props" }
|
|
20
|
-
val activity = FWInitializationProvider.INSTANCE.resumedActivity
|
|
21
|
-
|
|
22
|
-
if (activity == null || FWGlobalDataUtil.appComponentName.isNullOrBlank()) {
|
|
23
|
-
promise?.resolve(false)
|
|
24
|
-
return
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
sendLogMessageEvent(reactContext, "[Android] Enter pushNativeContainer ${
|
|
28
|
-
FWDateUtils.getDateString(
|
|
29
|
-
Date()
|
|
30
|
-
)}")
|
|
31
|
-
|
|
32
|
-
UiThreadUtil.runOnUiThread {
|
|
33
|
-
|
|
34
|
-
sendLogMessageEvent(reactContext, "[Android] Before Starting container activity ${
|
|
35
|
-
FWDateUtils.getDateString(
|
|
36
|
-
Date()
|
|
37
|
-
)}")
|
|
38
|
-
|
|
39
|
-
activity.startActivity(FWContainerActivity.createIntent(activity, FWGlobalDataUtil.appComponentName, props?.toHashMap()))
|
|
40
|
-
|
|
41
|
-
sendLogMessageEvent(reactContext, "[Android] After Starting container activity ${
|
|
42
|
-
FWDateUtils.getDateString(
|
|
43
|
-
Date()
|
|
44
|
-
)}")
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
promise?.resolve(true)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
20
|
fun sendInitSuccessEvent(reactContext: ReactContext) {
|
|
51
21
|
sendEvent(reactContext, FWEventName.SDKIni.rawValue, Arguments.createMap())
|
|
52
22
|
}
|
|
@@ -105,25 +75,25 @@ object FWEventUtils {
|
|
|
105
75
|
eventMap.putString("eventName", eventName)
|
|
106
76
|
|
|
107
77
|
val contentMap = Arguments.createMap()
|
|
108
|
-
if (!info?.
|
|
109
|
-
contentMap.putString("videoId", info?.
|
|
78
|
+
if (!info?.id.isNullOrBlank()) {
|
|
79
|
+
contentMap.putString("videoId", info?.id)
|
|
110
80
|
}
|
|
111
81
|
if (info?.duration != null) {
|
|
112
82
|
contentMap.putDouble("duration", info.duration)
|
|
113
83
|
}
|
|
114
|
-
if (info?.caption.isNullOrBlank()) {
|
|
84
|
+
if (!info?.caption.isNullOrBlank()) {
|
|
115
85
|
contentMap.putString("caption", info?.caption)
|
|
116
86
|
}
|
|
117
|
-
if (info?.badge.isNullOrBlank()) {
|
|
87
|
+
if (!info?.badge.isNullOrBlank() && !info?.badge.equals("null")) {
|
|
118
88
|
contentMap.putString("badge", info?.badge)
|
|
119
89
|
}
|
|
120
|
-
if (info?.
|
|
90
|
+
if (info?.playerWidth != null || info?.playerHeight != null) {
|
|
121
91
|
val playerSizeMap = Arguments.createMap()
|
|
122
|
-
if (info.
|
|
123
|
-
playerSizeMap.putInt("width", info.
|
|
92
|
+
if (info.playerWidth != null) {
|
|
93
|
+
playerSizeMap.putInt("width", info.playerWidth)
|
|
124
94
|
}
|
|
125
|
-
if (info.
|
|
126
|
-
playerSizeMap.putInt("height", info.
|
|
95
|
+
if (info.playerHeight != null) {
|
|
96
|
+
playerSizeMap.putInt("height", info.playerHeight)
|
|
127
97
|
}
|
|
128
98
|
contentMap.putMap("playerSize", playerSizeMap)
|
|
129
99
|
}
|
|
@@ -133,6 +103,9 @@ object FWEventUtils {
|
|
|
133
103
|
if (info?.progress != null) {
|
|
134
104
|
contentMap.putDouble("progress", info.progress)
|
|
135
105
|
}
|
|
106
|
+
if (!info?.actionUrl.isNullOrBlank()) {
|
|
107
|
+
contentMap.putString("ctaActionURL", info?.actionUrl)
|
|
108
|
+
}
|
|
136
109
|
eventMap.putMap("info", contentMap)
|
|
137
110
|
|
|
138
111
|
sendEvent(reactContext, FWEventName.VideoPlayback.rawValue, eventMap)
|
|
@@ -6,34 +6,58 @@ import android.os.Parcelable
|
|
|
6
6
|
|
|
7
7
|
object FWBundleUtils {
|
|
8
8
|
|
|
9
|
+
@Suppress("UNCHECKED_CAST")
|
|
9
10
|
fun mapToBundle(map: Map<String, Any?>?): Bundle? {
|
|
10
11
|
if (map == null) {
|
|
11
12
|
return null
|
|
12
13
|
}
|
|
13
14
|
val bundle = Bundle()
|
|
14
15
|
for ((key, value) in map) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
bundle.putInt(key, value)
|
|
19
|
-
} else if (value is String) {
|
|
20
|
-
bundle.putString(key, value)
|
|
21
|
-
} else if (value is Boolean) {
|
|
22
|
-
bundle.putBoolean(key, value)
|
|
23
|
-
} else if (value is List<*>) {
|
|
24
|
-
val list = value as List<Any>
|
|
25
|
-
val first = list[0]
|
|
26
|
-
if (first == null || first is Double) {
|
|
27
|
-
bundle.putDoubleArray(key, listToDoubleArray(list))
|
|
28
|
-
} else if (first is Int) {
|
|
29
|
-
bundle.putIntArray(key, listToIntArray(list))
|
|
30
|
-
} else if (first is String) {
|
|
31
|
-
bundle.putStringArray(key, listToStringArray(list))
|
|
32
|
-
} else if (first is Map<*, *>) {
|
|
33
|
-
bundle.putParcelableArrayList(key, listToParcelableArrayList(list))
|
|
16
|
+
when (value) {
|
|
17
|
+
is Double -> {
|
|
18
|
+
bundle.putDouble(key, value)
|
|
34
19
|
}
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
|
|
21
|
+
is Int -> {
|
|
22
|
+
bundle.putInt(key, value)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
is String -> {
|
|
26
|
+
bundle.putString(key, value)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
is Boolean -> {
|
|
30
|
+
bundle.putBoolean(key, value)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
is List<*> -> {
|
|
34
|
+
val list = value as List<Any>
|
|
35
|
+
when (list[0]) {
|
|
36
|
+
is Double -> {
|
|
37
|
+
bundle.putDoubleArray(key, listToDoubleArray(list))
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
is Int -> {
|
|
41
|
+
bundle.putIntArray(key, listToIntArray(list))
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
is String -> {
|
|
45
|
+
bundle.putStringArray(key, listToStringArray(list))
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
is Map<*, *> -> {
|
|
49
|
+
bundle.putParcelableArrayList(key, listToParcelableArrayList(list))
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
else -> {}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
is Map<*, *> -> {
|
|
57
|
+
bundle.putBundle(key, mapToBundle(value as Map<String, Any>))
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
else -> {}
|
|
37
61
|
}
|
|
38
62
|
}
|
|
39
63
|
return bundle
|
|
@@ -72,6 +96,7 @@ object FWBundleUtils {
|
|
|
72
96
|
return strings
|
|
73
97
|
}
|
|
74
98
|
|
|
99
|
+
@Suppress("UNCHECKED_CAST")
|
|
75
100
|
private fun listToParcelableArrayList(list: List<Any>?): ArrayList<Parcelable?>? {
|
|
76
101
|
if (list == null) {
|
|
77
102
|
return null
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
package com.fireworksdk.bridge.utils
|
|
2
2
|
|
|
3
|
+
import android.content.Context
|
|
3
4
|
import android.graphics.Color
|
|
4
5
|
import android.graphics.Typeface
|
|
6
|
+
import android.graphics.drawable.GradientDrawable
|
|
5
7
|
import com.firework.common.PlayerMode
|
|
6
8
|
import com.firework.common.ad.AdBadgeOption
|
|
7
9
|
import com.firework.common.ad.AdBadgeTextType
|
|
10
|
+
import com.firework.common.ad.AdOption
|
|
8
11
|
import com.firework.common.cta.CtaDelay
|
|
9
12
|
import com.firework.common.cta.CtaDelayUnit
|
|
10
13
|
import com.firework.common.feed.FeedLayout
|
|
@@ -12,14 +15,23 @@ import com.firework.common.feed.FeedResource
|
|
|
12
15
|
import com.firework.common.feed.FeedTitlePosition
|
|
13
16
|
import com.firework.viewoptions.*
|
|
14
17
|
import com.fireworksdk.bridge.FWInitializationProvider
|
|
15
|
-
import com.fireworksdk.bridge.constants.FWVideoPlayerConstant
|
|
16
18
|
import com.fireworksdk.bridge.models.*
|
|
17
|
-
import com.fireworksdk.bridge.
|
|
19
|
+
import com.fireworksdk.bridge.models.enums.FWBadgeTextType
|
|
20
|
+
import com.fireworksdk.bridge.models.enums.FWCtaDelayType
|
|
21
|
+
import com.fireworksdk.bridge.models.enums.FWGradientDrawableOrientation
|
|
22
|
+
import com.fireworksdk.bridge.models.enums.FWPlayerStyle
|
|
23
|
+
import com.fireworksdk.bridge.models.enums.FWSystemTypeface
|
|
24
|
+
import com.fireworksdk.bridge.models.enums.FWVideoCompleteAction
|
|
25
|
+
import com.fireworksdk.bridge.models.enums.FWVideoFeedMode
|
|
26
|
+
import com.fireworksdk.bridge.models.enums.FWVideoFeedSource
|
|
27
|
+
import com.fireworksdk.bridge.models.enums.FWVideoFeedTitlePosition
|
|
28
|
+
import com.fireworksdk.bridge.models.enums.FWVideoPlayerCTAWidth
|
|
18
29
|
|
|
19
30
|
object FWConfigUtil {
|
|
20
31
|
|
|
21
|
-
fun generateViewOptionsBuilder(videoFeedPropsModel: FWVideoFeedPropsModel): ViewOptions.Builder {
|
|
22
|
-
|
|
32
|
+
fun generateViewOptionsBuilder(context: Context?, videoFeedPropsModel: FWVideoFeedPropsModel?): ViewOptions.Builder {
|
|
33
|
+
context ?: return ViewOptions.Builder()
|
|
34
|
+
videoFeedPropsModel ?: return ViewOptions.Builder()
|
|
23
35
|
|
|
24
36
|
val layoutOptionBuilder = getDefaultLayoutOptionBuilder()
|
|
25
37
|
val titleOptionBuilder = getDefaultTitleOptionBuilder()
|
|
@@ -27,32 +39,33 @@ object FWConfigUtil {
|
|
|
27
39
|
val baseOptionBuilder = getDefaultBaseOptionBuilder()
|
|
28
40
|
val adBadgeOptionBuilder = getDefaultAdBadgeOptionBuilder()
|
|
29
41
|
val ctaOptionBuilder = getDefaultCtaOptionBuilder()
|
|
42
|
+
val adOptionBuilder = getDefaultAdOptionBuilder()
|
|
30
43
|
|
|
31
44
|
when (videoFeedPropsModel.source) {
|
|
32
|
-
FWVideoFeedSource.Discover
|
|
45
|
+
FWVideoFeedSource.Discover -> {
|
|
33
46
|
baseOptionBuilder.feedResource(FeedResource.Discovery)
|
|
34
47
|
}
|
|
35
|
-
FWVideoFeedSource.Channel
|
|
48
|
+
FWVideoFeedSource.Channel -> {
|
|
36
49
|
videoFeedPropsModel.channel?.let { channel ->
|
|
37
50
|
baseOptionBuilder.feedResource(FeedResource.Channel(channel))
|
|
38
51
|
}
|
|
39
52
|
}
|
|
40
|
-
FWVideoFeedSource.Playlist
|
|
53
|
+
FWVideoFeedSource.Playlist -> {
|
|
41
54
|
videoFeedPropsModel.channel?.let { channel ->
|
|
42
55
|
videoFeedPropsModel.playlist?.let { playlist ->
|
|
43
56
|
baseOptionBuilder.feedResource(FeedResource.Playlist(channel, playlist))
|
|
44
57
|
}
|
|
45
58
|
}
|
|
46
59
|
}
|
|
47
|
-
FWVideoFeedSource.DynamicContent
|
|
60
|
+
FWVideoFeedSource.DynamicContent -> {
|
|
48
61
|
videoFeedPropsModel.channel?.let { channel ->
|
|
49
62
|
baseOptionBuilder.feedResource(FeedResource.DynamicContent(channel, videoFeedPropsModel.dynamicContentParameters?:hashMapOf()))
|
|
50
63
|
}
|
|
51
64
|
}
|
|
52
|
-
FWVideoFeedSource.PlaylistGroup
|
|
65
|
+
FWVideoFeedSource.PlaylistGroup -> {
|
|
53
66
|
|
|
54
67
|
}
|
|
55
|
-
FWVideoFeedSource.HashtagPlaylist
|
|
68
|
+
FWVideoFeedSource.HashtagPlaylist -> {
|
|
56
69
|
videoFeedPropsModel.channel?.let { channel ->
|
|
57
70
|
if (!videoFeedPropsModel.hashtagFilterExpression.isNullOrBlank()) {
|
|
58
71
|
baseOptionBuilder.feedResource(FeedResource.ChannelHashtag(channel, videoFeedPropsModel.hashtagFilterExpression))
|
|
@@ -65,13 +78,13 @@ object FWConfigUtil {
|
|
|
65
78
|
}
|
|
66
79
|
|
|
67
80
|
when (videoFeedPropsModel.mode) {
|
|
68
|
-
|
|
81
|
+
FWVideoFeedMode.Row -> {
|
|
69
82
|
layoutOptionBuilder.feedLayout(FeedLayout.HORIZONTAL)
|
|
70
83
|
}
|
|
71
|
-
|
|
84
|
+
FWVideoFeedMode.Column -> {
|
|
72
85
|
layoutOptionBuilder.feedLayout(FeedLayout.VERTICAL)
|
|
73
86
|
}
|
|
74
|
-
|
|
87
|
+
FWVideoFeedMode.Grid -> {
|
|
75
88
|
layoutOptionBuilder.feedLayout(FeedLayout.GRID)
|
|
76
89
|
}
|
|
77
90
|
else -> {}
|
|
@@ -83,62 +96,84 @@ object FWConfigUtil {
|
|
|
83
96
|
}
|
|
84
97
|
|
|
85
98
|
val cornerRadius = videoFeedPropsModel.videoFeedConfiguration?.cornerRadius
|
|
86
|
-
if (cornerRadius != null && cornerRadius
|
|
99
|
+
if (cornerRadius != null && cornerRadius >= 0) {
|
|
87
100
|
layoutOptionBuilder.roundedCorner(true)
|
|
88
101
|
.roundedCornerRadius(FWCommonUtil.dpToPx(cornerRadius.toFloat(), context))
|
|
89
102
|
}
|
|
90
103
|
|
|
91
104
|
val title = videoFeedPropsModel.videoFeedConfiguration?.title
|
|
92
105
|
if (title != null) {
|
|
93
|
-
val
|
|
94
|
-
val
|
|
95
|
-
val
|
|
96
|
-
val
|
|
97
|
-
|
|
98
|
-
|
|
106
|
+
val titleHidden = title.hidden
|
|
107
|
+
val titleTextColor = title.textColor
|
|
108
|
+
val titleFontSize = title.fontSize
|
|
109
|
+
val titleBackgroundColor = title.backgroundColor
|
|
110
|
+
val titleGradientDrawable = title.gradientDrawable
|
|
111
|
+
val typeface = getTypeface(context, title.fontInfo)
|
|
112
|
+
if (titleHidden != null) {
|
|
113
|
+
titleOptionBuilder.showFeedTitle(!titleHidden)
|
|
99
114
|
}
|
|
100
|
-
if (!
|
|
101
|
-
titleOptionBuilder.feedTitleTextColor(Color.parseColor(
|
|
115
|
+
if (!titleTextColor.isNullOrBlank()) {
|
|
116
|
+
titleOptionBuilder.feedTitleTextColor(Color.parseColor(titleTextColor))
|
|
102
117
|
}
|
|
103
|
-
if (
|
|
104
|
-
titleOptionBuilder.feedTitleTextSize(FWCommonUtil.spToPx(
|
|
118
|
+
if (titleFontSize != null && titleFontSize > 0) {
|
|
119
|
+
titleOptionBuilder.feedTitleTextSize(FWCommonUtil.spToPx(titleFontSize.toFloat(), context))
|
|
105
120
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
121
|
+
typeface?.let {
|
|
122
|
+
titleOptionBuilder.feedTitleTextTypeface(it)
|
|
123
|
+
}
|
|
124
|
+
if (!titleBackgroundColor.isNullOrBlank()) {
|
|
125
|
+
titleOptionBuilder.feedTitleBackgroundColor(Color.parseColor(titleBackgroundColor))
|
|
126
|
+
}
|
|
127
|
+
if (titleGradientDrawable != null) {
|
|
128
|
+
val orientation = titleGradientDrawable.orientation
|
|
129
|
+
val colors = titleGradientDrawable.colors
|
|
130
|
+
if (orientation != null && !colors.isNullOrEmpty()) {
|
|
131
|
+
var gradientDrawableOrientation = GradientDrawable.Orientation.LEFT_RIGHT
|
|
132
|
+
when {
|
|
133
|
+
orientation === FWGradientDrawableOrientation.TOP_BOTTOM -> {
|
|
134
|
+
gradientDrawableOrientation = GradientDrawable.Orientation.TOP_BOTTOM
|
|
135
|
+
}
|
|
136
|
+
orientation === FWGradientDrawableOrientation.TR_BL -> {
|
|
137
|
+
gradientDrawableOrientation = GradientDrawable.Orientation.TR_BL
|
|
138
|
+
}
|
|
139
|
+
orientation === FWGradientDrawableOrientation.RIGHT_LEFT -> {
|
|
140
|
+
gradientDrawableOrientation = GradientDrawable.Orientation.RIGHT_LEFT
|
|
141
|
+
}
|
|
142
|
+
orientation === FWGradientDrawableOrientation.BR_TL -> {
|
|
143
|
+
gradientDrawableOrientation = GradientDrawable.Orientation.BR_TL
|
|
144
|
+
}
|
|
145
|
+
orientation === FWGradientDrawableOrientation.BOTTOM_TOP -> {
|
|
146
|
+
gradientDrawableOrientation = GradientDrawable.Orientation.BOTTOM_TOP
|
|
130
147
|
}
|
|
148
|
+
orientation === FWGradientDrawableOrientation.BL_TR -> {
|
|
149
|
+
gradientDrawableOrientation = GradientDrawable.Orientation.BL_TR
|
|
150
|
+
}
|
|
151
|
+
orientation === FWGradientDrawableOrientation.LEFT_RIGHT -> {
|
|
152
|
+
gradientDrawableOrientation = GradientDrawable.Orientation.BL_TR
|
|
153
|
+
}
|
|
154
|
+
orientation === FWGradientDrawableOrientation.TL_BR -> {
|
|
155
|
+
gradientDrawableOrientation = GradientDrawable.Orientation.TL_BR
|
|
156
|
+
}
|
|
157
|
+
else -> {}
|
|
131
158
|
}
|
|
132
|
-
|
|
159
|
+
val intColors = colors.map {
|
|
160
|
+
Color.parseColor(it)
|
|
161
|
+
}
|
|
162
|
+
titleOptionBuilder.feedTitleBackgroundDrawable(
|
|
163
|
+
GradientDrawable(
|
|
164
|
+
gradientDrawableOrientation,
|
|
165
|
+
intColors.toIntArray(),
|
|
166
|
+
)
|
|
167
|
+
)
|
|
133
168
|
}
|
|
134
169
|
}
|
|
135
170
|
}
|
|
136
171
|
|
|
137
172
|
when (videoFeedPropsModel.videoFeedConfiguration?.titlePosition) {
|
|
138
|
-
FWVideoFeedTitlePosition.Nested
|
|
173
|
+
FWVideoFeedTitlePosition.Nested -> {
|
|
139
174
|
layoutOptionBuilder.feedTitlePosition(FeedTitlePosition.NESTED)
|
|
140
175
|
}
|
|
141
|
-
FWVideoFeedTitlePosition.Stacked
|
|
176
|
+
FWVideoFeedTitlePosition.Stacked -> {
|
|
142
177
|
layoutOptionBuilder.feedTitlePosition(FeedTitlePosition.STACKED)
|
|
143
178
|
}
|
|
144
179
|
else -> {}
|
|
@@ -149,7 +184,7 @@ object FWConfigUtil {
|
|
|
149
184
|
val hidden = playIcon.hidden
|
|
150
185
|
val iconWidth = playIcon.iconWidth
|
|
151
186
|
layoutOptionBuilder.showPlayIcon(hidden != true)
|
|
152
|
-
if (iconWidth != null && iconWidth
|
|
187
|
+
if (iconWidth != null && iconWidth >= 0) {
|
|
153
188
|
layoutOptionBuilder.playIconWidth(FWCommonUtil.dpToPx(iconWidth.toFloat(), context))
|
|
154
189
|
}
|
|
155
190
|
}
|
|
@@ -163,11 +198,12 @@ object FWConfigUtil {
|
|
|
163
198
|
val adBadgeTextType = adBadgeConfigModel.badgeTextType
|
|
164
199
|
val adBadgeBackgroundColor = adBadgeConfigModel.backgroundColor
|
|
165
200
|
val adBadgeTextColor = adBadgeConfigModel.textColor
|
|
201
|
+
val adBadgeTypeface = getTypeface(context, adBadgeConfigModel.fontInfo)
|
|
166
202
|
when (adBadgeTextType) {
|
|
167
|
-
|
|
203
|
+
FWBadgeTextType.Ad -> {
|
|
168
204
|
adBadgeOptionBuilder.adBadgeLabel(AdBadgeTextType.AD)
|
|
169
205
|
}
|
|
170
|
-
|
|
206
|
+
FWBadgeTextType.Sponsored -> {
|
|
171
207
|
adBadgeOptionBuilder.adBadgeLabel(AdBadgeTextType.SPONSORED)
|
|
172
208
|
}
|
|
173
209
|
else -> {}
|
|
@@ -178,6 +214,9 @@ object FWConfigUtil {
|
|
|
178
214
|
if (!adBadgeTextColor.isNullOrBlank()) {
|
|
179
215
|
adBadgeOptionBuilder.adBadgeTextColor(Color.parseColor(adBadgeTextColor))
|
|
180
216
|
}
|
|
217
|
+
adBadgeTypeface?.let {
|
|
218
|
+
adBadgeOptionBuilder.adBadgeTypeface(it)
|
|
219
|
+
}
|
|
181
220
|
|
|
182
221
|
val enableAutoplay = videoFeedPropsModel.videoFeedConfiguration?.enableAutoplay
|
|
183
222
|
enableAutoplay?.let {
|
|
@@ -193,33 +232,34 @@ object FWConfigUtil {
|
|
|
193
232
|
playerOptionBuilder.shareBaseUrl(it)
|
|
194
233
|
}
|
|
195
234
|
|
|
196
|
-
|
|
197
|
-
playerOptionBuilder.sdkHandleCtaButtonClick(false)
|
|
198
|
-
} else {
|
|
199
|
-
playerOptionBuilder.sdkHandleCtaButtonClick(!FWGlobalDataUtil.customCTAClickEnabled)
|
|
200
|
-
}
|
|
235
|
+
playerOptionBuilder.sdkHandleCtaButtonClick(!FWGlobalDataUtil.customCTAClickEnabled)
|
|
201
236
|
|
|
202
237
|
val gridColumns = videoFeedPropsModel.videoFeedConfiguration?.gridColumns
|
|
203
238
|
if (gridColumns != null && gridColumns > 0) {
|
|
204
239
|
layoutOptionBuilder.columnCount(gridColumns)
|
|
205
240
|
}
|
|
206
241
|
|
|
242
|
+
val itemSpacing = videoFeedPropsModel.videoFeedConfiguration?.itemSpacing
|
|
243
|
+
if (itemSpacing != null && itemSpacing >= 0) {
|
|
244
|
+
layoutOptionBuilder.itemSpacing(FWCommonUtil.dpToPx(itemSpacing.toFloat(), context) / 2)
|
|
245
|
+
}
|
|
246
|
+
|
|
207
247
|
// player config
|
|
208
248
|
when (videoFeedPropsModel.videoPlayerConfiguration?.playerStyle) {
|
|
209
|
-
|
|
249
|
+
FWPlayerStyle.Fit -> {
|
|
210
250
|
playerOptionBuilder.playerMode(PlayerMode.FIT_MODE)
|
|
211
251
|
}
|
|
212
|
-
|
|
252
|
+
FWPlayerStyle.Full -> {
|
|
213
253
|
playerOptionBuilder.playerMode(PlayerMode.FULL_BLEED_MODE)
|
|
214
254
|
}
|
|
215
255
|
else -> {}
|
|
216
256
|
}
|
|
217
257
|
|
|
218
258
|
when (videoFeedPropsModel.videoPlayerConfiguration?.videoCompleteAction) {
|
|
219
|
-
|
|
259
|
+
FWVideoCompleteAction.Loop -> {
|
|
220
260
|
playerOptionBuilder.autoPlayOnComplete(false)
|
|
221
261
|
}
|
|
222
|
-
|
|
262
|
+
FWVideoCompleteAction.AdvanceToNext -> {
|
|
223
263
|
playerOptionBuilder.autoPlayOnComplete(true)
|
|
224
264
|
}
|
|
225
265
|
else -> {}
|
|
@@ -235,34 +275,30 @@ object FWConfigUtil {
|
|
|
235
275
|
playerOptionBuilder.enablePipMode(it)
|
|
236
276
|
}
|
|
237
277
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
val fontSize = style.fontSize
|
|
242
|
-
val textColor = style.textColor
|
|
243
|
-
if (!ctaButtonBg.isNullOrBlank()) {
|
|
244
|
-
// viewOptionsBuilder.ctaButtonBackgroundColor(Color.parseColor(ctaButtonBg))
|
|
278
|
+
when (videoFeedPropsModel.videoPlayerConfiguration?.ctaWidth) {
|
|
279
|
+
FWVideoPlayerCTAWidth.FullWidth -> {
|
|
280
|
+
ctaOptionBuilder.ctaMode(CtaOption.CtaMode.FULL_WIDTH)
|
|
245
281
|
}
|
|
246
|
-
|
|
247
|
-
|
|
282
|
+
FWVideoPlayerCTAWidth.Compact -> {
|
|
283
|
+
ctaOptionBuilder.ctaMode(CtaOption.CtaMode.COMPACT)
|
|
248
284
|
}
|
|
249
|
-
|
|
250
|
-
|
|
285
|
+
FWVideoPlayerCTAWidth.SizeToFit -> {
|
|
286
|
+
ctaOptionBuilder.ctaMode(CtaOption.CtaMode.SIZE_TO_FIT)
|
|
251
287
|
}
|
|
288
|
+
else -> {}
|
|
252
289
|
}
|
|
253
290
|
|
|
254
291
|
val ctaDelay = videoFeedPropsModel.videoPlayerConfiguration?.ctaDelay
|
|
255
292
|
ctaDelay?.let { delay ->
|
|
256
|
-
delay.type ?: return@let
|
|
257
293
|
delay.value ?: return@let
|
|
258
294
|
|
|
259
295
|
when (delay.type) {
|
|
260
|
-
|
|
296
|
+
FWCtaDelayType.Constant -> {
|
|
261
297
|
ctaOptionBuilder.ctaDelay(
|
|
262
298
|
CtaDelay(delay.value.toFloat(), CtaDelayUnit.SECONDS)
|
|
263
299
|
)
|
|
264
300
|
}
|
|
265
|
-
|
|
301
|
+
FWCtaDelayType.Percentage -> {
|
|
266
302
|
ctaOptionBuilder.ctaDelay(
|
|
267
303
|
CtaDelay(delay.value.toFloat(), CtaDelayUnit.PERCENTAGE)
|
|
268
304
|
)
|
|
@@ -271,6 +307,25 @@ object FWConfigUtil {
|
|
|
271
307
|
}
|
|
272
308
|
}
|
|
273
309
|
|
|
310
|
+
val ctaHighlightDelay = videoFeedPropsModel.videoPlayerConfiguration?.ctaHighlightDelay
|
|
311
|
+
ctaHighlightDelay?.let { delay ->
|
|
312
|
+
delay.value ?: return@let
|
|
313
|
+
|
|
314
|
+
when (delay.type) {
|
|
315
|
+
FWCtaDelayType.Constant -> {
|
|
316
|
+
ctaOptionBuilder.ctaHighlightDelay(
|
|
317
|
+
CtaDelay(delay.value.toFloat(), CtaDelayUnit.SECONDS)
|
|
318
|
+
)
|
|
319
|
+
}
|
|
320
|
+
FWCtaDelayType.Percentage -> {
|
|
321
|
+
ctaOptionBuilder.ctaHighlightDelay(
|
|
322
|
+
CtaDelay(delay.value.toFloat(), CtaDelayUnit.PERCENTAGE)
|
|
323
|
+
)
|
|
324
|
+
}
|
|
325
|
+
else -> {}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
274
329
|
val showMuteButton = videoFeedPropsModel.videoPlayerConfiguration?.showMuteButton
|
|
275
330
|
showMuteButton?.let {
|
|
276
331
|
playerOptionBuilder.showMuteButton(it)
|
|
@@ -278,15 +333,7 @@ object FWConfigUtil {
|
|
|
278
333
|
|
|
279
334
|
val showPlaybackButton = videoFeedPropsModel.videoPlayerConfiguration?.showPlaybackButton
|
|
280
335
|
showPlaybackButton?.let {
|
|
281
|
-
playerOptionBuilder.
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
when (videoFeedPropsModel.videoPlayerConfiguration?.launchBehavior) {
|
|
285
|
-
FWVideoPlayerConstant.FW_PLAYER_LAUNCH_BEHAVIOR_DEFAULT -> {}
|
|
286
|
-
FWVideoPlayerConstant.FW_PLAYER_LAUNCH_BEHAVIOR_MUTE_ON_FIRST_LAUNCH -> {
|
|
287
|
-
// viewOptionsBuilder.muteOnLaunch(true)
|
|
288
|
-
}
|
|
289
|
-
else -> {}
|
|
336
|
+
playerOptionBuilder.showPlayPauseButtonInReplay(it)
|
|
290
337
|
}
|
|
291
338
|
|
|
292
339
|
val showBranding = videoFeedPropsModel.videoPlayerConfiguration?.showBranding
|
|
@@ -301,6 +348,7 @@ object FWConfigUtil {
|
|
|
301
348
|
.baseOption(baseOptionBuilder.build())
|
|
302
349
|
.adBadgeOption(adBadgeOptionBuilder.build())
|
|
303
350
|
.ctaOption(ctaOptionBuilder.build())
|
|
351
|
+
.adOption(adOptionBuilder.build())
|
|
304
352
|
}
|
|
305
353
|
|
|
306
354
|
private fun getDefaultLayoutOptionBuilder(): LayoutOption.Builder {
|
|
@@ -330,4 +378,35 @@ object FWConfigUtil {
|
|
|
330
378
|
return CtaOption.Builder()
|
|
331
379
|
}
|
|
332
380
|
|
|
381
|
+
private fun getDefaultAdOptionBuilder(): AdOption.Builder {
|
|
382
|
+
return AdOption.Builder()
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
private fun getTypeface(context: Context, font: FWFontInfoModel?): Typeface? {
|
|
386
|
+
val typefaceName = font?.typefaceName
|
|
387
|
+
typefaceName ?: return null
|
|
388
|
+
|
|
389
|
+
var typeface = Typeface.DEFAULT
|
|
390
|
+
if (font.isCustom == true) {
|
|
391
|
+
typeface = Typeface.createFromAsset(context.assets, typefaceName.rawValue)
|
|
392
|
+
} else {
|
|
393
|
+
when (typefaceName) {
|
|
394
|
+
FWSystemTypeface.DefaultBold -> {
|
|
395
|
+
typeface = Typeface.DEFAULT_BOLD
|
|
396
|
+
}
|
|
397
|
+
FWSystemTypeface.SansSerif -> {
|
|
398
|
+
typeface = Typeface.SANS_SERIF
|
|
399
|
+
}
|
|
400
|
+
FWSystemTypeface.Serif -> {
|
|
401
|
+
typeface = Typeface.SERIF
|
|
402
|
+
}
|
|
403
|
+
FWSystemTypeface.Monospace -> {
|
|
404
|
+
typeface = Typeface.MONOSPACE
|
|
405
|
+
}
|
|
406
|
+
else -> {}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
return typeface
|
|
410
|
+
}
|
|
411
|
+
|
|
333
412
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.utils
|
|
2
|
+
|
|
3
|
+
import androidx.fragment.app.Fragment
|
|
4
|
+
import androidx.fragment.app.FragmentActivity
|
|
5
|
+
|
|
6
|
+
object FWFragmentUtil {
|
|
7
|
+
|
|
8
|
+
fun removeFragmentsFromActivity(fragmentActivity: FragmentActivity?) {
|
|
9
|
+
fragmentActivity ?: return
|
|
10
|
+
val fragments = fragmentActivity.supportFragmentManager.fragments
|
|
11
|
+
for (f in fragments) {
|
|
12
|
+
removeFragment(fragmentActivity, f)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
fun removeFragment(fragmentActivity: FragmentActivity?, fragment: Fragment?, includeChildren: Boolean = true) {
|
|
17
|
+
fragmentActivity ?: return
|
|
18
|
+
|
|
19
|
+
fragment ?: return
|
|
20
|
+
if (!fragment.isAdded || fragment.isDetached || fragment.isRemoving) {
|
|
21
|
+
return
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (includeChildren) {
|
|
25
|
+
removeChildFragment(fragment)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
fragmentActivity.supportFragmentManager.beginTransaction().remove(fragment).commit()
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
private fun removeChildFragment(fragment: Fragment?) {
|
|
32
|
+
fragment ?: return
|
|
33
|
+
if (!fragment.isAdded || fragment.isDetached || fragment.isRemoving) {
|
|
34
|
+
return
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
val cfm = fragment.childFragmentManager
|
|
38
|
+
val fragments = cfm.fragments
|
|
39
|
+
if (fragments.isEmpty()) {
|
|
40
|
+
return
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
for (f in fragments) {
|
|
44
|
+
removeChildFragment(f)
|
|
45
|
+
if (!fragment.isAdded || fragment.isDetached || fragment.isRemoving) {
|
|
46
|
+
continue
|
|
47
|
+
}
|
|
48
|
+
cfm.beginTransaction().remove(f).commit()
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
package com.fireworksdk.bridge.utils
|
|
2
2
|
|
|
3
|
-
import com.fireworksdk.bridge.components.
|
|
3
|
+
import com.fireworksdk.bridge.components.storyblock.StoryBlockFragment
|
|
4
4
|
import com.fireworksdk.bridge.models.FWAdBadgeConfigModel
|
|
5
5
|
import com.fireworksdk.bridge.models.weakProperty
|
|
6
6
|
|
|
@@ -17,8 +17,4 @@ object FWGlobalDataUtil {
|
|
|
17
17
|
var storyBlockFragment by weakProperty<StoryBlockFragment?>()
|
|
18
18
|
|
|
19
19
|
var shareBaseUrl: String? = null
|
|
20
|
-
|
|
21
|
-
var appComponentName: String? = null
|
|
22
|
-
|
|
23
|
-
var customCTALinkContentPageRouteName: String? = null
|
|
24
20
|
}
|