@wscsports/blaze-rtn-sdk 1.2.2 → 1.4.4

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.
Files changed (214) hide show
  1. package/android/build.gradle +16 -8
  2. package/android/src/main/java/com/blaze/rtnblazesdk/BlazeSdkModule.kt +145 -42
  3. package/android/src/main/java/com/blaze/rtnblazesdk/BlazeSdkPackage.kt +17 -7
  4. package/android/src/main/java/com/blaze/rtnblazesdk/ads/BlazeRTNContentExtraInfo.kt +20 -0
  5. package/android/src/main/java/com/blaze/rtnblazesdk/base/BaseWidgetView.kt +2 -2
  6. package/android/src/main/java/com/blaze/rtnblazesdk/base/BlazeWidgetViewManager.kt +6 -16
  7. package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactCommonMerger.kt +42 -0
  8. package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactMomentPlayerStyleMerger.kt +10 -57
  9. package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactMomentsPlayerStyle.kt +5 -29
  10. package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactStoriesPlayerStyleMerger.kt +3 -27
  11. package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactStoryPlayerStyle.kt +3 -14
  12. package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactVideosPlayerStyle.kt +90 -0
  13. package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactVideosPlayerStyleMerger.kt +147 -0
  14. package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactWidgetCommon.kt +11 -0
  15. package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactWidgetStylesOverridesMerger.kt +0 -16
  16. package/android/src/main/java/com/blaze/rtnblazesdk/events/WidgetCTAClickEvent.kt +2 -1
  17. package/android/src/main/java/com/blaze/rtnblazesdk/events/WidgetDataLoadCompletedEvent.kt +2 -2
  18. package/android/src/main/java/com/blaze/rtnblazesdk/events/WidgetDataLoadStartedEvent.kt +2 -1
  19. package/android/src/main/java/com/blaze/rtnblazesdk/events/WidgetHeightChangedEvent.kt +2 -1
  20. package/android/src/main/java/com/blaze/rtnblazesdk/events/WidgetItemClickedEvent.kt +2 -1
  21. package/android/src/main/java/com/blaze/rtnblazesdk/events/WidgetOnPlayerEventTriggered.kt +2 -1
  22. package/android/src/main/java/com/blaze/rtnblazesdk/events/WidgetOnTriggerPlayerBodyTextLinkEvent.kt +2 -1
  23. package/android/src/main/java/com/blaze/rtnblazesdk/events/WidgetPlayerDidAppearEvent.kt +2 -1
  24. package/android/src/main/java/com/blaze/rtnblazesdk/events/WidgetPlayerDismissedEvent.kt +2 -1
  25. package/android/src/main/java/com/blaze/rtnblazesdk/moments/BlazeMomentsGridView.kt +2 -4
  26. package/android/src/main/java/com/blaze/rtnblazesdk/moments/BlazeMomentsRowView.kt +2 -5
  27. package/android/src/main/java/com/blaze/rtnblazesdk/shared/BlazeAsyncBridgeExtensions.kt +17 -0
  28. package/android/src/main/java/com/blaze/rtnblazesdk/shared/BlazeAsyncBridgeModule.kt +319 -0
  29. package/android/src/main/java/com/blaze/rtnblazesdk/stories/BlazeStoriesGridView.kt +2 -4
  30. package/android/src/main/java/com/blaze/rtnblazesdk/stories/BlazeStoriesRowView.kt +4 -6
  31. package/android/src/main/java/com/blaze/rtnblazesdk/utils/DataSourceTypeExtractUtils.kt +55 -2
  32. package/android/src/main/java/com/blaze/rtnblazesdk/utils/GeneralExtractExtensions.kt +56 -0
  33. package/android/src/main/java/com/blaze/rtnblazesdk/utils/PlayerThemeExtractUtils.kt +10 -0
  34. package/android/src/main/java/com/blaze/rtnblazesdk/utils/parsing/GsonUtils.kt +152 -25
  35. package/android/src/main/java/com/blaze/rtnblazesdk/utils/parsing/NullableTypeAdapterFactory.kt +60 -0
  36. package/android/src/main/java/com/blaze/rtnblazesdk/videos/BlazeVideosGridView.kt +103 -0
  37. package/android/src/main/java/com/blaze/rtnblazesdk/videos/BlazeVideosGridViewManager.kt +26 -0
  38. package/android/src/main/java/com/blaze/rtnblazesdk/videos/BlazeVideosRowView.kt +102 -0
  39. package/android/src/main/java/com/blaze/rtnblazesdk/videos/BlazeVideosRowViewManager.kt +24 -0
  40. package/blaze-rtn-sdk.podspec +1 -1
  41. package/ios/Sources/Ads/BlazeRTNContentExtraInfo.swift +26 -0
  42. package/ios/Sources/BlazeNativeSDKModule/BlazeNativeSDKModule.m +15 -0
  43. package/ios/Sources/BlazeNativeSDKModule/BlazeNativeSDKModule.swift +94 -4
  44. package/ios/Sources/BlazeVideosGridWidgetManager/BlazeVideosGridWidgetManager.m +8 -0
  45. package/ios/Sources/BlazeVideosGridWidgetManager/BlazeVideosGridWidgetManager.swift +16 -0
  46. package/ios/Sources/BlazeVideosRowWidgetManager/BlazeVideosRowWidgetManager.m +8 -0
  47. package/ios/Sources/BlazeVideosRowWidgetManager/BlazeVideosRowWidgetManager.swift +14 -0
  48. package/ios/Sources/LayoutCustomization/FirstTimeSlide/BlazeReactFirstTimeSlideStyle.swift +27 -0
  49. package/ios/Sources/LayoutCustomization/FirstTimeSlide/BlazeReactFirstTimeSlideStyleMerger.swift +77 -0
  50. package/ios/Sources/LayoutCustomization/MomentsPlayer/BlazeReactMomentsPlayerStyle.swift +137 -0
  51. package/ios/Sources/LayoutCustomization/MomentsPlayer/BlazeReactMomentsPlayerStyleMerger.swift +321 -0
  52. package/ios/Sources/LayoutCustomization/Shared/SharedStyleModels.swift +73 -0
  53. package/ios/Sources/LayoutCustomization/Shared/SharedStyleModelsMerger.swift +95 -0
  54. package/ios/Sources/LayoutCustomization/StoriesPlayer/BlazeReactStoriesPlayerStyle.swift +94 -0
  55. package/ios/Sources/LayoutCustomization/StoriesPlayer/BlazeReactStoriesPlayerStyleMerger.swift +157 -0
  56. package/ios/Sources/LayoutCustomization/VideoPlayer/BlazeReactVideosPlayerStyle.swift +59 -0
  57. package/ios/Sources/LayoutCustomization/VideoPlayer/BlazeReactVideosPlayerStyleMerger.swift +150 -0
  58. package/ios/Sources/LayoutCustomization/WidgetLayout/BlazeReactWidgetLayout.swift +219 -0
  59. package/ios/Sources/LayoutCustomization/WidgetLayout/BlazeReactWidgetLayoutMerger.swift +417 -0
  60. package/ios/Sources/Shared/BlazeAsyncBridgeModule.swift +306 -0
  61. package/ios/Sources/Utils/AsyncAwait+Extensions.swift +52 -0
  62. package/ios/Sources/Utils/BlazeReactParamsParser.swift +182 -5
  63. package/ios/Sources/Utils/Encodable+Extensions.swift +118 -0
  64. package/ios/Sources/Utils/Logger.swift +12 -0
  65. package/ios/Sources/Utils/PlayerStyleExtractUtils.swift +7 -0
  66. package/ios/Sources/Widgets/Base/BlazeWidgetBase.swift +2 -0
  67. package/ios/Sources/Widgets/Base/BlazeWidgetViewManagerBase.h +5 -2
  68. package/ios/Sources/Widgets/BlazeMomentsGridWidget.swift +7 -9
  69. package/ios/Sources/Widgets/BlazeMomentsRowWidget.swift +7 -9
  70. package/ios/Sources/Widgets/BlazeStoriesGridWidget.swift +7 -9
  71. package/ios/Sources/Widgets/BlazeStoriesRowWidget.swift +6 -8
  72. package/ios/Sources/Widgets/BlazeVideosGridWidget.swift +34 -0
  73. package/ios/Sources/Widgets/BlazeVideosRowWidget.swift +33 -0
  74. package/lib/commonjs/NativeBlazeSdk.js +9 -0
  75. package/lib/commonjs/NativeBlazeSdk.js.map +1 -1
  76. package/lib/commonjs/classes/blaze-widget-overrides-styles.js.map +1 -1
  77. package/lib/commonjs/classes/entry-point-delegate.js +15 -15
  78. package/lib/commonjs/classes/entry-point-delegate.js.map +1 -1
  79. package/lib/commonjs/classes/global-delegate.js +5 -5
  80. package/lib/commonjs/classes/global-delegate.js.map +1 -1
  81. package/lib/commonjs/index.js +29 -0
  82. package/lib/commonjs/index.js.map +1 -1
  83. package/lib/commonjs/interfaces/blaze-analytics.interface.js +57 -6
  84. package/lib/commonjs/interfaces/blaze-analytics.interface.js.map +1 -1
  85. package/lib/commonjs/interfaces/index.js +30 -8
  86. package/lib/commonjs/interfaces/index.js.map +1 -1
  87. package/lib/commonjs/interfaces/{widget-story-theme.interface.js → moments-player-style.js} +1 -1
  88. package/lib/commonjs/interfaces/moments-player-style.js.map +1 -0
  89. package/lib/commonjs/interfaces/{widget-moment-theme.interface.js → stories-player-style.js} +1 -1
  90. package/lib/commonjs/interfaces/stories-player-style.js.map +1 -0
  91. package/lib/commonjs/interfaces/videos-player-style.js +6 -0
  92. package/lib/commonjs/interfaces/videos-player-style.js.map +1 -0
  93. package/lib/commonjs/interfaces/widget-presets.js +2 -0
  94. package/lib/commonjs/interfaces/widget-presets.js.map +1 -0
  95. package/lib/commonjs/shared/BlazeAsyncBridge.js +113 -0
  96. package/lib/commonjs/shared/BlazeAsyncBridge.js.map +1 -0
  97. package/lib/commonjs/{classes/RegisterGlobalEvents.js → shared/BlazeGlobalEvents.js} +4 -4
  98. package/lib/commonjs/shared/BlazeGlobalEvents.js.map +1 -0
  99. package/lib/commonjs/shared/ads/ads-shared.js +41 -0
  100. package/lib/commonjs/shared/ads/ads-shared.js.map +1 -0
  101. package/lib/commonjs/widgets/BlazeVideosGridView.js +35 -0
  102. package/lib/commonjs/widgets/BlazeVideosGridView.js.map +1 -0
  103. package/lib/commonjs/widgets/BlazeVideosRowView.js +27 -0
  104. package/lib/commonjs/widgets/BlazeVideosRowView.js.map +1 -0
  105. package/lib/module/NativeBlazeSdk.js +9 -0
  106. package/lib/module/NativeBlazeSdk.js.map +1 -1
  107. package/lib/module/classes/blaze-widget-overrides-styles.js.map +1 -1
  108. package/lib/module/classes/entry-point-delegate.js +15 -15
  109. package/lib/module/classes/entry-point-delegate.js.map +1 -1
  110. package/lib/module/classes/global-delegate.js +5 -5
  111. package/lib/module/classes/global-delegate.js.map +1 -1
  112. package/lib/module/index.js +5 -0
  113. package/lib/module/index.js.map +1 -1
  114. package/lib/module/interfaces/blaze-analytics.interface.js +56 -5
  115. package/lib/module/interfaces/blaze-analytics.interface.js.map +1 -1
  116. package/lib/module/interfaces/index.js +4 -2
  117. package/lib/module/interfaces/index.js.map +1 -1
  118. package/lib/module/interfaces/moments-player-style.js +2 -0
  119. package/lib/module/interfaces/moments-player-style.js.map +1 -0
  120. package/lib/module/interfaces/stories-player-style.js +2 -0
  121. package/lib/module/interfaces/stories-player-style.js.map +1 -0
  122. package/lib/module/interfaces/videos-player-style.js +2 -0
  123. package/lib/module/interfaces/videos-player-style.js.map +1 -0
  124. package/lib/module/interfaces/widget-presets.js +2 -0
  125. package/lib/module/interfaces/widget-presets.js.map +1 -0
  126. package/lib/module/shared/BlazeAsyncBridge.js +107 -0
  127. package/lib/module/shared/BlazeAsyncBridge.js.map +1 -0
  128. package/lib/module/{classes/RegisterGlobalEvents.js → shared/BlazeGlobalEvents.js} +2 -2
  129. package/lib/module/shared/BlazeGlobalEvents.js.map +1 -0
  130. package/lib/module/shared/ads/ads-shared.js +37 -0
  131. package/lib/module/shared/ads/ads-shared.js.map +1 -0
  132. package/lib/module/widgets/BlazeVideosGridView.js +27 -0
  133. package/lib/module/widgets/BlazeVideosGridView.js.map +1 -0
  134. package/lib/module/widgets/BlazeVideosRowView.js +19 -0
  135. package/lib/module/widgets/BlazeVideosRowView.js.map +1 -0
  136. package/lib/typescript/NativeBlazeSdk.d.ts +4 -1
  137. package/lib/typescript/NativeBlazeSdk.d.ts.map +1 -1
  138. package/lib/typescript/classes/blaze-widget-overrides-styles.d.ts +1 -1
  139. package/lib/typescript/classes/blaze-widget-overrides-styles.d.ts.map +1 -1
  140. package/lib/typescript/index.d.ts +6 -1
  141. package/lib/typescript/index.d.ts.map +1 -1
  142. package/lib/typescript/interfaces/actions-options.interface.d.ts +25 -2
  143. package/lib/typescript/interfaces/actions-options.interface.d.ts.map +1 -1
  144. package/lib/typescript/interfaces/blaze-analytics.interface.d.ts +117 -9
  145. package/lib/typescript/interfaces/blaze-analytics.interface.d.ts.map +1 -1
  146. package/lib/typescript/interfaces/common.interface.d.ts +11 -0
  147. package/lib/typescript/interfaces/common.interface.d.ts.map +1 -1
  148. package/lib/typescript/interfaces/index.d.ts +4 -2
  149. package/lib/typescript/interfaces/index.d.ts.map +1 -1
  150. package/lib/typescript/interfaces/init-options.interface.d.ts +4 -2
  151. package/lib/typescript/interfaces/init-options.interface.d.ts.map +1 -1
  152. package/lib/typescript/interfaces/{widget-moment-theme.interface.d.ts → moments-player-style.d.ts} +2 -13
  153. package/lib/typescript/interfaces/moments-player-style.d.ts.map +1 -0
  154. package/lib/typescript/interfaces/{widget-story-theme.interface.d.ts → stories-player-style.d.ts} +2 -2
  155. package/lib/typescript/interfaces/stories-player-style.d.ts.map +1 -0
  156. package/lib/typescript/interfaces/videos-player-style.d.ts +56 -0
  157. package/lib/typescript/interfaces/videos-player-style.d.ts.map +1 -0
  158. package/lib/typescript/interfaces/widget-layout.interface.d.ts +22 -0
  159. package/lib/typescript/interfaces/widget-layout.interface.d.ts.map +1 -1
  160. package/lib/typescript/interfaces/widget-presets.d.ts +75 -0
  161. package/lib/typescript/interfaces/widget-presets.d.ts.map +1 -0
  162. package/lib/typescript/interfaces/widgets-props.interface.d.ts +27 -2
  163. package/lib/typescript/interfaces/widgets-props.interface.d.ts.map +1 -1
  164. package/lib/typescript/shared/BlazeAsyncBridge.d.ts +17 -0
  165. package/lib/typescript/shared/BlazeAsyncBridge.d.ts.map +1 -0
  166. package/lib/typescript/{classes/RegisterGlobalEvents.d.ts → shared/BlazeGlobalEvents.d.ts} +2 -2
  167. package/lib/typescript/shared/BlazeGlobalEvents.d.ts.map +1 -0
  168. package/lib/typescript/shared/ads/ads-shared.d.ts +42 -0
  169. package/lib/typescript/shared/ads/ads-shared.d.ts.map +1 -0
  170. package/lib/typescript/widgets/BlazeBaseWidgetViewProps.d.ts +7 -5
  171. package/lib/typescript/widgets/BlazeBaseWidgetViewProps.d.ts.map +1 -1
  172. package/lib/typescript/widgets/BlazeVideosGridView.d.ts +11 -0
  173. package/lib/typescript/widgets/BlazeVideosGridView.d.ts.map +1 -0
  174. package/lib/typescript/widgets/BlazeVideosRowView.d.ts +11 -0
  175. package/lib/typescript/widgets/BlazeVideosRowView.d.ts.map +1 -0
  176. package/package.json +4 -4
  177. package/src/NativeBlazeSdk.tsx +21 -0
  178. package/src/classes/blaze-widget-overrides-styles.tsx +8 -1
  179. package/src/classes/entry-point-delegate.tsx +22 -22
  180. package/src/classes/global-delegate.tsx +9 -9
  181. package/src/index.tsx +12 -5
  182. package/src/interfaces/actions-options.interface.tsx +31 -2
  183. package/src/interfaces/blaze-analytics.interface.tsx +113 -10
  184. package/src/interfaces/common.interface.tsx +13 -1
  185. package/src/interfaces/index.tsx +4 -2
  186. package/src/interfaces/init-options.interface.tsx +8 -6
  187. package/src/interfaces/{widget-moment-theme.interface.tsx → moments-player-style.tsx} +12 -23
  188. package/src/interfaces/{widget-story-theme.interface.tsx → stories-player-style.tsx} +2 -2
  189. package/src/interfaces/videos-player-style.tsx +74 -0
  190. package/src/interfaces/widget-layout.interface.tsx +27 -0
  191. package/src/interfaces/widget-presets.tsx +79 -0
  192. package/src/interfaces/widgets-props.interface.tsx +41 -5
  193. package/src/shared/BlazeAsyncBridge.tsx +160 -0
  194. package/src/{classes/RegisterGlobalEvents.tsx → shared/BlazeGlobalEvents.tsx} +2 -2
  195. package/src/shared/ads/ads-shared.tsx +43 -0
  196. package/src/widgets/BlazeBaseWidgetViewProps.tsx +10 -6
  197. package/src/widgets/BlazeVideosGridView.tsx +66 -0
  198. package/src/widgets/BlazeVideosRowView.tsx +56 -0
  199. package/android/src/main/java/com/blaze/rtnblazesdk/events/BaseEvent.kt +0 -14
  200. package/ios/Sources/LayoutCustomization/BlazeReactLayoutMerger.swift +0 -1001
  201. package/ios/Sources/LayoutCustomization/BlazeReactWidgetLayout.swift +0 -507
  202. package/ios/Sources/Widgets/Base/BlazeWidgetMomentsBase.swift +0 -15
  203. package/ios/Sources/Widgets/Base/BlazeWidgetStoriesBase.swift +0 -14
  204. package/lib/commonjs/classes/RegisterGlobalEvents.js.map +0 -1
  205. package/lib/commonjs/interfaces/widget-moment-theme.interface.js.map +0 -1
  206. package/lib/commonjs/interfaces/widget-story-theme.interface.js.map +0 -1
  207. package/lib/module/classes/RegisterGlobalEvents.js.map +0 -1
  208. package/lib/module/interfaces/widget-moment-theme.interface.js +0 -2
  209. package/lib/module/interfaces/widget-moment-theme.interface.js.map +0 -1
  210. package/lib/module/interfaces/widget-story-theme.interface.js +0 -2
  211. package/lib/module/interfaces/widget-story-theme.interface.js.map +0 -1
  212. package/lib/typescript/classes/RegisterGlobalEvents.d.ts.map +0 -1
  213. package/lib/typescript/interfaces/widget-moment-theme.interface.d.ts.map +0 -1
  214. package/lib/typescript/interfaces/widget-story-theme.interface.d.ts.map +0 -1
@@ -1,11 +1,20 @@
1
1
  // android/build.gradle
2
2
 
3
3
  buildscript {
4
+ ext {
5
+ blaze_default_targetSdkVersion = 35
6
+ blaze_default_compileSdkVersion = 35
7
+ blaze_default_minSdkVersion = 24
8
+ blaze_default_kotlin_version = '2.0.21'
9
+ blazesdk_version = '1.10.3'
10
+ blaze_gson_version = '2.10.1'
11
+ }
12
+
4
13
  ext.safeExtGet = { prop, fallback ->
5
14
  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
6
15
  }
7
16
 
8
- ext.blaze_kotlin_version = safeExtGet('kotlinVersion', '1.7.20')
17
+ ext.blaze_kotlin_version = safeExtGet('kotlinVersion', blaze_default_kotlin_version)
9
18
 
10
19
  repositories {
11
20
  google()
@@ -22,7 +31,7 @@ apply plugin: 'com.android.library'
22
31
  apply plugin: 'kotlin-android'
23
32
 
24
33
  android {
25
- compileSdkVersion safeExtGet('compileSdkVersion', 34)
34
+ compileSdkVersion safeExtGet('compileSdkVersion', blaze_default_compileSdkVersion)
26
35
  namespace "com.blaze.rtnblazesdk"
27
36
 
28
37
  def versionJsonFile = file('../package.json')
@@ -30,8 +39,8 @@ android {
30
39
  def packageVersion = versionJson.version
31
40
 
32
41
  defaultConfig {
33
- minSdkVersion safeExtGet('minSdkVersion', 24)
34
- targetSdkVersion safeExtGet('targetSdkVersion', 34)
42
+ minSdkVersion safeExtGet('minSdkVersion', blaze_default_minSdkVersion)
43
+ targetSdkVersion safeExtGet('targetSdkVersion', blaze_default_targetSdkVersion)
35
44
  versionCode 1
36
45
  versionName packageVersion
37
46
 
@@ -74,14 +83,13 @@ repositories {
74
83
 
75
84
  dependencies {
76
85
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$blaze_kotlin_version"
86
+ implementation "org.jetbrains.kotlin:kotlin-reflect:$blaze_kotlin_version"
77
87
 
78
88
  // noinspection GradleDynamicVersion
79
89
  api 'com.facebook.react:react-native:+'
80
90
 
81
- def blazeSDK = '1.9.3'
82
- implementation group: "com.blaze", name: "blazesdk", version: "${blazeSDK}"
91
+ implementation group: "com.blaze", name: "blazesdk", version: "$blazesdk_version"
83
92
 
84
93
  // Gson.
85
- def GsonVersion = "2.10.1"
86
- implementation "com.google.code.gson:gson:$GsonVersion"
94
+ implementation "com.google.code.gson:gson:$blaze_gson_version"
87
95
  }
@@ -11,12 +11,15 @@ import com.blaze.blazesdk.external_modules.BlazeExternalModulesBinder
11
11
  import com.blaze.blazesdk.features.shared.models.ui_shared.BlazeLinkActionHandleType
12
12
  import com.blaze.blazesdk.prefetch.models.BlazeCachingLevel
13
13
  import com.blaze.blazesdk.shared.BlazeSDK
14
+ import com.blaze.blazesdk.shared.models.BlazeEntryPointTriggerSource
14
15
  import com.blaze.blazesdk.shared.results.BlazeResult
15
16
  import com.blaze.rtnblazesdk.events.SdkModuleJsEvent
16
17
  import com.blaze.rtnblazesdk.utils.extractCachingLevel
17
18
  import com.blaze.rtnblazesdk.utils.extractDataSource
18
19
  import com.blaze.rtnblazesdk.utils.extractMomentsPlayerStyle
19
20
  import com.blaze.rtnblazesdk.utils.extractStoriesPlayerStyle
21
+ import com.blaze.rtnblazesdk.utils.extractVideosPlayerStyle
22
+ import com.blaze.rtnblazesdk.utils.getBooleanOrNull
20
23
  import com.blaze.rtnblazesdk.utils.handleResult
21
24
  import com.blaze.rtnblazesdk.utils.rejectWith
22
25
  import com.facebook.proguard.annotations.DoNotStrip
@@ -148,6 +151,7 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
148
151
 
149
152
  val reactStoryPlayerStyle = options.getMap(KEY_INIT_DEFAULT_STORY_PLAYER_STYLE)
150
153
  val reactMomentPlayerStyle = options.getMap(KEY_INIT_DEFAULT_MOMENT_PLAYER_STYLE)
154
+ val reactVideosPlayerStyle = options.getMap(KEY_INIT_DEFAULT_VIDEO_PLAYER_STYLE)
151
155
 
152
156
  reactStoryPlayerStyle.extractStoriesPlayerStyle(context).also {
153
157
  BlazeSDK.setDefaultStoryPlayerStyle(it)
@@ -155,6 +159,9 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
155
159
  reactMomentPlayerStyle.extractMomentsPlayerStyle(context).also {
156
160
  BlazeSDK.setDefaultMomentsPlayerStyle(it)
157
161
  }
162
+ reactVideosPlayerStyle.extractVideosPlayerStyle(context).also {
163
+ BlazeSDK.setDefaultVideosPlayerStyle(it)
164
+ }
158
165
  } catch (e: Exception) {
159
166
  promise.reject("BlazeSDK", e.toString())
160
167
  Log.e(TAG, "init: Exception - $e")
@@ -170,7 +177,7 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
170
177
  try {
171
178
  appOverridesCTAHandling = options.getBoolean(KEY_INIT_APP_OVERRIDES_CTA_HANDLING)
172
179
  } catch(e: NoSuchKeyException) {
173
- Log.e(TAG, "setAppOverrideCtaHandling: NoSuchKeyException - ${e.message}")
180
+
174
181
  }
175
182
  }
176
183
 
@@ -190,10 +197,14 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
190
197
  val pageId = options.getString(KEY_STORY_OPT_PAGE_ID)
191
198
  val playerStyle = options.getMap(KEY_ENTRY_POINT_PLAYER_THEME)
192
199
  .extractStoriesPlayerStyle(context)
200
+
201
+ val triggerSource = options.getString("triggerSource")?.asEntryPointTriggerSource
202
+ ?: BlazeEntryPointTriggerSource.ENTRYPOINT
193
203
  BlazeSDK.playStory(
194
204
  storyId = storyId,
195
205
  pageId = pageId,
196
- storyPlayerStyle = playerStyle
206
+ storyPlayerStyle = playerStyle,
207
+ triggerSource = triggerSource
197
208
  ) { result ->
198
209
  promise.handleResult(result)
199
210
  }
@@ -204,19 +215,24 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
204
215
 
205
216
  @ReactMethod
206
217
  @DoNotStrip
207
- fun playMoment(options: ReadableMap, promise: Promise) {
208
-
218
+ fun playStories(options: ReadableMap, promise: Promise) {
209
219
  try {
210
- val momentId = options.getString(KEY_STORY_OPT_MOMENT_ID) ?: run {
211
- promise.rejectWith("no moment id")
220
+ val dataSource = options.getMap(KEY_ENTRY_POINT_DATA_SOURCE)?.extractDataSource() ?: run {
221
+ promise.rejectWith("Error parsing data source for playStories")
212
222
  return
213
223
  }
214
224
 
215
225
  val playerStyle = options.getMap(KEY_ENTRY_POINT_PLAYER_THEME)
216
- .extractMomentsPlayerStyle(context)
217
- BlazeSDK.playMoment(
218
- momentId = momentId,
219
- momentsPlayerStyle = playerStyle) { result ->
226
+ .extractStoriesPlayerStyle(context)
227
+ val triggerSource = options.getString("triggerSource")?.asEntryPointTriggerSource
228
+ ?: BlazeEntryPointTriggerSource.ENTRYPOINT
229
+ val shouldOrderContentByReadStatus = options.getBooleanOrNull("shouldOrderContentByReadStatus") ?: true
230
+ BlazeSDK.playStories(
231
+ dataSource = dataSource,
232
+ storyPlayerStyle = playerStyle,
233
+ triggerSource = triggerSource,
234
+ shouldOrderContentByReadStatus = shouldOrderContentByReadStatus
235
+ ) { result ->
220
236
  promise.handleResult(result)
221
237
  }
222
238
  } catch (e: Exception) {
@@ -243,13 +259,22 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
243
259
 
244
260
  @ReactMethod
245
261
  @DoNotStrip
246
- fun prepareMoments(options: ReadableMap, promise: Promise) {
262
+ fun playMoment(options: ReadableMap, promise: Promise) {
247
263
  try {
248
- val dataSource = options.getMap(KEY_ENTRY_POINT_DATA_SOURCE)?.extractDataSource() ?: run {
249
- promise.rejectWith("Error parsing data source for prepareMoments")
264
+ val momentId = options.getString(KEY_MOMENT_OPT_MOMENT_ID) ?: run {
265
+ promise.rejectWith("no moment id")
250
266
  return
251
267
  }
252
- BlazeSDK.prepareMoments(dataSource) { result ->
268
+
269
+ val playerStyle = options.getMap(KEY_ENTRY_POINT_PLAYER_THEME)
270
+ .extractMomentsPlayerStyle(context)
271
+ val triggerSource = options.getString("triggerSource")?.asEntryPointTriggerSource
272
+ ?: BlazeEntryPointTriggerSource.ENTRYPOINT
273
+ BlazeSDK.playMoment(
274
+ momentId = momentId,
275
+ momentsPlayerStyle = playerStyle,
276
+ triggerSource = triggerSource
277
+ ) { result ->
253
278
  promise.handleResult(result)
254
279
  }
255
280
  } catch (e: Exception) {
@@ -259,46 +284,92 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
259
284
 
260
285
  @ReactMethod
261
286
  @DoNotStrip
262
- fun dismissPlayer(promise: Promise) {
263
- BlazeSDK.dismissCurrentPlayer()
264
- promise.resolve(true)
265
- }
287
+ fun playMoments(options: ReadableMap, promise: Promise) {
288
+ try {
289
+ val dataSource = options.getMap(KEY_ENTRY_POINT_DATA_SOURCE)?.extractDataSource() ?: run {
290
+ promise.rejectWith("Error parsing data source for playMoments")
291
+ return
292
+ }
266
293
 
267
- @DoNotStrip
268
- @ReactMethod(isBlockingSynchronousMethod = true)
269
- fun isInitialized(): Boolean {
270
- return BlazeSDK.isInitialized()
294
+ val playerStyle = options.getMap(KEY_ENTRY_POINT_PLAYER_THEME)
295
+ .extractMomentsPlayerStyle(context)
296
+ val triggerSource = options.getString("triggerSource")?.asEntryPointTriggerSource
297
+ ?: BlazeEntryPointTriggerSource.ENTRYPOINT
298
+ val shouldOrderContentByReadStatus = options.getBooleanOrNull("shouldOrderContentByReadStatus") ?: true
299
+ BlazeSDK.playMoments(
300
+ dataSource = dataSource,
301
+ momentsPlayerStyle = playerStyle,
302
+ triggerSource = triggerSource,
303
+ shouldOrderContentByReadStatus = shouldOrderContentByReadStatus
304
+ ) { result ->
305
+ promise.handleResult(result)
306
+ }
307
+ } catch (e: Exception) {
308
+ promise.rejectWith(e.toString())
309
+ }
271
310
  }
272
311
 
273
312
  @ReactMethod
274
313
  @DoNotStrip
275
- fun setExternalUserId(externalUserId: String?, promise: Promise) {
276
- BlazeSDK.setExternalUserId(externalUserId) { result ->
277
- promise.handleResult(result)
314
+ fun prepareMoments(options: ReadableMap, promise: Promise) {
315
+ try {
316
+ val dataSource = options.getMap(KEY_ENTRY_POINT_DATA_SOURCE)?.extractDataSource() ?: run {
317
+ promise.rejectWith("Error parsing data source for prepareMoments")
318
+ return
319
+ }
320
+ BlazeSDK.prepareMoments(dataSource) { result ->
321
+ promise.handleResult(result)
322
+ }
323
+ } catch (e: Exception) {
324
+ promise.rejectWith(e.toString())
278
325
  }
279
326
  }
280
327
 
281
328
  @ReactMethod
282
329
  @DoNotStrip
283
- fun setDoNotTrack(doNotTrack: Boolean, promise: Promise) {
284
- BlazeSDK.setDoNotTrack(doNotTrack)
285
- promise.resolve(doNotTrack)
330
+ fun playVideo(options: ReadableMap, promise: Promise) {
331
+ try {
332
+ val videoId = options.getString(KEY_VIDEO_OPT_VIDEO_ID) ?: run {
333
+ promise.rejectWith("no video id")
334
+ return
335
+ }
336
+
337
+ val playerStyle = options.getMap(KEY_ENTRY_POINT_PLAYER_THEME)
338
+ .extractVideosPlayerStyle(context)
339
+ val triggerSource = options.getString("triggerSource")?.asEntryPointTriggerSource
340
+ ?: BlazeEntryPointTriggerSource.ENTRYPOINT
341
+ BlazeSDK.playVideo(
342
+ videoId = videoId,
343
+ videosPlayerStyle = playerStyle,
344
+ triggerSource = triggerSource
345
+ ) { result ->
346
+ promise.handleResult(result)
347
+ }
348
+ } catch (e: Exception) {
349
+ promise.rejectWith(e.toString())
350
+ }
286
351
  }
287
352
 
288
353
  @ReactMethod
289
354
  @DoNotStrip
290
- fun playStories(options: ReadableMap, promise: Promise) {
355
+ fun playVideos(options: ReadableMap, promise: Promise) {
291
356
  try {
292
357
  val dataSource = options.getMap(KEY_ENTRY_POINT_DATA_SOURCE)?.extractDataSource() ?: run {
293
- promise.rejectWith("Error parsing data source for playStories")
358
+ promise.rejectWith("Error parsing data source for playVideos")
294
359
  return
295
360
  }
296
361
 
297
362
  val playerStyle = options.getMap(KEY_ENTRY_POINT_PLAYER_THEME)
298
- .extractStoriesPlayerStyle(context)
299
- BlazeSDK.playStories(
363
+ .extractVideosPlayerStyle(context)
364
+ val triggerSource = options.getString("triggerSource")?.asEntryPointTriggerSource
365
+ ?: BlazeEntryPointTriggerSource.ENTRYPOINT
366
+ val shouldOrderContentByReadStatus = options.getBooleanOrNull("shouldOrderContentByReadStatus") ?: true
367
+ BlazeSDK.playVideos(
300
368
  dataSource = dataSource,
301
- storyPlayerStyle = playerStyle) { result ->
369
+ videosPlayerStyle = playerStyle,
370
+ triggerSource = triggerSource,
371
+ shouldOrderContentByReadStatus = shouldOrderContentByReadStatus
372
+ ) { result ->
302
373
  promise.handleResult(result)
303
374
  }
304
375
  } catch (e: Exception) {
@@ -308,18 +379,13 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
308
379
 
309
380
  @ReactMethod
310
381
  @DoNotStrip
311
- fun playMoments(options: ReadableMap, promise: Promise) {
382
+ fun prepareVideos(options: ReadableMap, promise: Promise) {
312
383
  try {
313
384
  val dataSource = options.getMap(KEY_ENTRY_POINT_DATA_SOURCE)?.extractDataSource() ?: run {
314
- promise.rejectWith("Error parsing data source for playMoments")
385
+ promise.rejectWith("Error parsing data source for prepareVideos")
315
386
  return
316
387
  }
317
-
318
- val playerStyle = options.getMap(KEY_ENTRY_POINT_PLAYER_THEME)
319
- .extractMomentsPlayerStyle(context)
320
- BlazeSDK.playMoments(
321
- dataSource = dataSource,
322
- momentsPlayerStyle = playerStyle) { result ->
388
+ BlazeSDK.prepareVideos(dataSource) { result ->
323
389
  promise.handleResult(result)
324
390
  }
325
391
  } catch (e: Exception) {
@@ -327,6 +393,34 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
327
393
  }
328
394
  }
329
395
 
396
+ @ReactMethod
397
+ @DoNotStrip
398
+ fun dismissPlayer(promise: Promise) {
399
+ BlazeSDK.dismissCurrentPlayer()
400
+ promise.resolve(true)
401
+ }
402
+
403
+ @DoNotStrip
404
+ @ReactMethod(isBlockingSynchronousMethod = true)
405
+ fun isInitialized(): Boolean {
406
+ return BlazeSDK.isInitialized()
407
+ }
408
+
409
+ @ReactMethod
410
+ @DoNotStrip
411
+ fun setExternalUserId(externalUserId: String?, promise: Promise) {
412
+ BlazeSDK.setExternalUserId(externalUserId) { result ->
413
+ promise.handleResult(result)
414
+ }
415
+ }
416
+
417
+ @ReactMethod
418
+ @DoNotStrip
419
+ fun setDoNotTrack(doNotTrack: Boolean, promise: Promise) {
420
+ BlazeSDK.setDoNotTrack(doNotTrack)
421
+ promise.resolve(doNotTrack)
422
+ }
423
+
330
424
  @ReactMethod
331
425
  @DoNotStrip
332
426
  fun handleUniversalLink(link: String, promise: Promise) {
@@ -403,12 +497,21 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
403
497
  const val KEY_INIT_APP_OVERRIDES_CTA_HANDLING = "appOverridesCTAHandling"
404
498
  const val KEY_INIT_DEFAULT_STORY_PLAYER_STYLE = "defaultStoryPlayerStyle"
405
499
  const val KEY_INIT_DEFAULT_MOMENT_PLAYER_STYLE = "defaultMomentsPlayerStyle"
500
+ const val KEY_INIT_DEFAULT_VIDEO_PLAYER_STYLE = "defaultVideosPlayerStyle"
406
501
  const val KEY_STORY_OPT_STORY_ID = "storyId"
407
502
  const val KEY_STORY_OPT_PAGE_ID = "pageId"
408
- const val KEY_STORY_OPT_MOMENT_ID = "momentId"
503
+ const val KEY_MOMENT_OPT_MOMENT_ID = "momentId"
504
+ const val KEY_VIDEO_OPT_VIDEO_ID = "videoId"
409
505
  const val KEY_ENTRY_POINT_DATA_SOURCE = "dataSource"
410
506
  const val KEY_ENTRY_POINT_PLAYER_THEME = "playerStyle"
411
507
 
412
508
  }
413
509
 
510
+ }
511
+
512
+ val String.asEntryPointTriggerSource: BlazeEntryPointTriggerSource? get() = when (this) {
513
+ "notification" -> BlazeEntryPointTriggerSource.NOTIFICATION
514
+ "deepLink" -> BlazeEntryPointTriggerSource.DEEPLINK
515
+ "entryPoint" -> BlazeEntryPointTriggerSource.ENTRYPOINT
516
+ else -> null
414
517
  }
@@ -2,24 +2,34 @@ package com.blaze.rtnblazesdk
2
2
 
3
3
  import com.blaze.rtnblazesdk.moments.BlazeMomentsGridViewManager
4
4
  import com.blaze.rtnblazesdk.moments.BlazeMomentsRowViewManager
5
+ import com.blaze.rtnblazesdk.shared.BlazeAsyncBridgeModule
5
6
  import com.blaze.rtnblazesdk.stories.BlazeStoriesGridViewManager
6
7
  import com.blaze.rtnblazesdk.stories.BlazeStoriesRowViewManager
8
+ import com.blaze.rtnblazesdk.videos.BlazeVideosGridViewManager
9
+ import com.blaze.rtnblazesdk.videos.BlazeVideosRowViewManager
7
10
  import com.facebook.react.ReactPackage
8
11
  import com.facebook.react.bridge.NativeModule
9
12
  import com.facebook.react.bridge.ReactApplicationContext
10
13
  import com.facebook.react.uimanager.ViewManager
11
14
 
12
15
  class BlazeSdkPackage : ReactPackage {
13
- override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
16
+ override fun createViewManagers(
17
+ reactContext: ReactApplicationContext
18
+ ): List<ViewManager<*, *>> {
14
19
  return listOf<ViewManager<*, *>>(
15
- BlazeStoriesGridViewManager(reactContext),
16
- BlazeStoriesRowViewManager(reactContext),
17
- BlazeMomentsGridViewManager(reactContext),
18
- BlazeMomentsRowViewManager(reactContext)
20
+ BlazeStoriesGridViewManager(reactContext),
21
+ BlazeStoriesRowViewManager(reactContext),
22
+ BlazeMomentsGridViewManager(reactContext),
23
+ BlazeMomentsRowViewManager(reactContext),
24
+ BlazeVideosGridViewManager(reactContext),
25
+ BlazeVideosRowViewManager(reactContext)
19
26
  )
20
27
  }
21
28
 
22
29
  override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
23
- return listOf<NativeModule>(BlazeSdkModule(reactContext))
30
+ return listOf<NativeModule>(
31
+ BlazeSdkModule(reactContext),
32
+ BlazeAsyncBridgeModule(reactContext)
33
+ )
24
34
  }
25
- }
35
+ }
@@ -0,0 +1,20 @@
1
+ package com.blaze.rtnblazesdk.ads
2
+
3
+ import androidx.annotation.Keep
4
+ import com.blaze.blazesdk.ads.models.ui.BlazeContentExtraInfo
5
+
6
+ @Keep
7
+ data class BlazeRTNContentExtraInfo(
8
+ val previous: Map<String, String>?,
9
+ val current: Map<String, String>?,
10
+ val next: Map<String, String>?,
11
+ )
12
+
13
+ @Keep
14
+ fun BlazeContentExtraInfo.toReactNativeModel(): BlazeRTNContentExtraInfo {
15
+ return BlazeRTNContentExtraInfo(
16
+ previous = this.previous,
17
+ current = this.current,
18
+ next = this.next
19
+ )
20
+ }
@@ -21,7 +21,6 @@ import com.blaze.rtnblazesdk.BlazeSdkModuleRepo
21
21
  import com.blaze.rtnblazesdk.customization.BlazeReactWidgetItemCustomMapping
22
22
  import com.blaze.rtnblazesdk.customization.BlazeReactWidgetItemStyleOverrides
23
23
  import com.blaze.rtnblazesdk.customization.mergedWith
24
- import com.blaze.rtnblazesdk.events.BaseEvent
25
24
  import com.blaze.rtnblazesdk.events.WidgetCTAClickEvent
26
25
  import com.blaze.rtnblazesdk.events.WidgetDataLoadCompletedEvent
27
26
  import com.blaze.rtnblazesdk.events.WidgetDataLoadStartedEvent
@@ -42,6 +41,7 @@ import com.facebook.react.bridge.ReadableArray
42
41
  import com.facebook.react.bridge.ReadableMap
43
42
  import com.facebook.react.uimanager.ReactStylesDiffMap
44
43
  import com.facebook.react.uimanager.UIManagerHelper
44
+ import com.facebook.react.uimanager.events.Event
45
45
  import com.facebook.react.uimanager.events.EventDispatcher
46
46
 
47
47
  abstract class BaseWidgetView @JvmOverloads constructor(
@@ -276,7 +276,7 @@ abstract class BaseWidgetView @JvmOverloads constructor(
276
276
  // Currently we don't do anything here.
277
277
  }
278
278
 
279
- protected fun dispatchEvent(e: BaseEvent<*>) {
279
+ protected fun dispatchEvent(e: Event<*>) {
280
280
  try {
281
281
  val eventDispatcher: EventDispatcher? =
282
282
  UIManagerHelper.getEventDispatcherForReactTag(context as ReactContext, id)
@@ -122,28 +122,18 @@ abstract class BlazeWidgetViewManager<TWidget : BaseWidgetView>(
122
122
  view.reactCachingLevel = value
123
123
  }
124
124
 
125
- //---------- Props for Grids ----------//
126
-
127
- @Keep
128
- @ReactProp(name = "isEmbeddedInScrollView")
129
- fun setIsEmbeddedInScrollView(view: TWidget, value: Boolean) {
130
- view.isEmbeddedInScrollView = value
131
- }
132
-
133
- //---------- Props for Moment widget ----------//
134
-
135
125
  @Keep
136
- @ReactProp(name = "blazeMomentsPlayerStyle")
137
- fun setBlazeMomentsPlayerStyle(view: TWidget, value: ReadableMap?) {
126
+ @ReactProp(name = "playerStyle")
127
+ fun setPlayerStyle(view: TWidget, value: ReadableMap?) {
138
128
  view.reactWidgetPlayerStyleMap = value
139
129
  }
140
130
 
141
- //---------- Props for Story widget ----------//
131
+ //---------- Props for Grids ----------//
142
132
 
143
133
  @Keep
144
- @ReactProp(name = "blazeStoryPlayerStyle")
145
- fun setBlazeStoryPlayerStyle(view: TWidget, value: ReadableMap?) {
146
- view.reactWidgetPlayerStyleMap = value
134
+ @ReactProp(name = "isEmbeddedInScrollView")
135
+ fun setIsEmbeddedInScrollView(view: TWidget, value: Boolean) {
136
+ view.isEmbeddedInScrollView = value
147
137
  }
148
138
 
149
139
  }
@@ -6,11 +6,16 @@ import BlazeReactFirstTimeSlideTextStyle
6
6
  import BlazeReactImage
7
7
  import BlazeReactMargins
8
8
  import BlazeReactPlayerButtonCustomImageStates
9
+ import BlazeReactPlayerButtonStyle
10
+ import BlazeReactSeekBarStyle
9
11
  import android.content.Context
12
+ import android.widget.ImageView
10
13
  import com.blaze.blazesdk.style.players.BlazeFirstTimeSlideCTAStyle
11
14
  import com.blaze.blazesdk.style.players.BlazeFirstTimeSlideInstructionStyle
12
15
  import com.blaze.blazesdk.style.players.BlazeFirstTimeSlideTextStyle
13
16
  import com.blaze.blazesdk.style.players.BlazePlayerButtonCustomImageStates
17
+ import com.blaze.blazesdk.style.players.BlazeSeekBarStyle
18
+ import com.blaze.blazesdk.style.players.IPlayerItemButtonStyle
14
19
  import com.blaze.blazesdk.style.shared.models.BlazeInsets
15
20
  import com.blaze.blazesdk.style.shared.models.blazeDp
16
21
 
@@ -147,3 +152,40 @@ fun String?.toColorResId(context: Context): Int? {
147
152
  return colorResId
148
153
  }
149
154
 
155
+ fun <T : IPlayerItemButtonStyle> T.mergeButtonThemes(
156
+ customization: BlazeReactPlayerButtonStyle?,
157
+ context: Context
158
+ ): T {
159
+ customization ?: return this
160
+
161
+ customization.width?.let { this.width = it.blazeDp }
162
+ customization.height?.let { this.height = it.blazeDp }
163
+ safeParseColor(customization.color)?.let { this.color = it }
164
+ customization.isVisible?.let { this.isVisible = it }
165
+ customization.scaleType?.let { this.scaleType = ImageView.ScaleType.valueOf(it) }
166
+ customization.isVisibleForAds?.let { this.isVisibleForAds = it }
167
+ customization.customImage?.let { this.customImage = this.customImage.mergedWith(it, context) }
168
+
169
+ return this
170
+ }
171
+
172
+ fun BlazeSeekBarStyle.mergedWith(
173
+ customization: BlazeReactSeekBarStyle?,
174
+ context: Context
175
+ ): BlazeSeekBarStyle {
176
+ customization ?: return this
177
+
178
+ val merged = this
179
+
180
+ merged.isVisible = customization.isVisible ?: this.isVisible
181
+ merged.backgroundColor = safeParseColor(customization.backgroundColor) ?: this.backgroundColor
182
+ merged.progressColor = safeParseColor(customization.progressColor) ?: this.progressColor
183
+ merged.height = customization.height?.blazeDp ?: this.height
184
+ merged.cornerRadius = customization.cornerRadius?.toInt()?.blazeDp ?: this.cornerRadius
185
+ merged.thumbColor = safeParseColor(customization.thumbColor) ?: this.thumbColor
186
+ merged.thumbImageResId = customization.thumbImage?.toImageResId(context)
187
+ merged.thumbSize = customization.thumbSize?.blazeDp ?: this.thumbSize
188
+ merged.isThumbVisible = customization.isThumbVisible ?: this.isThumbVisible
189
+
190
+ return merged
191
+ }
@@ -1,7 +1,6 @@
1
1
  package com.blaze.rtnblazesdk.customization
2
2
 
3
3
  import BlazeReactMomentsPlayerBodyTextStyle
4
- import BlazeReactMomentsPlayerButtonStyle
5
4
  import BlazeReactMomentsPlayerButtonsStyle
6
5
  import BlazeReactMomentsPlayerChipStyle
7
6
  import BlazeReactMomentsPlayerChipsStyle
@@ -14,12 +13,8 @@ import BlazeReactMomentsPlayerHeaderGradientStyle
14
13
  import BlazeReactMomentsPlayerHeadingTextStyle
15
14
  import BlazeReactMomentsPlayerSeekBarStyle
16
15
  import BlazeReactMomentsPlayerStyle
17
- import BlazeReactSeekBarStyle
18
16
  import android.content.Context
19
- import android.widget.ImageView
20
- import com.blaze.blazesdk.style.players.BlazeSeekBarStyle
21
17
  import com.blaze.blazesdk.style.players.moments.BlazeMomentsPlayerBodyTextStyle
22
- import com.blaze.blazesdk.style.players.moments.BlazeMomentsPlayerButtonStyle
23
18
  import com.blaze.blazesdk.style.players.moments.BlazeMomentsPlayerButtonsStyle
24
19
  import com.blaze.blazesdk.style.players.moments.BlazeMomentsPlayerChipStyle
25
20
  import com.blaze.blazesdk.style.players.moments.BlazeMomentsPlayerChipsStyle
@@ -44,7 +39,7 @@ fun BlazeMomentsPlayerStyle.mergedWith(
44
39
 
45
40
  merged.headingText = this.headingText.mergedWith(customization.headingText, context)
46
41
  merged.bodyText = this.bodyText.mergedWith(customization.bodyText, context)
47
- customization.buttons?.let { merged.buttons = this.buttons.mergedWith(it, context) }
42
+ merged.buttons = this.buttons.mergedWith(customization.buttons, context)
48
43
  merged.chips = this.chips.mergedWith(customization.chips)
49
44
  merged.cta = this.cta.mergedWith(customization.cta, context)
50
45
  safeParseColor(customization.backgroundColor)?.let { merged.backgroundColor = it }
@@ -112,39 +107,18 @@ fun BlazeMomentsPlayerBodyTextStyle.mergedWith(
112
107
 
113
108
 
114
109
  fun BlazeMomentsPlayerButtonsStyle.mergedWith(
115
- customization: BlazeReactMomentsPlayerButtonsStyle,
110
+ customization: BlazeReactMomentsPlayerButtonsStyle?,
116
111
  context: Context
117
112
  ): BlazeMomentsPlayerButtonsStyle {
118
- customization.mute?.let {
119
- mute = mute.mergeButtonThemes(it, context)
120
- }
121
- customization.exit?.let {
122
- exit = exit.mergeButtonThemes(it, context)
123
- }
124
- customization.share?.let {
125
- share = share.mergeButtonThemes(it, context)
126
- }
127
- customization.like?.let {
128
- like = like.mergeButtonThemes(it, context)
129
- }
130
- customization.play?.let {
131
- play = play.mergeButtonThemes(it, context)
132
- }
133
- return this
134
- }
113
+ customization ?: return this
135
114
 
136
- fun BlazeMomentsPlayerButtonStyle.mergeButtonThemes(
137
- customization: BlazeReactMomentsPlayerButtonStyle,
138
- context: Context
139
- ): BlazeMomentsPlayerButtonStyle {
140
- customization.width?.let { this.width = it.blazeDp }
141
- customization.height?.let { this.height = it.blazeDp }
142
- safeParseColor(customization.color)?.let { this.color = it }
143
- customization.isVisible?.let { this.isVisible = it }
144
- customization.scaleType?.let { this.scaleType = ImageView.ScaleType.valueOf(it) }
145
- customization.isVisibleForAds?.let { this.isVisibleForAds = it }
146
- customization.customImage?.let { this.customImage = this.customImage.mergedWith(it, context) }
147
- return this
115
+ val merged = this
116
+ merged.mute = merged.mute.mergeButtonThemes(customization.mute, context)
117
+ merged.exit = merged.exit.mergeButtonThemes(customization.exit, context)
118
+ merged.share = merged.share.mergeButtonThemes(customization.share, context)
119
+ merged.like = merged.like.mergeButtonThemes(customization.like, context)
120
+ merged.play = merged.play.mergeButtonThemes(customization.play, context)
121
+ return merged
148
122
  }
149
123
 
150
124
  fun BlazeMomentsPlayerCtaStyle.mergedWith(
@@ -236,27 +210,6 @@ fun BlazeMomentsPlayerSeekBarStyle.mergedWith(
236
210
  return merged
237
211
  }
238
212
 
239
- fun BlazeSeekBarStyle.mergedWith(
240
- customization: BlazeReactSeekBarStyle?,
241
- context: Context
242
- ): BlazeSeekBarStyle {
243
- customization ?: return this
244
-
245
- val merged = this
246
-
247
- merged.isVisible = customization.isVisible ?: this.isVisible
248
- merged.backgroundColor = safeParseColor(customization.backgroundColor) ?: this.backgroundColor
249
- merged.progressColor = safeParseColor(customization.progressColor) ?: this.progressColor
250
- merged.height = customization.height?.blazeDp ?: this.height
251
- merged.cornerRadius = customization.cornerRadius?.toInt()?.blazeDp ?: this.cornerRadius
252
- merged.thumbColor = safeParseColor(customization.thumbColor) ?: this.thumbColor
253
- merged.thumbImageResId = customization.thumbImage?.toImageResId(context)
254
- merged.thumbSize = customization.thumbSize?.blazeDp ?: this.thumbSize
255
- merged.isThumbVisible = customization.isThumbVisible ?: this.isThumbVisible
256
-
257
- return merged
258
- }
259
-
260
213
  fun BlazeMomentsPlayerChipStyle.mergedWith(
261
214
  customization: BlazeReactMomentsPlayerChipStyle?,
262
215
  ): BlazeMomentsPlayerChipStyle {