@shopify/flash-list 2.0.0-alpha.21 → 2.0.0-alpha.22

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 (283) hide show
  1. package/dist/AnimatedFlashList.js +2 -2
  2. package/dist/AnimatedFlashList.js.map +1 -1
  3. package/dist/FlashList.d.ts +1 -167
  4. package/dist/FlashList.d.ts.map +1 -1
  5. package/dist/FlashList.js +3 -595
  6. package/dist/FlashList.js.map +1 -1
  7. package/dist/FlashListProps.d.ts +2 -63
  8. package/dist/FlashListProps.d.ts.map +1 -1
  9. package/dist/FlashListProps.js.map +1 -1
  10. package/dist/__tests__/ViewabilityHelper.test.js +3 -4
  11. package/dist/__tests__/ViewabilityHelper.test.js.map +1 -1
  12. package/dist/benchmark/JSFPSMonitor.d.ts.map +1 -1
  13. package/dist/benchmark/JSFPSMonitor.js +2 -1
  14. package/dist/benchmark/JSFPSMonitor.js.map +1 -1
  15. package/dist/benchmark/useBenchmark.d.ts +2 -4
  16. package/dist/benchmark/useBenchmark.d.ts.map +1 -1
  17. package/dist/benchmark/useBenchmark.js +12 -24
  18. package/dist/benchmark/useBenchmark.js.map +1 -1
  19. package/dist/benchmark/useFlatListBenchmark.d.ts.map +1 -1
  20. package/dist/benchmark/useFlatListBenchmark.js +2 -1
  21. package/dist/benchmark/useFlatListBenchmark.js.map +1 -1
  22. package/dist/errors/ErrorMessages.d.ts +16 -0
  23. package/dist/errors/ErrorMessages.d.ts.map +1 -0
  24. package/dist/errors/ErrorMessages.js +19 -0
  25. package/dist/errors/ErrorMessages.js.map +1 -0
  26. package/dist/errors/WarningMessages.d.ts +4 -0
  27. package/dist/errors/WarningMessages.d.ts.map +1 -0
  28. package/dist/errors/WarningMessages.js +7 -0
  29. package/dist/errors/WarningMessages.js.map +1 -0
  30. package/dist/index.d.ts +3 -9
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +7 -29
  33. package/dist/index.js.map +1 -1
  34. package/dist/isNewArch.d.ts +2 -0
  35. package/dist/isNewArch.d.ts.map +1 -0
  36. package/dist/isNewArch.js +25 -0
  37. package/dist/isNewArch.js.map +1 -0
  38. package/dist/native/config/PlatformHelper.android.d.ts +1 -22
  39. package/dist/native/config/PlatformHelper.android.d.ts.map +1 -1
  40. package/dist/native/config/PlatformHelper.android.js +1 -16
  41. package/dist/native/config/PlatformHelper.android.js.map +1 -1
  42. package/dist/native/config/PlatformHelper.d.ts +1 -22
  43. package/dist/native/config/PlatformHelper.d.ts.map +1 -1
  44. package/dist/native/config/PlatformHelper.ios.d.ts +1 -22
  45. package/dist/native/config/PlatformHelper.ios.d.ts.map +1 -1
  46. package/dist/native/config/PlatformHelper.ios.js +1 -15
  47. package/dist/native/config/PlatformHelper.ios.js.map +1 -1
  48. package/dist/native/config/PlatformHelper.js +1 -16
  49. package/dist/native/config/PlatformHelper.js.map +1 -1
  50. package/dist/native/config/PlatformHelper.web.d.ts +1 -23
  51. package/dist/native/config/PlatformHelper.web.d.ts.map +1 -1
  52. package/dist/native/config/PlatformHelper.web.js +1 -18
  53. package/dist/native/config/PlatformHelper.web.js.map +1 -1
  54. package/dist/recyclerview/RecyclerView.d.ts.map +1 -1
  55. package/dist/recyclerview/RecyclerView.js +5 -0
  56. package/dist/recyclerview/RecyclerView.js.map +1 -1
  57. package/dist/recyclerview/RecyclerViewManager.d.ts.map +1 -1
  58. package/dist/recyclerview/RecyclerViewManager.js +9 -8
  59. package/dist/recyclerview/RecyclerViewManager.js.map +1 -1
  60. package/dist/recyclerview/RecyclerViewProps.d.ts +1 -8
  61. package/dist/recyclerview/RecyclerViewProps.d.ts.map +1 -1
  62. package/dist/recyclerview/hooks/useRecyclerViewController.d.ts.map +1 -1
  63. package/dist/recyclerview/hooks/useRecyclerViewController.js +4 -0
  64. package/dist/recyclerview/hooks/useRecyclerViewController.js.map +1 -1
  65. package/dist/recyclerview/layout-managers/LayoutManager.d.ts.map +1 -1
  66. package/dist/recyclerview/layout-managers/LayoutManager.js +2 -1
  67. package/dist/recyclerview/layout-managers/LayoutManager.js.map +1 -1
  68. package/dist/recyclerview/viewability/ViewToken.d.ts.map +1 -0
  69. package/dist/recyclerview/viewability/ViewToken.js.map +1 -0
  70. package/dist/{viewability → recyclerview/viewability}/ViewabilityHelper.d.ts +2 -2
  71. package/dist/recyclerview/viewability/ViewabilityHelper.d.ts.map +1 -0
  72. package/dist/{viewability → recyclerview/viewability}/ViewabilityHelper.js +2 -4
  73. package/dist/{viewability → recyclerview/viewability}/ViewabilityHelper.js.map +1 -1
  74. package/dist/{viewability → recyclerview/viewability}/ViewabilityManager.d.ts +3 -3
  75. package/dist/recyclerview/viewability/ViewabilityManager.d.ts.map +1 -0
  76. package/dist/{viewability → recyclerview/viewability}/ViewabilityManager.js +16 -16
  77. package/dist/recyclerview/viewability/ViewabilityManager.js.map +1 -0
  78. package/dist/tsconfig.tsbuildinfo +1 -1
  79. package/package.json +3 -14
  80. package/src/AnimatedFlashList.ts +2 -2
  81. package/src/FlashList.ts +1 -0
  82. package/src/FlashListProps.ts +3 -79
  83. package/src/__tests__/ViewabilityHelper.test.ts +13 -14
  84. package/src/benchmark/JSFPSMonitor.ts +3 -3
  85. package/src/benchmark/useBenchmark.ts +12 -40
  86. package/src/benchmark/useFlatListBenchmark.ts +3 -1
  87. package/src/errors/ErrorMessages.ts +26 -0
  88. package/src/errors/WarningMessages.ts +4 -0
  89. package/src/index.ts +7 -43
  90. package/src/isNewArch.ts +25 -0
  91. package/src/native/config/PlatformHelper.android.ts +1 -25
  92. package/src/native/config/PlatformHelper.ios.ts +1 -24
  93. package/src/native/config/PlatformHelper.ts +1 -25
  94. package/src/native/config/PlatformHelper.web.ts +1 -30
  95. package/src/recyclerview/RecyclerView.tsx +5 -0
  96. package/src/recyclerview/RecyclerViewManager.ts +9 -18
  97. package/src/recyclerview/RecyclerViewProps.ts +1 -11
  98. package/src/recyclerview/hooks/useRecyclerViewController.tsx +4 -0
  99. package/src/recyclerview/layout-managers/LayoutManager.ts +2 -1
  100. package/src/{viewability → recyclerview/viewability}/ViewabilityHelper.ts +8 -9
  101. package/src/{viewability → recyclerview/viewability}/ViewabilityManager.ts +18 -20
  102. package/RNFlashList.podspec +0 -37
  103. package/android/build.gradle +0 -89
  104. package/android/src/main/AndroidManifest.xml +0 -3
  105. package/android/src/main/kotlin/com/shopify/reactnative/flash_list/AutoLayoutShadow.kt +0 -105
  106. package/android/src/main/kotlin/com/shopify/reactnative/flash_list/AutoLayoutView.kt +0 -158
  107. package/android/src/main/kotlin/com/shopify/reactnative/flash_list/AutoLayoutViewManager.kt +0 -70
  108. package/android/src/main/kotlin/com/shopify/reactnative/flash_list/BlankAreaEvent.kt +0 -29
  109. package/android/src/main/kotlin/com/shopify/reactnative/flash_list/CellContainer.java +0 -16
  110. package/android/src/main/kotlin/com/shopify/reactnative/flash_list/CellContainerImpl.kt +0 -16
  111. package/android/src/main/kotlin/com/shopify/reactnative/flash_list/CellContainerManager.kt +0 -34
  112. package/android/src/main/kotlin/com/shopify/reactnative/flash_list/FlashListPackage.kt +0 -19
  113. package/android/src/paper/java/com/facebook/react/viewmanagers/AutoLayoutViewManagerDelegate.java +0 -47
  114. package/android/src/paper/java/com/facebook/react/viewmanagers/AutoLayoutViewManagerInterface.java +0 -21
  115. package/android/src/paper/java/com/facebook/react/viewmanagers/CellContainerManagerDelegate.java +0 -32
  116. package/android/src/paper/java/com/facebook/react/viewmanagers/CellContainerManagerInterface.java +0 -16
  117. package/android/src/test/java/com/shopify/reactnative/flash_list/AutoLayoutShadowTest.kt +0 -147
  118. package/android/src/test/java/com/shopify/reactnative/flash_list/models/Rect.kt +0 -61
  119. package/android/src/test/java/com/shopify/reactnative/flash_list/models/TestCollection.kt +0 -6
  120. package/android/src/test/java/com/shopify/reactnative/flash_list/models/TestDataModel.kt +0 -8
  121. package/android/src/test/resources/LayoutTestData.json +0 -788
  122. package/dist/GridLayoutProviderWithProps.d.ts +0 -42
  123. package/dist/GridLayoutProviderWithProps.d.ts.map +0 -1
  124. package/dist/GridLayoutProviderWithProps.js +0 -114
  125. package/dist/GridLayoutProviderWithProps.js.map +0 -1
  126. package/dist/MasonryFlashList.d.ts +0 -51
  127. package/dist/MasonryFlashList.d.ts.map +0 -1
  128. package/dist/MasonryFlashList.js +0 -252
  129. package/dist/MasonryFlashList.js.map +0 -1
  130. package/dist/PureComponentWrapper.d.ts +0 -22
  131. package/dist/PureComponentWrapper.d.ts.map +0 -1
  132. package/dist/PureComponentWrapper.js +0 -37
  133. package/dist/PureComponentWrapper.js.map +0 -1
  134. package/dist/__tests__/ContentContainerUtils.test.d.ts +0 -2
  135. package/dist/__tests__/ContentContainerUtils.test.d.ts.map +0 -1
  136. package/dist/__tests__/ContentContainerUtils.test.js +0 -85
  137. package/dist/__tests__/ContentContainerUtils.test.js.map +0 -1
  138. package/dist/__tests__/FlashList.test.d.ts +0 -2
  139. package/dist/__tests__/FlashList.test.d.ts.map +0 -1
  140. package/dist/__tests__/FlashList.test.js +0 -902
  141. package/dist/__tests__/FlashList.test.js.map +0 -1
  142. package/dist/__tests__/GridLayoutProviderWithProps.test.d.ts +0 -2
  143. package/dist/__tests__/GridLayoutProviderWithProps.test.d.ts.map +0 -1
  144. package/dist/__tests__/GridLayoutProviderWithProps.test.js +0 -143
  145. package/dist/__tests__/GridLayoutProviderWithProps.test.js.map +0 -1
  146. package/dist/__tests__/MasonryFlashList.test.d.ts +0 -2
  147. package/dist/__tests__/MasonryFlashList.test.d.ts.map +0 -1
  148. package/dist/__tests__/MasonryFlashList.test.js +0 -254
  149. package/dist/__tests__/MasonryFlashList.test.js.map +0 -1
  150. package/dist/__tests__/PlatformHelper.web.test.d.ts +0 -2
  151. package/dist/__tests__/PlatformHelper.web.test.d.ts.map +0 -1
  152. package/dist/__tests__/PlatformHelper.web.test.js +0 -33
  153. package/dist/__tests__/PlatformHelper.web.test.js.map +0 -1
  154. package/dist/__tests__/helpers/mountFlashList.d.ts +0 -19
  155. package/dist/__tests__/helpers/mountFlashList.d.ts.map +0 -1
  156. package/dist/__tests__/helpers/mountFlashList.js +0 -44
  157. package/dist/__tests__/helpers/mountFlashList.js.map +0 -1
  158. package/dist/__tests__/helpers/mountMasonryFlashList.d.ts +0 -18
  159. package/dist/__tests__/helpers/mountMasonryFlashList.d.ts.map +0 -1
  160. package/dist/__tests__/helpers/mountMasonryFlashList.js +0 -49
  161. package/dist/__tests__/helpers/mountMasonryFlashList.js.map +0 -1
  162. package/dist/__tests__/useBlankAreaTracker.test.d.ts +0 -2
  163. package/dist/__tests__/useBlankAreaTracker.test.d.ts.map +0 -1
  164. package/dist/__tests__/useBlankAreaTracker.test.js +0 -179
  165. package/dist/__tests__/useBlankAreaTracker.test.js.map +0 -1
  166. package/dist/benchmark/useBlankAreaTracker.d.ts +0 -34
  167. package/dist/benchmark/useBlankAreaTracker.d.ts.map +0 -1
  168. package/dist/benchmark/useBlankAreaTracker.js +0 -66
  169. package/dist/benchmark/useBlankAreaTracker.js.map +0 -1
  170. package/dist/enableNewCore.d.ts +0 -3
  171. package/dist/enableNewCore.d.ts.map +0 -1
  172. package/dist/enableNewCore.js +0 -25
  173. package/dist/enableNewCore.js.map +0 -1
  174. package/dist/errors/CustomError.d.ts +0 -8
  175. package/dist/errors/CustomError.d.ts.map +0 -1
  176. package/dist/errors/CustomError.js +0 -14
  177. package/dist/errors/CustomError.js.map +0 -1
  178. package/dist/errors/ExceptionList.d.ts +0 -24
  179. package/dist/errors/ExceptionList.d.ts.map +0 -1
  180. package/dist/errors/ExceptionList.js +0 -26
  181. package/dist/errors/ExceptionList.js.map +0 -1
  182. package/dist/errors/Warnings.d.ts +0 -9
  183. package/dist/errors/Warnings.d.ts.map +0 -1
  184. package/dist/errors/Warnings.js +0 -13
  185. package/dist/errors/Warnings.js.map +0 -1
  186. package/dist/native/auto-layout/AutoLayoutView.d.ts +0 -22
  187. package/dist/native/auto-layout/AutoLayoutView.d.ts.map +0 -1
  188. package/dist/native/auto-layout/AutoLayoutView.js +0 -48
  189. package/dist/native/auto-layout/AutoLayoutView.js.map +0 -1
  190. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.android.d.ts +0 -4
  191. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.android.d.ts.map +0 -1
  192. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.android.js +0 -6
  193. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.android.js.map +0 -1
  194. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.d.ts +0 -5
  195. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.d.ts.map +0 -1
  196. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.ios.d.ts +0 -4
  197. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.ios.d.ts.map +0 -1
  198. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.ios.js +0 -6
  199. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.ios.js.map +0 -1
  200. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.js +0 -6
  201. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.js.map +0 -1
  202. package/dist/native/auto-layout/AutoLayoutViewNativeComponentProps.d.ts +0 -16
  203. package/dist/native/auto-layout/AutoLayoutViewNativeComponentProps.d.ts.map +0 -1
  204. package/dist/native/auto-layout/AutoLayoutViewNativeComponentProps.js +0 -3
  205. package/dist/native/auto-layout/AutoLayoutViewNativeComponentProps.js.map +0 -1
  206. package/dist/native/cell-container/CellContainer.android.d.ts +0 -6
  207. package/dist/native/cell-container/CellContainer.android.d.ts.map +0 -1
  208. package/dist/native/cell-container/CellContainer.android.js +0 -9
  209. package/dist/native/cell-container/CellContainer.android.js.map +0 -1
  210. package/dist/native/cell-container/CellContainer.d.ts +0 -8
  211. package/dist/native/cell-container/CellContainer.d.ts.map +0 -1
  212. package/dist/native/cell-container/CellContainer.ios.d.ts +0 -6
  213. package/dist/native/cell-container/CellContainer.ios.d.ts.map +0 -1
  214. package/dist/native/cell-container/CellContainer.ios.js +0 -9
  215. package/dist/native/cell-container/CellContainer.ios.js.map +0 -1
  216. package/dist/native/cell-container/CellContainer.js +0 -11
  217. package/dist/native/cell-container/CellContainer.js.map +0 -1
  218. package/dist/native/cell-container/CellContainer.web.d.ts +0 -7
  219. package/dist/native/cell-container/CellContainer.web.d.ts.map +0 -1
  220. package/dist/native/cell-container/CellContainer.web.js +0 -13
  221. package/dist/native/cell-container/CellContainer.web.js.map +0 -1
  222. package/dist/specs/AutoLayoutNativeComponent.d.ts +0 -18
  223. package/dist/specs/AutoLayoutNativeComponent.d.ts.map +0 -1
  224. package/dist/specs/AutoLayoutNativeComponent.js +0 -6
  225. package/dist/specs/AutoLayoutNativeComponent.js.map +0 -1
  226. package/dist/specs/CellContainerNativeComponent.d.ts +0 -8
  227. package/dist/specs/CellContainerNativeComponent.d.ts.map +0 -1
  228. package/dist/specs/CellContainerNativeComponent.js +0 -6
  229. package/dist/specs/CellContainerNativeComponent.js.map +0 -1
  230. package/dist/utils/ContentContainerUtils.d.ts +0 -27
  231. package/dist/utils/ContentContainerUtils.d.ts.map +0 -1
  232. package/dist/utils/ContentContainerUtils.js +0 -48
  233. package/dist/utils/ContentContainerUtils.js.map +0 -1
  234. package/dist/viewability/ViewToken.d.ts.map +0 -1
  235. package/dist/viewability/ViewToken.js.map +0 -1
  236. package/dist/viewability/ViewabilityHelper.d.ts.map +0 -1
  237. package/dist/viewability/ViewabilityManager.d.ts.map +0 -1
  238. package/dist/viewability/ViewabilityManager.js.map +0 -1
  239. package/ios/RNFlashList.xcodeproj/project.pbxproj +0 -3
  240. package/ios/RNFlashList.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
  241. package/ios/Sources/AutoLayoutView.swift +0 -294
  242. package/ios/Sources/AutoLayoutViewComponentView.h +0 -16
  243. package/ios/Sources/AutoLayoutViewComponentView.mm +0 -90
  244. package/ios/Sources/AutoLayoutViewManager.mm +0 -14
  245. package/ios/Sources/AutoLayoutViewManager.swift +0 -12
  246. package/ios/Sources/CellContainerComponentView.h +0 -18
  247. package/ios/Sources/CellContainerComponentView.mm +0 -62
  248. package/ios/Sources/CellContainerManager.mm +0 -8
  249. package/ios/Sources/CellContainerManager.swift +0 -12
  250. package/ios/Sources/FlatListPro-Bridging-Header.h +0 -11
  251. package/ios/Tests/AutoLayoutViewTests.swift +0 -113
  252. package/src/FlashList.tsx +0 -953
  253. package/src/GridLayoutProviderWithProps.ts +0 -180
  254. package/src/MasonryFlashList.tsx +0 -476
  255. package/src/PureComponentWrapper.tsx +0 -42
  256. package/src/__tests__/ContentContainerUtils.test.ts +0 -130
  257. package/src/__tests__/FlashList.test.tsx +0 -1001
  258. package/src/__tests__/GridLayoutProviderWithProps.test.ts +0 -179
  259. package/src/__tests__/MasonryFlashList.test.ts +0 -292
  260. package/src/__tests__/PlatformHelper.web.test.ts +0 -45
  261. package/src/__tests__/helpers/mountFlashList.tsx +0 -62
  262. package/src/__tests__/helpers/mountMasonryFlashList.tsx +0 -70
  263. package/src/__tests__/useBlankAreaTracker.test.tsx +0 -206
  264. package/src/benchmark/useBlankAreaTracker.ts +0 -117
  265. package/src/enableNewCore.ts +0 -24
  266. package/src/errors/CustomError.ts +0 -10
  267. package/src/errors/ExceptionList.ts +0 -28
  268. package/src/errors/Warnings.ts +0 -15
  269. package/src/native/auto-layout/AutoLayoutView.tsx +0 -73
  270. package/src/native/auto-layout/AutoLayoutViewNativeComponent.android.ts +0 -7
  271. package/src/native/auto-layout/AutoLayoutViewNativeComponent.ios.ts +0 -7
  272. package/src/native/auto-layout/AutoLayoutViewNativeComponent.ts +0 -7
  273. package/src/native/auto-layout/AutoLayoutViewNativeComponentProps.ts +0 -17
  274. package/src/native/cell-container/CellContainer.android.ts +0 -7
  275. package/src/native/cell-container/CellContainer.ios.ts +0 -7
  276. package/src/native/cell-container/CellContainer.tsx +0 -14
  277. package/src/native/cell-container/CellContainer.web.tsx +0 -9
  278. package/src/specs/AutoLayoutNativeComponent.ts +0 -24
  279. package/src/specs/CellContainerNativeComponent.ts +0 -9
  280. package/src/utils/ContentContainerUtils.ts +0 -92
  281. /package/dist/{viewability → recyclerview/viewability}/ViewToken.d.ts +0 -0
  282. /package/dist/{viewability → recyclerview/viewability}/ViewToken.js +0 -0
  283. /package/src/{viewability → recyclerview/viewability}/ViewToken.ts +0 -0
@@ -1,158 +0,0 @@
1
- package com.shopify.reactnative.flash_list
2
-
3
- import android.content.Context
4
- import android.graphics.Canvas
5
- import android.util.DisplayMetrics
6
- import android.util.Log
7
- import android.view.View
8
- import android.view.ViewGroup
9
- import android.widget.HorizontalScrollView
10
- import android.widget.ScrollView
11
- import com.facebook.react.bridge.Arguments
12
- import com.facebook.react.bridge.ReactContext
13
- import com.facebook.react.bridge.WritableMap
14
- import com.facebook.react.uimanager.UIManagerHelper
15
- import com.facebook.react.uimanager.events.EventDispatcher
16
- import com.facebook.react.uimanager.events.RCTEventEmitter
17
- import com.facebook.react.views.view.ReactViewGroup
18
-
19
-
20
- /** Container for all RecyclerListView children. This will automatically remove all gaps and overlaps for GridLayouts with flexible spans.
21
- * Note: This cannot work for masonry layouts i.e, pinterest like layout */
22
- class AutoLayoutView(context: Context) : ReactViewGroup(context) {
23
- val alShadow = AutoLayoutShadow()
24
- var enableInstrumentation = false
25
- var disableAutoLayout = false
26
-
27
- var pixelDensity = 1.0;
28
-
29
- /** Overriding draw instead of onLayout. RecyclerListView uses absolute positions for each and every item which means that changes in child layouts may not trigger onLayout on this container. The same layout
30
- * can still cause views to overlap. Therefore, it makes sense to override draw to do correction. */
31
- override fun dispatchDraw(canvas: Canvas) {
32
- fixLayout()
33
- fixFooter()
34
- super.dispatchDraw(canvas)
35
-
36
- val parentScrollView = getParentScrollView()
37
- if (enableInstrumentation && parentScrollView != null) {
38
- /** Since we need to call this method with scrollOffset on the UI thread and not with the one react has we're querying parent's parent
39
- directly which will be a ScrollView. If it isn't reported values will be incorrect but the component will not break.
40
- RecyclerListView is expected not to change the hierarchy of children. */
41
-
42
- val scrollContainerSize = if (alShadow.horizontal) parentScrollView.width else parentScrollView.height
43
-
44
- val scrollOffset = if (alShadow.horizontal) parentScrollView.scrollX else parentScrollView.scrollY
45
-
46
- val startOffset = if (alShadow.horizontal) left else top
47
- val endOffset = if (alShadow.horizontal) right else bottom
48
-
49
- val distanceFromWindowStart = kotlin.math.max(startOffset - scrollOffset, 0)
50
- val distanceFromWindowEnd = kotlin.math.max(scrollOffset + scrollContainerSize - endOffset, 0)
51
-
52
- alShadow.computeBlankFromGivenOffset(scrollOffset, distanceFromWindowStart, distanceFromWindowEnd)
53
- emitBlankAreaEvent()
54
- }
55
- }
56
-
57
- /** Sorts views by index and then invokes clearGaps which does the correction.
58
- * Performance: Sort is needed. Given relatively low number of views in RecyclerListView render tree this should be a non issue.*/
59
- private fun fixLayout() {
60
- if (childCount > 1 && !disableAutoLayout) {
61
- val positionSortedViews: Array<CellContainer> = Array(childCount) {
62
- val child = getChildAt(it)
63
- if (child is CellContainer) {
64
- child
65
- } else {
66
- throw IllegalStateException("CellRendererComponent outer view should always be CellContainer. Learn more here: https://shopify.github.io/flash-list/docs/usage#cellrenderercomponent.")
67
- }
68
- }
69
- positionSortedViews.sortBy { it.index }
70
- alShadow.offsetFromStart = if (alShadow.horizontal) left else top
71
- alShadow.clearGapsAndOverlaps(positionSortedViews)
72
- }
73
- }
74
-
75
- /** Fixes footer position along with rest of the items */
76
- private fun fixFooter() {
77
- val parentScrollView = getParentScrollView()
78
- if (disableAutoLayout || parentScrollView == null) {
79
- return
80
- }
81
- val isAutoLayoutEndVisible = if (alShadow.horizontal) right <= parentScrollView.width else bottom <= parentScrollView.height
82
- if (!isAutoLayoutEndVisible) {
83
- return
84
- }
85
- val autoLayoutParent = parent as? View
86
- val footer = getFooter();
87
- val diff = getFooterDiff()
88
- if (diff == 0 || footer == null || autoLayoutParent == null) {
89
- return
90
- }
91
-
92
- if (alShadow.horizontal) {
93
- footer.offsetLeftAndRight(diff)
94
- right += diff
95
- autoLayoutParent.right += diff
96
- } else {
97
- footer.offsetTopAndBottom(diff)
98
- bottom += diff
99
- autoLayoutParent.bottom += diff
100
- }
101
- }
102
-
103
- private fun getFooterDiff(): Int {
104
- if (childCount == 0) {
105
- alShadow.lastMaxBoundOverall = 0
106
- } else if (childCount == 1) {
107
- val firstChild = getChildAt(0)
108
- alShadow.lastMaxBoundOverall = if (alShadow.horizontal) {
109
- firstChild.right
110
- } else {
111
- firstChild.bottom
112
- }
113
- }
114
- val autoLayoutEnd = if (alShadow.horizontal) right - left else bottom - top
115
- return alShadow.lastMaxBoundOverall - autoLayoutEnd
116
- }
117
-
118
- private fun getFooter(): View? {
119
- return (parent as? ViewGroup)?.let {
120
- for (i in 0 until it.childCount) {
121
- val view = it.getChildAt(i)
122
- if (view is CellContainer && view.index == -1) {
123
- return@let view
124
- }
125
- }
126
- return@let null
127
- }
128
- }
129
-
130
- private fun getParentScrollView(): View? {
131
- var autoLayoutParent = parent;
132
- while (autoLayoutParent != null) {
133
- if (autoLayoutParent is ScrollView || autoLayoutParent is HorizontalScrollView) {
134
- return autoLayoutParent as View
135
- }
136
- autoLayoutParent = autoLayoutParent.parent;
137
- }
138
- return null
139
- }
140
-
141
-
142
- private fun emitBlankAreaEvent() {
143
- val eventDispatcher: EventDispatcher? =
144
- UIManagerHelper.getEventDispatcherForReactTag(context as ReactContext, id)
145
-
146
- if (eventDispatcher != null) {
147
- val surfaceId = UIManagerHelper.getSurfaceId(context as ReactContext)
148
- eventDispatcher.dispatchEvent(
149
- BlankAreaEvent(
150
- surfaceId,
151
- viewTag = id,
152
- offsetStart = alShadow.blankOffsetAtStart / pixelDensity,
153
- offsetEnd = alShadow.blankOffsetAtEnd / pixelDensity
154
- )
155
- )
156
- }
157
- }
158
- }
@@ -1,70 +0,0 @@
1
- package com.shopify.reactnative.flash_list
2
-
3
- import com.facebook.react.module.annotations.ReactModule
4
- import com.facebook.react.uimanager.ThemedReactContext
5
- import com.facebook.react.uimanager.annotations.ReactProp
6
- import com.facebook.react.uimanager.ViewGroupManager
7
- import com.facebook.react.uimanager.ViewManagerDelegate
8
- import com.facebook.react.viewmanagers.AutoLayoutViewManagerDelegate
9
- import com.facebook.react.viewmanagers.AutoLayoutViewManagerInterface
10
- import kotlin.math.roundToInt
11
-
12
- /** ViewManager for AutoLayoutView - Container for all RecyclerListView children. Automatically removes all gaps and overlaps for GridLayouts with flexible spans.
13
- * Note: This cannot work for masonry layouts i.e, pinterest like layout */
14
- @ReactModule(name = AutoLayoutViewManager.REACT_CLASS)
15
- class AutoLayoutViewManager: ViewGroupManager<AutoLayoutView>(), AutoLayoutViewManagerInterface<AutoLayoutView> {
16
- private val mDelegate: AutoLayoutViewManagerDelegate<AutoLayoutView, AutoLayoutViewManager> =
17
- AutoLayoutViewManagerDelegate(this)
18
-
19
- companion object {
20
- const val REACT_CLASS = "AutoLayoutView"
21
- }
22
-
23
- override fun getName(): String {
24
- return REACT_CLASS
25
- }
26
-
27
- override fun getDelegate(): ViewManagerDelegate<AutoLayoutView> = mDelegate
28
-
29
- override fun createViewInstance(context: ThemedReactContext): AutoLayoutView {
30
- return AutoLayoutView(context).also { it.pixelDensity = context.resources.displayMetrics.density.toDouble() }
31
- }
32
-
33
- override fun getExportedCustomDirectEventTypeConstants() = mutableMapOf(
34
- "onBlankAreaEvent" to mutableMapOf("registrationName" to "onBlankAreaEvent"),
35
- )
36
-
37
- @ReactProp(name = "horizontal")
38
- override fun setHorizontal(view: AutoLayoutView, isHorizontal: Boolean) {
39
- view.alShadow.horizontal = isHorizontal
40
- }
41
-
42
- @ReactProp(name = "disableAutoLayout")
43
- override fun setDisableAutoLayout(view: AutoLayoutView, disableAutoLayout: Boolean) {
44
- view.disableAutoLayout = disableAutoLayout
45
- }
46
-
47
- @ReactProp(name = "scrollOffset")
48
- override fun setScrollOffset(view: AutoLayoutView, scrollOffset: Double) {
49
- view.alShadow.scrollOffset = convertToPixelLayout(scrollOffset, view.pixelDensity)
50
- }
51
-
52
- @ReactProp(name = "windowSize")
53
- override fun setWindowSize(view: AutoLayoutView, windowSize: Double) {
54
- view.alShadow.windowSize = convertToPixelLayout(windowSize, view.pixelDensity)
55
- }
56
-
57
- @ReactProp(name = "renderAheadOffset")
58
- override fun setRenderAheadOffset(view: AutoLayoutView, renderOffset: Double) {
59
- view.alShadow.renderOffset = convertToPixelLayout(renderOffset, view.pixelDensity)
60
- }
61
-
62
- @ReactProp(name = "enableInstrumentation")
63
- override fun setEnableInstrumentation(view: AutoLayoutView, enableInstrumentation: Boolean) {
64
- view.enableInstrumentation = enableInstrumentation
65
- }
66
-
67
- private fun convertToPixelLayout(dp: Double, density: Double): Int {
68
- return (dp * density).roundToInt()
69
- }
70
- }
@@ -1,29 +0,0 @@
1
- @file:Suppress("DEPRECATION") // We want to use RCTEventEmitter for interop purposes
2
- package com.shopify.reactnative.flash_list
3
-
4
- import com.facebook.react.bridge.Arguments
5
- import com.facebook.react.bridge.WritableMap
6
- import com.facebook.react.uimanager.events.Event
7
- import com.facebook.react.uimanager.events.RCTEventEmitter
8
-
9
- class BlankAreaEvent(
10
- surfaceId: Int,
11
- viewTag: Int,
12
- private val offsetStart: Double,
13
- private val offsetEnd: Double
14
- ): Event<BlankAreaEvent>(surfaceId, viewTag) {
15
- override fun getEventName() = EVENT_NAME
16
-
17
- override fun getEventData(): WritableMap = Arguments.createMap().apply {
18
- putDouble("offsetStart", offsetStart)
19
- putDouble("offsetEnd", offsetEnd)
20
- }
21
-
22
- override fun dispatch(rctEventEmitter: RCTEventEmitter) {
23
- rctEventEmitter.receiveEvent(viewTag, eventName, getEventData())
24
- }
25
-
26
- companion object {
27
- const val EVENT_NAME: String = "onBlankAreaEvent"
28
- }
29
- }
@@ -1,16 +0,0 @@
1
- package com.shopify.reactnative.flash_list;
2
-
3
- public interface CellContainer {
4
- void setIndex(int value);
5
- int getIndex();
6
- void setLeft(int value);
7
- int getLeft();
8
- void setTop(int value);
9
- int getTop();
10
- void setRight(int value);
11
- int getRight();
12
- void setBottom(int value);
13
- int getBottom();
14
- int getHeight();
15
- int getWidth();
16
- }
@@ -1,16 +0,0 @@
1
- package com.shopify.reactnative.flash_list
2
-
3
- import android.content.Context
4
- import com.facebook.react.views.view.ReactViewGroup
5
-
6
- class CellContainerImpl(context: Context) : ReactViewGroup(context), CellContainer {
7
- private var index = -1
8
- override fun setIndex(value: Int) {
9
- index = value
10
- }
11
-
12
- override fun getIndex(): Int {
13
- return index
14
- }
15
-
16
- }
@@ -1,34 +0,0 @@
1
- package com.shopify.reactnative.flash_list
2
-
3
- import com.facebook.react.module.annotations.ReactModule
4
- import com.facebook.react.uimanager.ThemedReactContext
5
- import com.facebook.react.uimanager.ViewGroupManager
6
- import com.facebook.react.uimanager.ViewManagerDelegate
7
- import com.facebook.react.uimanager.annotations.ReactProp
8
- import com.facebook.react.viewmanagers.CellContainerManagerDelegate
9
- import com.facebook.react.viewmanagers.CellContainerManagerInterface
10
-
11
- @ReactModule(name = AutoLayoutViewManager.REACT_CLASS)
12
- class CellContainerManager: ViewGroupManager<CellContainerImpl>(), CellContainerManagerInterface<CellContainerImpl> {
13
- private val mDelegate: CellContainerManagerDelegate<CellContainerImpl, CellContainerManager>
14
- = CellContainerManagerDelegate(this)
15
-
16
- companion object {
17
- const val REACT_CLASS = "CellContainer"
18
- }
19
-
20
- override fun getName(): String {
21
- return REACT_CLASS
22
- }
23
-
24
- override fun getDelegate(): ViewManagerDelegate<CellContainerImpl> = mDelegate
25
-
26
- override fun createViewInstance(context: ThemedReactContext): CellContainerImpl {
27
- return CellContainerImpl(context)
28
- }
29
-
30
- @ReactProp(name = "index")
31
- override fun setIndex(view: CellContainerImpl, index: Int) {
32
- view.index = index
33
- }
34
- }
@@ -1,19 +0,0 @@
1
- package com.shopify.reactnative.flash_list
2
-
3
- import com.facebook.react.ReactPackage
4
- import com.facebook.react.bridge.NativeModule
5
- import com.facebook.react.bridge.ReactApplicationContext
6
- import com.facebook.react.uimanager.ViewManager
7
-
8
- class ReactNativeFlashListPackage : ReactPackage {
9
- override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
10
- return listOf()
11
- }
12
-
13
- override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
14
- return listOf(
15
- AutoLayoutViewManager(),
16
- CellContainerManager()
17
- )
18
- }
19
- }
@@ -1,47 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GeneratePropsJavaDelegate.js
8
- */
9
-
10
- package com.facebook.react.viewmanagers;
11
-
12
- import android.view.View;
13
- import androidx.annotation.Nullable;
14
- import com.facebook.react.uimanager.BaseViewManager;
15
- import com.facebook.react.uimanager.BaseViewManagerDelegate;
16
- import com.facebook.react.uimanager.LayoutShadowNode;
17
-
18
- public class AutoLayoutViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & AutoLayoutViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
19
- public AutoLayoutViewManagerDelegate(U viewManager) {
20
- super(viewManager);
21
- }
22
- @Override
23
- public void setProperty(T view, String propName, @Nullable Object value) {
24
- switch (propName) {
25
- case "horizontal":
26
- mViewManager.setHorizontal(view, value == null ? false : (boolean) value);
27
- break;
28
- case "scrollOffset":
29
- mViewManager.setScrollOffset(view, value == null ? 0f : ((Double) value).doubleValue());
30
- break;
31
- case "windowSize":
32
- mViewManager.setWindowSize(view, value == null ? 0f : ((Double) value).doubleValue());
33
- break;
34
- case "renderAheadOffset":
35
- mViewManager.setRenderAheadOffset(view, value == null ? 0f : ((Double) value).doubleValue());
36
- break;
37
- case "enableInstrumentation":
38
- mViewManager.setEnableInstrumentation(view, value == null ? false : (boolean) value);
39
- break;
40
- case "disableAutoLayout":
41
- mViewManager.setDisableAutoLayout(view, value == null ? false : (boolean) value);
42
- break;
43
- default:
44
- super.setProperty(view, propName, value);
45
- }
46
- }
47
- }
@@ -1,21 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GeneratePropsJavaInterface.js
8
- */
9
-
10
- package com.facebook.react.viewmanagers;
11
-
12
- import android.view.View;
13
-
14
- public interface AutoLayoutViewManagerInterface<T extends View> {
15
- void setHorizontal(T view, boolean value);
16
- void setScrollOffset(T view, double value);
17
- void setWindowSize(T view, double value);
18
- void setRenderAheadOffset(T view, double value);
19
- void setEnableInstrumentation(T view, boolean value);
20
- void setDisableAutoLayout(T view, boolean value);
21
- }
@@ -1,32 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GeneratePropsJavaDelegate.js
8
- */
9
-
10
- package com.facebook.react.viewmanagers;
11
-
12
- import android.view.View;
13
- import androidx.annotation.Nullable;
14
- import com.facebook.react.uimanager.BaseViewManager;
15
- import com.facebook.react.uimanager.BaseViewManagerDelegate;
16
- import com.facebook.react.uimanager.LayoutShadowNode;
17
-
18
- public class CellContainerManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & CellContainerManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
19
- public CellContainerManagerDelegate(U viewManager) {
20
- super(viewManager);
21
- }
22
- @Override
23
- public void setProperty(T view, String propName, @Nullable Object value) {
24
- switch (propName) {
25
- case "index":
26
- mViewManager.setIndex(view, value == null ? 0 : ((Double) value).intValue());
27
- break;
28
- default:
29
- super.setProperty(view, propName, value);
30
- }
31
- }
32
- }
@@ -1,16 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GeneratePropsJavaInterface.js
8
- */
9
-
10
- package com.facebook.react.viewmanagers;
11
-
12
- import android.view.View;
13
-
14
- public interface CellContainerManagerInterface<T extends View> {
15
- void setIndex(T view, int value);
16
- }
@@ -1,147 +0,0 @@
1
- package com.shopify.reactnative.flash_list
2
-
3
- import com.google.gson.Gson
4
- import com.shopify.reactnative.flash_list.models.Rect
5
- import com.shopify.reactnative.flash_list.models.TestDataModel
6
- import org.junit.Assert.assertEquals
7
- import org.junit.Test
8
-
9
- internal class AutoLayoutShadowTest {
10
- private val gson = Gson()
11
-
12
- /**
13
- * Test against expected output from stored JSON */
14
- @Test
15
- fun clearGapsAndOverlapsVerticalList() {
16
- val alShadow = getAutolayoutShadow(0)
17
- val testModel = getTestModel()
18
- testModel.vertical.forEachIndexed { index, it ->
19
- alShadow.clearGapsAndOverlaps(it.input as Array<CellContainer>)
20
- assertEquals("Index: $index", gson.toJson(it.expectedOutput), gson.toJson(it.input))
21
- }
22
- }
23
-
24
- /**
25
- * Test against expected output from stored JSON */
26
- @Test
27
- fun clearGapsAndOverlapsHorizontalList() {
28
- val alShadow = getAutolayoutShadow(0)
29
- alShadow.horizontal = true
30
- val testModel = getTestModel()
31
- testModel.horizontal.forEachIndexed { index, it ->
32
- alShadow.clearGapsAndOverlaps(it.input as Array<CellContainer>)
33
- assertEquals("Index: $index", gson.toJson(it.expectedOutput), gson.toJson(it.input))
34
- }
35
- }
36
-
37
- /**
38
- * Test against expected output from stored JSON */
39
- @Test
40
- fun clearGapsAndOverlapsWindowSize() {
41
- val alShadow = getAutolayoutShadow(0)
42
- alShadow.horizontal = true
43
- alShadow.windowSize = 90
44
- val testModel = getTestModel()
45
- testModel.window.forEachIndexed { index, it ->
46
- alShadow.clearGapsAndOverlaps(it.input as Array<CellContainer>)
47
- assertEquals("Index: $index", gson.toJson(it.expectedOutput), gson.toJson(it.input))
48
- }
49
- }
50
-
51
- /**
52
- * Should only correct items in the visible window*/
53
- @Test
54
- fun clearGapsAndOverlapsBoundaryTest() {
55
- val alShadow = getAutolayoutShadow(300)
56
- alShadow.renderOffset = 100
57
-
58
- //--------- Vertical -----------
59
- //Item above visible window
60
- arrayOf<CellContainer>(getRect(0, 0, 100, 100, 0), getRect(120, 0, 100, 100, 1)).let {
61
- alShadow.clearGapsAndOverlaps(it)
62
- assertEquals(120, it[1].left)
63
- }
64
-
65
- //Item below visible window
66
- arrayOf<CellContainer>(getRect(0, 0, 100, 100, 0), getRect(120, 850, 100, 950, 1)).let {
67
- alShadow.clearGapsAndOverlaps(it)
68
- assertEquals(850, it[1].top)
69
- }
70
-
71
- //Item within visible window
72
- arrayOf<CellContainer>(getRect(0, 250, 100, 100, 0), getRect(120, 250, 100, 100, 1)).let {
73
- alShadow.clearGapsAndOverlaps(it)
74
- assertEquals(100, it[1].left)
75
- }
76
-
77
- //At the top edge
78
- arrayOf<CellContainer>(getRect(0, 200, 100, 100, 0), getRect(120, 200, 100, 100, 1)).let {
79
- alShadow.clearGapsAndOverlaps(it)
80
- assertEquals(100, it[1].left)
81
- }
82
-
83
- //--------- Horizontal -----------
84
-
85
- alShadow.horizontal = true
86
-
87
- //Item left of visible window
88
- arrayOf<CellContainer>(getRect(0, 0, 100, 100, 0), getRect(0, 120, 100, 100, 1)).let {
89
- alShadow.clearGapsAndOverlaps(it)
90
- assertEquals(120, it[1].top)
91
- }
92
-
93
- //Item right of visible window
94
- arrayOf<CellContainer>(getRect(0, 0, 100, 100, 0), getRect(850, 120, 950, 220, 1)).let {
95
- alShadow.clearGapsAndOverlaps(it)
96
- assertEquals(120, it[1].top)
97
- }
98
-
99
- //Item within visible window
100
- arrayOf<CellContainer>(getRect(250, 0, 100, 100, 0), getRect(250, 120, 100, 100, 1)).let {
101
- alShadow.clearGapsAndOverlaps(it)
102
- assertEquals(100, it[1].top)
103
- }
104
-
105
- //At the left edge
106
- arrayOf<CellContainer>(getRect(200, 0, 100, 100, 0), getRect(250, 150, 100, 100, 1)).let {
107
- alShadow.clearGapsAndOverlaps(it)
108
- assertEquals(100, it[1].top)
109
- }
110
- }
111
-
112
- @Test
113
- fun checkBlankForLastItem() {
114
- val alShadow = getAutolayoutShadow(0)
115
- val testModel = getTestModel()
116
- testModel.vertical.forEachIndexed { index, it ->
117
- alShadow.clearGapsAndOverlaps(it.input as Array<CellContainer>)
118
- it.expectedOutput.map { value -> value.bottom }.maxOrNull()?.let { max ->
119
- alShadow.computeBlankFromGivenOffset(0, 0, 0)
120
- assertEquals("Index: $index", alShadow.windowSize - max, alShadow.blankOffsetAtEnd)
121
- }
122
- }
123
- }
124
-
125
- private fun getTestModel(): TestDataModel {
126
- var str = this.javaClass.classLoader.getResource("LayoutTestData.json").readText()
127
- return gson.fromJson<TestDataModel>(str, TestDataModel::class.java)
128
- }
129
-
130
- private fun getRect(l: Int, t: Int, r: Int, b: Int, index: Int): Rect {
131
- var rect = Rect(b - t, r - l)
132
- rect.left = l
133
- rect.right = r
134
- rect.bottom = b
135
- rect.top = t
136
- rect.index = index
137
- return rect
138
- }
139
-
140
- private fun getAutolayoutShadow(offset: Int): AutoLayoutShadow {
141
- val alShadow = AutoLayoutShadow()
142
- alShadow.windowSize = 500
143
- alShadow.renderOffset = 0
144
- alShadow.scrollOffset = offset
145
- return alShadow
146
- }
147
- }
@@ -1,61 +0,0 @@
1
- package com.shopify.reactnative.flash_list.models
2
-
3
- import com.shopify.reactnative.flash_list.CellContainer
4
-
5
- class Rect (h: Int? = 0, w: Int? = 0): CellContainer {
6
- private var left = 0
7
- private var right = 0
8
- private var top = 0
9
- private var bottom = 0
10
- private var height = 0
11
- private var width = 0
12
- private var index = 0
13
-
14
- override fun setIndex(value: Int) {
15
- index = value
16
- }
17
-
18
- override fun getIndex(): Int {
19
- return index
20
- }
21
-
22
- override fun setLeft(value: Int) {
23
- left = value
24
- }
25
-
26
- override fun getLeft(): Int {
27
- return left
28
- }
29
-
30
- override fun setTop(value: Int) {
31
- top = value
32
- }
33
-
34
- override fun getTop(): Int {
35
- return top
36
- }
37
-
38
- override fun setRight(value: Int) {
39
- right = value
40
- }
41
-
42
- override fun getRight(): Int {
43
- return right
44
- }
45
-
46
- override fun setBottom(value: Int) {
47
- bottom = value
48
- }
49
-
50
- override fun getBottom(): Int {
51
- return bottom
52
- }
53
-
54
- override fun getHeight(): Int {
55
- return height
56
- }
57
-
58
- override fun getWidth(): Int {
59
- return width
60
- }
61
- }
@@ -1,6 +0,0 @@
1
- package com.shopify.reactnative.flash_list.models
2
-
3
- class TestCollection {
4
- lateinit var input: Array<Rect>
5
- lateinit var expectedOutput: Array<Rect>
6
- }