@amazon-devices/react-native-safe-area-context 2.0.1759135970 → 8.0.9000000000-rn-83

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 (260) hide show
  1. package/README.md +6 -302
  2. package/SystemBundles/920f0b3a0c43cc93db1621b4c3a47e06a0d4ed32175c793e9934ad9c764fbc25.bundle +7374 -0
  3. package/SystemBundles/920f0b3a0c43cc93db1621b4c3a47e06a0d4ed32175c793e9934ad9c764fbc25.map +2780 -0
  4. package/SystemModules/amzn__react-native-safe-area-context-8.modules.txt +7 -0
  5. package/SystemModules/amzn__react-native-safe-area-context-8.private.modules.txt +61 -0
  6. package/SystemModules/keplerscript-system-bundle-config.json +3 -3
  7. package/android/build.gradle +103 -25
  8. package/android/gradle.properties +1 -0
  9. package/android/spotless.gradle +24 -0
  10. package/android/src/fabric/java/com/th3rdwave/safeareacontext/InsetsChangeEvent.kt +25 -0
  11. package/android/src/fabric/java/com/th3rdwave/safeareacontext/UIManagerHelperCompat.kt +14 -0
  12. package/android/src/main/AndroidManifest.xml +1 -2
  13. package/android/src/main/java/com/th3rdwave/safeareacontext/EdgeInsets.kt +3 -0
  14. package/android/src/main/java/com/th3rdwave/safeareacontext/Rect.kt +3 -0
  15. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaContextModule.kt +32 -0
  16. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaContextPackage.kt +41 -0
  17. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaProvider.kt +47 -0
  18. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaProviderManager.kt +41 -0
  19. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaUtils.kt +102 -0
  20. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaView.kt +155 -0
  21. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaViewEdges.kt +16 -0
  22. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaViewLocalData.kt +7 -0
  23. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaViewManager.kt +73 -0
  24. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaViewMode.kt +6 -0
  25. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaViewShadowNode.kt +170 -0
  26. package/android/src/main/java/com/th3rdwave/safeareacontext/SerializationUtils.kt +39 -0
  27. package/android/src/main/jni/CMakeLists.txt +87 -0
  28. package/android/src/main/jni/safeareacontext.h +17 -0
  29. package/android/src/paper/java/com/facebook/react/viewmanagers/RNCSafeAreaProviderManagerDelegate.java +31 -0
  30. package/android/src/paper/java/com/facebook/react/viewmanagers/RNCSafeAreaProviderManagerInterface.java +16 -0
  31. package/android/src/paper/java/com/facebook/react/viewmanagers/RNCSafeAreaViewManagerDelegate.java +41 -0
  32. package/android/src/paper/java/com/facebook/react/viewmanagers/RNCSafeAreaViewManagerInterface.java +20 -0
  33. package/android/src/paper/java/com/th3rdwave/safeareacontext/InsetsChangeEvent.kt +29 -0
  34. package/android/src/paper/java/com/th3rdwave/safeareacontext/NativeSafeAreaContextSpec.java +56 -0
  35. package/android/src/paper/java/com/th3rdwave/safeareacontext/UIManagerHelperCompat.kt +20 -0
  36. package/common/cpp/react/renderer/components/safeareacontext/RNCSafeAreaViewComponentDescriptor.h +25 -0
  37. package/common/cpp/react/renderer/components/safeareacontext/RNCSafeAreaViewShadowNode.cpp +131 -0
  38. package/common/cpp/react/renderer/components/safeareacontext/RNCSafeAreaViewShadowNode.h +36 -0
  39. package/common/cpp/react/renderer/components/safeareacontext/RNCSafeAreaViewState.cpp +23 -0
  40. package/common/cpp/react/renderer/components/safeareacontext/RNCSafeAreaViewState.h +56 -0
  41. package/ios/Fabric/RNCSafeAreaProviderComponentView.h +13 -0
  42. package/ios/Fabric/RNCSafeAreaProviderComponentView.mm +129 -0
  43. package/ios/Fabric/RNCSafeAreaViewComponentView.h +11 -0
  44. package/ios/Fabric/RNCSafeAreaViewComponentView.mm +153 -0
  45. package/ios/RNCSafeAreaContext.h +9 -0
  46. package/ios/RNCSafeAreaContext.mm +85 -0
  47. package/ios/{SafeAreaView/RNCSafeAreaProvider.h → RNCSafeAreaProvider.h} +4 -0
  48. package/ios/RNCSafeAreaProvider.m +102 -0
  49. package/ios/RNCSafeAreaProviderManager.m +20 -0
  50. package/ios/{SafeAreaView/RNCSafeAreaShadowView.m → RNCSafeAreaShadowView.m} +50 -36
  51. package/ios/RNCSafeAreaUtils.h +22 -0
  52. package/ios/RNCSafeAreaUtils.m +41 -0
  53. package/ios/{SafeAreaView/RNCSafeAreaView.h → RNCSafeAreaView.h} +8 -4
  54. package/ios/RNCSafeAreaView.m +168 -0
  55. package/ios/RNCSafeAreaViewEdgeMode.h +12 -0
  56. package/ios/RNCSafeAreaViewEdgeMode.m +16 -0
  57. package/ios/RNCSafeAreaViewEdges.h +15 -0
  58. package/ios/RNCSafeAreaViewEdges.m +36 -0
  59. package/ios/{SafeAreaView/RNCSafeAreaViewLocalData.h → RNCSafeAreaViewLocalData.h} +12 -1
  60. package/ios/{SafeAreaView/RNCSafeAreaViewLocalData.m → RNCSafeAreaViewLocalData.m} +4 -0
  61. package/ios/{SafeAreaView/RNCSafeAreaViewManager.m → RNCSafeAreaViewManager.m} +5 -1
  62. package/ios/RNCSafeAreaViewMode.m +15 -0
  63. package/ios/{SafeAreaView.xcodeproj → RNSafeAreaContext.xcodeproj}/project.pbxproj +70 -56
  64. package/jest/mock.tsx +59 -0
  65. package/kepler-compatibility.json +2 -2
  66. package/lib/commonjs/CompatNativeSafeAreaProvider.js +7 -8
  67. package/lib/commonjs/CompatNativeSafeAreaProvider.js.map +1 -1
  68. package/lib/commonjs/InitialWindow.js.map +1 -1
  69. package/lib/commonjs/InitialWindow.kepler.js +1 -1
  70. package/lib/commonjs/InitialWindow.kepler.js.map +1 -1
  71. package/lib/commonjs/InitialWindow.native.js +4 -4
  72. package/lib/commonjs/InitialWindow.native.js.map +1 -1
  73. package/lib/commonjs/NativeSafeAreaProvider.js +7 -125
  74. package/lib/commonjs/NativeSafeAreaProvider.js.map +1 -1
  75. package/lib/commonjs/NativeSafeAreaProvider.kepler.js +6 -2
  76. package/lib/commonjs/NativeSafeAreaProvider.kepler.js.map +1 -1
  77. package/lib/commonjs/NativeSafeAreaProvider.web.js +135 -0
  78. package/lib/commonjs/NativeSafeAreaProvider.web.js.map +1 -0
  79. package/lib/commonjs/NativeSafeAreaProvider.windows.js +6 -2
  80. package/lib/commonjs/NativeSafeAreaProvider.windows.js.map +1 -1
  81. package/lib/commonjs/SafeArea.types.js.map +1 -1
  82. package/lib/commonjs/SafeAreaContext.js +56 -36
  83. package/lib/commonjs/SafeAreaContext.js.map +1 -1
  84. package/lib/commonjs/SafeAreaView.js +40 -73
  85. package/lib/commonjs/SafeAreaView.js.map +1 -1
  86. package/lib/commonjs/SafeAreaView.kepler.js.map +1 -1
  87. package/lib/commonjs/SafeAreaView.web.js +91 -0
  88. package/lib/commonjs/SafeAreaView.web.js.map +1 -0
  89. package/lib/commonjs/SafeAreaView.windows.js.map +1 -1
  90. package/lib/commonjs/index.js +1 -0
  91. package/lib/commonjs/index.js.map +1 -1
  92. package/lib/commonjs/package.json +1 -0
  93. package/lib/commonjs/specs/NativeSafeAreaContext.js +9 -0
  94. package/lib/commonjs/specs/NativeSafeAreaContext.js.map +1 -0
  95. package/lib/commonjs/specs/NativeSafeAreaProvider.js +10 -0
  96. package/lib/commonjs/specs/NativeSafeAreaProvider.js.map +1 -0
  97. package/lib/commonjs/specs/NativeSafeAreaView.js +12 -0
  98. package/lib/commonjs/specs/NativeSafeAreaView.js.map +1 -0
  99. package/lib/module/CompatNativeSafeAreaProvider.js +8 -5
  100. package/lib/module/CompatNativeSafeAreaProvider.js.map +1 -1
  101. package/lib/module/InitialWindow.js +2 -0
  102. package/lib/module/InitialWindow.js.map +1 -1
  103. package/lib/module/InitialWindow.kepler.js +3 -1
  104. package/lib/module/InitialWindow.kepler.js.map +1 -1
  105. package/lib/module/InitialWindow.native.js +5 -4
  106. package/lib/module/InitialWindow.native.js.map +1 -1
  107. package/lib/module/NativeSafeAreaProvider.js +3 -122
  108. package/lib/module/NativeSafeAreaProvider.js.map +1 -1
  109. package/lib/module/NativeSafeAreaProvider.kepler.js +3 -2
  110. package/lib/module/NativeSafeAreaProvider.kepler.js.map +1 -1
  111. package/lib/module/NativeSafeAreaProvider.web.js +130 -0
  112. package/lib/module/NativeSafeAreaProvider.web.js.map +1 -0
  113. package/lib/module/NativeSafeAreaProvider.windows.js +3 -2
  114. package/lib/module/NativeSafeAreaProvider.windows.js.map +1 -1
  115. package/lib/module/SafeArea.types.js +2 -0
  116. package/lib/module/SafeArea.types.js.map +1 -1
  117. package/lib/module/SafeAreaContext.js +57 -33
  118. package/lib/module/SafeAreaContext.js.map +1 -1
  119. package/lib/module/SafeAreaView.js +38 -69
  120. package/lib/module/SafeAreaView.js.map +1 -1
  121. package/lib/module/SafeAreaView.kepler.js +2 -0
  122. package/lib/module/SafeAreaView.kepler.js.map +1 -1
  123. package/lib/module/SafeAreaView.web.js +86 -0
  124. package/lib/module/SafeAreaView.web.js.map +1 -0
  125. package/lib/module/SafeAreaView.windows.js +2 -0
  126. package/lib/module/SafeAreaView.windows.js.map +1 -1
  127. package/lib/module/index.js +3 -0
  128. package/lib/module/index.js.map +1 -1
  129. package/lib/module/specs/NativeSafeAreaContext.js +5 -0
  130. package/lib/module/specs/NativeSafeAreaContext.js.map +1 -0
  131. package/lib/module/specs/NativeSafeAreaProvider.js +5 -0
  132. package/lib/module/specs/NativeSafeAreaProvider.js.map +1 -0
  133. package/lib/module/specs/NativeSafeAreaView.js +7 -0
  134. package/lib/module/specs/NativeSafeAreaView.js.map +1 -0
  135. package/lib/typescript/CompatNativeSafeAreaProvider.d.ts +4 -0
  136. package/lib/typescript/CompatNativeSafeAreaProvider.d.ts.map +1 -0
  137. package/lib/typescript/{src/InitialWindow.d.ts → InitialWindow.d.ts} +2 -1
  138. package/lib/typescript/InitialWindow.d.ts.map +1 -0
  139. package/lib/typescript/{src/InitialWindow.kepler.d.ts → InitialWindow.kepler.d.ts} +1 -0
  140. package/lib/typescript/InitialWindow.kepler.d.ts.map +1 -0
  141. package/lib/typescript/{src/InitialWindow.native.d.ts → InitialWindow.native.d.ts} +2 -1
  142. package/lib/typescript/InitialWindow.native.d.ts.map +1 -0
  143. package/lib/typescript/NativeSafeAreaProvider.d.ts +3 -0
  144. package/lib/typescript/NativeSafeAreaProvider.d.ts.map +1 -0
  145. package/lib/typescript/NativeSafeAreaProvider.kepler.d.ts +2 -0
  146. package/lib/typescript/NativeSafeAreaProvider.kepler.d.ts.map +1 -0
  147. package/lib/typescript/NativeSafeAreaProvider.web.d.ts +4 -0
  148. package/lib/typescript/NativeSafeAreaProvider.web.d.ts.map +1 -0
  149. package/lib/typescript/NativeSafeAreaProvider.windows.d.ts +2 -0
  150. package/lib/typescript/NativeSafeAreaProvider.windows.d.ts.map +1 -0
  151. package/lib/typescript/SafeArea.types.d.ts +36 -0
  152. package/lib/typescript/SafeArea.types.d.ts.map +1 -0
  153. package/lib/typescript/{src/SafeAreaContext.d.ts → SafeAreaContext.d.ts} +9 -6
  154. package/lib/typescript/SafeAreaContext.d.ts.map +1 -0
  155. package/lib/typescript/SafeAreaView.d.ts +5 -0
  156. package/lib/typescript/SafeAreaView.d.ts.map +1 -0
  157. package/lib/typescript/{src/SafeAreaView.kepler.d.ts → SafeAreaView.kepler.d.ts} +1 -0
  158. package/lib/typescript/SafeAreaView.kepler.d.ts.map +1 -0
  159. package/lib/typescript/SafeAreaView.web.d.ts +4 -0
  160. package/lib/typescript/SafeAreaView.web.d.ts.map +1 -0
  161. package/lib/typescript/SafeAreaView.windows.d.ts +3 -0
  162. package/lib/typescript/SafeAreaView.windows.d.ts.map +1 -0
  163. package/lib/typescript/{src/index.d.ts → index.d.ts} +1 -0
  164. package/lib/typescript/index.d.ts.map +1 -0
  165. package/lib/typescript/specs/NativeSafeAreaContext.d.ts +23 -0
  166. package/lib/typescript/specs/NativeSafeAreaContext.d.ts.map +1 -0
  167. package/lib/typescript/specs/NativeSafeAreaProvider.d.ts +22 -0
  168. package/lib/typescript/specs/NativeSafeAreaProvider.d.ts.map +1 -0
  169. package/lib/typescript/specs/NativeSafeAreaView.d.ts +14 -0
  170. package/lib/typescript/specs/NativeSafeAreaView.d.ts.map +1 -0
  171. package/oss-attribution/attribution.txt +0 -0
  172. package/oss-attribution/licenseInfos.json +1 -0
  173. package/package.json +137 -1
  174. package/react-native-safe-area-context.podspec +26 -4
  175. package/react-native.config.js +8 -0
  176. package/src/CompatNativeSafeAreaProvider.tsx +2 -3
  177. package/src/InitialWindow.kepler.ts +1 -1
  178. package/src/InitialWindow.native.ts +5 -11
  179. package/src/InitialWindow.ts +1 -1
  180. package/src/NativeSafeAreaProvider.kepler.tsx +1 -3
  181. package/src/NativeSafeAreaProvider.tsx +2 -128
  182. package/src/NativeSafeAreaProvider.web.tsx +127 -0
  183. package/src/NativeSafeAreaProvider.windows.tsx +1 -3
  184. package/src/SafeArea.types.ts +15 -11
  185. package/src/SafeAreaContext.tsx +66 -43
  186. package/src/SafeAreaView.tsx +47 -82
  187. package/src/SafeAreaView.web.tsx +123 -0
  188. package/src/SafeAreaView.windows.tsx +2 -1
  189. package/src/index.tsx +2 -0
  190. package/src/specs/NativeSafeAreaContext.ts +23 -0
  191. package/src/specs/NativeSafeAreaProvider.ts +29 -0
  192. package/src/specs/NativeSafeAreaView.ts +17 -0
  193. package/SystemBundles/e3c0cdeab56b8b622d4f0fd5a80812eafe199fa2287d0e3a09c5e573a1035350.bundle +0 -11031
  194. package/SystemBundles/e3c0cdeab56b8b622d4f0fd5a80812eafe199fa2287d0e3a09c5e573a1035350.map +0 -1
  195. package/SystemModules/amzn__react-native-safe-area-context-2.modules.txt +0 -55
  196. package/SystemModules/amzn__react-native-safe-area-context-2.private.modules.txt +0 -91
  197. package/THIRD_PARTY_NOTICES.txt +0 -24
  198. package/android/src/main/java/com/th3rdwave/safeareacontext/EdgeInsets.java +0 -22
  199. package/android/src/main/java/com/th3rdwave/safeareacontext/InsetsChangeEvent.java +0 -33
  200. package/android/src/main/java/com/th3rdwave/safeareacontext/Rect.java +0 -22
  201. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaContextPackage.java +0 -31
  202. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaProvider.java +0 -66
  203. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaProviderManager.java +0 -94
  204. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaUtils.java +0 -82
  205. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaView.java +0 -159
  206. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaViewEdges.java +0 -8
  207. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaViewLocalData.java +0 -27
  208. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaViewManager.java +0 -72
  209. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaViewMode.java +0 -6
  210. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaViewShadowNode.java +0 -201
  211. package/android/src/main/java/com/th3rdwave/safeareacontext/SerializationUtils.java +0 -52
  212. package/ios/SafeAreaView/RCTView+SafeAreaCompat.h +0 -16
  213. package/ios/SafeAreaView/RCTView+SafeAreaCompat.m +0 -57
  214. package/ios/SafeAreaView/RNCSafeAreaProvider.m +0 -65
  215. package/ios/SafeAreaView/RNCSafeAreaProviderManager.m +0 -61
  216. package/ios/SafeAreaView/RNCSafeAreaView.m +0 -118
  217. package/ios/SafeAreaView/RNCSafeAreaViewEdges.h +0 -9
  218. package/ios/SafeAreaView/RNCSafeAreaViewEdges.m +0 -13
  219. package/ios/SafeAreaView/RNCSafeAreaViewMode.m +0 -11
  220. package/lib/commonjs/NativeSafeAreaProvider.macos.js +0 -9
  221. package/lib/commonjs/NativeSafeAreaProvider.macos.js.map +0 -1
  222. package/lib/commonjs/NativeSafeAreaProvider.native.js +0 -9
  223. package/lib/commonjs/NativeSafeAreaProvider.native.js.map +0 -1
  224. package/lib/commonjs/SafeAreaView.macos.js +0 -9
  225. package/lib/commonjs/SafeAreaView.macos.js.map +0 -1
  226. package/lib/commonjs/SafeAreaView.native.js +0 -9
  227. package/lib/commonjs/SafeAreaView.native.js.map +0 -1
  228. package/lib/commonjs/useWindowDimensions.js +0 -32
  229. package/lib/commonjs/useWindowDimensions.js.map +0 -1
  230. package/lib/module/NativeSafeAreaProvider.macos.js +0 -3
  231. package/lib/module/NativeSafeAreaProvider.macos.js.map +0 -1
  232. package/lib/module/NativeSafeAreaProvider.native.js +0 -3
  233. package/lib/module/NativeSafeAreaProvider.native.js.map +0 -1
  234. package/lib/module/SafeAreaView.macos.js +0 -3
  235. package/lib/module/SafeAreaView.macos.js.map +0 -1
  236. package/lib/module/SafeAreaView.native.js +0 -3
  237. package/lib/module/SafeAreaView.native.js.map +0 -1
  238. package/lib/module/useWindowDimensions.js +0 -26
  239. package/lib/module/useWindowDimensions.js.map +0 -1
  240. package/lib/typescript/src/CompatNativeSafeAreaProvider.d.ts +0 -2
  241. package/lib/typescript/src/NativeSafeAreaProvider.d.ts +0 -2
  242. package/lib/typescript/src/NativeSafeAreaProvider.kepler.d.ts +0 -2
  243. package/lib/typescript/src/NativeSafeAreaProvider.macos.d.ts +0 -2
  244. package/lib/typescript/src/NativeSafeAreaProvider.native.d.ts +0 -3
  245. package/lib/typescript/src/NativeSafeAreaProvider.windows.d.ts +0 -2
  246. package/lib/typescript/src/SafeArea.types.d.ts +0 -31
  247. package/lib/typescript/src/SafeAreaView.d.ts +0 -2
  248. package/lib/typescript/src/SafeAreaView.macos.d.ts +0 -2
  249. package/lib/typescript/src/SafeAreaView.native.d.ts +0 -2
  250. package/lib/typescript/src/SafeAreaView.windows.d.ts +0 -2
  251. package/lib/typescript/src/useWindowDimensions.d.ts +0 -8
  252. package/src/NativeSafeAreaProvider.macos.tsx +0 -3
  253. package/src/NativeSafeAreaProvider.native.tsx +0 -6
  254. package/src/SafeAreaView.macos.tsx +0 -3
  255. package/src/SafeAreaView.native.tsx +0 -6
  256. package/src/useWindowDimensions.tsx +0 -35
  257. /package/ios/{SafeAreaView/RNCSafeAreaProviderManager.h → RNCSafeAreaProviderManager.h} +0 -0
  258. /package/ios/{SafeAreaView/RNCSafeAreaShadowView.h → RNCSafeAreaShadowView.h} +0 -0
  259. /package/ios/{SafeAreaView/RNCSafeAreaViewManager.h → RNCSafeAreaViewManager.h} +0 -0
  260. /package/ios/{SafeAreaView/RNCSafeAreaViewMode.h → RNCSafeAreaViewMode.h} +0 -0
@@ -1,55 +0,0 @@
1
- node_modules/@amzn/react-native-safe-area-context_2/lib/commonjs/CompatNativeSafeAreaProvider.js:6a8dfeaa96268601e6db
2
- node_modules/@amzn/react-native-safe-area-context_2/lib/commonjs/useWindowDimensions.js:050a93a57120ea2ae235
3
- node_modules/@amzn/react-native-safe-area-context_2/lib/commonjs/InitialWindow.js:3d735c4db8e5524fe80b
4
- node_modules/@amzn/react-native-safe-area-context_2/lib/commonjs/InitialWindow.kepler.js:c6ff5832bae30b121f84
5
- node_modules/@amzn/react-native-safe-area-context_2/lib/commonjs/InitialWindow.native.js:f60cd45586cc78e6845e
6
- node_modules/@amzn/react-native-safe-area-context_2/lib/commonjs/NativeSafeAreaProvider.js:ca948c1b8082c807f683
7
- node_modules/@amzn/react-native-safe-area-context_2/lib/commonjs/NativeSafeAreaProvider.kepler.js:0acaeb639dd3e73ae9c2
8
- node_modules/@amzn/react-native-safe-area-context_2/lib/commonjs/NativeSafeAreaProvider.macos.js:5bab23071d1e3ae7c7cd
9
- node_modules/@amzn/react-native-safe-area-context_2/lib/commonjs/NativeSafeAreaProvider.native.js:b740c56627e5fcdb4a26
10
- node_modules/@amzn/react-native-safe-area-context_2/lib/commonjs/NativeSafeAreaProvider.windows.js:3a2a07aadbfadd23db2a
11
- node_modules/@amzn/react-native-safe-area-context_2/lib/commonjs/SafeArea.types.js:50f2d92ddb390cd56f93
12
- node_modules/@amzn/react-native-safe-area-context_2/lib/commonjs/SafeAreaContext.js:8fdbf0ef6df74864b35b
13
- node_modules/@amzn/react-native-safe-area-context_2/lib/commonjs/SafeAreaView.js:92384319d0ae7b00f641
14
- node_modules/@amzn/react-native-safe-area-context_2/lib/commonjs/SafeAreaView.kepler.js:027d8e122e635eeacedd
15
- node_modules/@amzn/react-native-safe-area-context_2/lib/commonjs/SafeAreaView.macos.js:c5a23185697a9129e56b
16
- node_modules/@amzn/react-native-safe-area-context_2/lib/commonjs/SafeAreaView.native.js:85aca3df322c33272e7c
17
- node_modules/@amzn/react-native-safe-area-context_2/lib/commonjs/SafeAreaView.windows.js:970ea3808091739eac6b
18
- node_modules/@amzn/react-native-safe-area-context_2/lib/commonjs/index.js:a5111432049fc9b7c767
19
- node_modules/@amzn/react-native-safe-area-context_2/lib/module/CompatNativeSafeAreaProvider.js:abeb31c8e77500cb5ff0
20
- node_modules/@amzn/react-native-safe-area-context_2/lib/module/useWindowDimensions.js:b7b04884eae45f8d1c96
21
- node_modules/@amzn/react-native-safe-area-context_2/lib/module/InitialWindow.js:6ed86ab51f4417381fec
22
- node_modules/@amzn/react-native-safe-area-context_2/lib/module/InitialWindow.kepler.js:3cce7f2afecd00d45c34
23
- node_modules/@amzn/react-native-safe-area-context_2/lib/module/InitialWindow.native.js:3f88b9ecc1bc54da2c1b
24
- node_modules/@amzn/react-native-safe-area-context_2/lib/module/NativeSafeAreaProvider.js:bccc6b7c1c3cff7b51e1
25
- node_modules/@amzn/react-native-safe-area-context_2/lib/module/NativeSafeAreaProvider.kepler.js:14149ed25fd76240344d
26
- node_modules/@amzn/react-native-safe-area-context_2/lib/module/NativeSafeAreaProvider.macos.js:0a3eba96a9b8541e91c5
27
- node_modules/@amzn/react-native-safe-area-context_2/lib/module/NativeSafeAreaProvider.native.js:626c4584d6df66dd8fa7
28
- node_modules/@amzn/react-native-safe-area-context_2/lib/module/NativeSafeAreaProvider.windows.js:454ddf4da2e76d85ab28
29
- node_modules/@amzn/react-native-safe-area-context_2/lib/module/SafeArea.types.js:c53ae55354938011c8a5
30
- node_modules/@amzn/react-native-safe-area-context_2/lib/module/SafeAreaContext.js:694cd3d44542ef0465a0
31
- node_modules/@amzn/react-native-safe-area-context_2/lib/module/SafeAreaView.js:db9aa9de8fa395be66a1
32
- node_modules/@amzn/react-native-safe-area-context_2/lib/module/SafeAreaView.kepler.js:484fe825c40d13ad7ad7
33
- node_modules/@amzn/react-native-safe-area-context_2/lib/module/SafeAreaView.macos.js:31ad6443e0f5d80cad05
34
- node_modules/@amzn/react-native-safe-area-context_2/lib/module/SafeAreaView.native.js:6fa73daf7b8770bbd436
35
- node_modules/@amzn/react-native-safe-area-context_2/lib/module/SafeAreaView.windows.js:d57a6aa92878f57ccd36
36
- node_modules/@amzn/react-native-safe-area-context_2/lib/module/index.js:1d4a16630a494f2d19e3
37
- node_modules/@amzn/react-native-safe-area-context_2/react-native.config.js:2952a5ff3f6b766bc3ab
38
- node_modules/@amzn/react-native-safe-area-context_2/src/CompatNativeSafeAreaProvider.tsx:65ac883a717222a0f5c4
39
- node_modules/@amzn/react-native-safe-area-context_2/src/useWindowDimensions.tsx:caf07738b11d49ea6d1a
40
- node_modules/@amzn/react-native-safe-area-context_2/src/InitialWindow.kepler.ts:1ecf014a66cb1b3ef50b
41
- node_modules/@amzn/react-native-safe-area-context_2/src/InitialWindow.native.ts:abb2116e7dd4f0ebaa9f
42
- node_modules/@amzn/react-native-safe-area-context_2/src/InitialWindow.ts:fd1a0fe99cc5792ee829
43
- node_modules/@amzn/react-native-safe-area-context_2/src/NativeSafeAreaProvider.kepler.tsx:798765eeec7bed483268
44
- node_modules/@amzn/react-native-safe-area-context_2/src/NativeSafeAreaProvider.macos.tsx:dcaea30da148242647c0
45
- node_modules/@amzn/react-native-safe-area-context_2/src/NativeSafeAreaProvider.native.tsx:2ee44153361f8331dc73
46
- node_modules/@amzn/react-native-safe-area-context_2/src/NativeSafeAreaProvider.tsx:0270a21f144614ce21d6
47
- node_modules/@amzn/react-native-safe-area-context_2/src/NativeSafeAreaProvider.windows.tsx:770911cba5e008b68b08
48
- node_modules/@amzn/react-native-safe-area-context_2/src/SafeArea.types.ts:d27cffc8ee2f1120641b
49
- node_modules/@amzn/react-native-safe-area-context_2/src/SafeAreaContext.tsx:0f78c2091666c5605ccc
50
- node_modules/@amzn/react-native-safe-area-context_2/src/SafeAreaView.kepler.tsx:6eefed130b7f963a8d6e
51
- node_modules/@amzn/react-native-safe-area-context_2/src/SafeAreaView.macos.tsx:d21694726f343cb49be4
52
- node_modules/@amzn/react-native-safe-area-context_2/src/SafeAreaView.native.tsx:948e730e4646ead70084
53
- node_modules/@amzn/react-native-safe-area-context_2/src/SafeAreaView.tsx:698d90c17c75cbfd6809
54
- node_modules/@amzn/react-native-safe-area-context_2/src/SafeAreaView.windows.tsx:8b39f4c0b93abaf4ef36
55
- node_modules/@amzn/react-native-safe-area-context_2/src/index.tsx:eda2a9e34f18e6e88b9e
@@ -1,91 +0,0 @@
1
- node_modules/@react-native/js-polyfills_0.72.1/console.js:c081be8f6c0109dd350f
2
- node_modules/@react-native/js-polyfills_0.72.1/error-guard.js:057b32c72f7f399723ba
3
- node_modules/@react-native/js-polyfills_0.72.1/Object.es8.js:a9bf7d37774d7198840b
4
- node_modules/@babel/runtime_7.26.0/helpers/interopRequireDefault.js:e13c8413f9a5de8e772f
5
- node_modules/@babel/runtime_7.26.0/helpers/toConsumableArray.js:c8d9faa50529497e8550
6
- node_modules/@babel/runtime_7.26.0/helpers/arrayWithoutHoles.js:fedf38594225d61ce364
7
- node_modules/@babel/runtime_7.26.0/helpers/arrayLikeToArray.js:790be5d6822a112c9007
8
- node_modules/@babel/runtime_7.26.0/helpers/iterableToArray.js:caf268f6252e2825d074
9
- node_modules/@babel/runtime_7.26.0/helpers/unsupportedIterableToArray.js:bb86eb755213422b1850
10
- node_modules/@babel/runtime_7.26.0/helpers/nonIterableSpread.js:e82afc4c0fee49992755
11
- node_modules/@babel/runtime_7.26.0/helpers/classCallCheck.js:7ba3d97b9a1c7b5d2869
12
- node_modules/@babel/runtime_7.26.0/helpers/createClass.js:51a05661f80df8a7ec74
13
- node_modules/@babel/runtime_7.26.0/helpers/toPropertyKey.js:83653ba9ba6a6acbaf3f
14
- node_modules/@babel/runtime_7.26.0/helpers/toPrimitive.js:44d8868b36ed13d4848c
15
- node_modules/@babel/runtime_7.26.0/helpers/typeof.js:9beefbd2b38f15e68c8e
16
- node_modules/invariant_2.2.4/browser.js:fd099686726b2dfb6f66
17
- node_modules/@babel/runtime_7.26.0/helpers/slicedToArray.js:483ae341f8ec81c793b7
18
- node_modules/@babel/runtime_7.26.0/helpers/arrayWithHoles.js:783a1c105475cee3e6c5
19
- node_modules/@babel/runtime_7.26.0/helpers/iterableToArrayLimit.js:848b0a42822f8876517a
20
- node_modules/@babel/runtime_7.26.0/helpers/nonIterableRest.js:7df430fde83911c4a777
21
- node_modules/nullthrows_1.1.1/nullthrows.js:afd4874b36ccd4e13961
22
- node_modules/@babel/runtime_7.26.0/helpers/possibleConstructorReturn.js:1a2fe3e5fa067fc0a581
23
- node_modules/@babel/runtime_7.26.0/helpers/assertThisInitialized.js:8fb490053e9935245ab2
24
- node_modules/@babel/runtime_7.26.0/helpers/getPrototypeOf.js:9f001f493a532727260d
25
- node_modules/@babel/runtime_7.26.0/helpers/inherits.js:106616352dc94f6a631a
26
- node_modules/@babel/runtime_7.26.0/helpers/setPrototypeOf.js:b3795059b892586ade34
27
- node_modules/@babel/runtime_7.26.0/helpers/readOnlyError.js:1ce02919a2278f04e7f0
28
- node_modules/@babel/runtime_7.26.0/helpers/wrapNativeSuper.js:eb04c83a2c7f1c2f7a42
29
- node_modules/@babel/runtime_7.26.0/helpers/isNativeFunction.js:3ce4e050494cfa1d5417
30
- node_modules/@babel/runtime_7.26.0/helpers/construct.js:bc6843521062ed051490
31
- node_modules/@babel/runtime_7.26.0/helpers/isNativeReflectConstruct.js:8962e626888f4268c6fc
32
- node_modules/stacktrace-parser_0.1.10/dist/stack-trace-parser.cjs.js:189d72d0eb41570f5e74
33
- node_modules/promise_8.3.0/setimmediate/finally.js:15bc4ccb25fc2d0c4428
34
- node_modules/promise_8.3.0/setimmediate/core.js:890f60fa94d3f6854a19
35
- node_modules/promise_8.3.0/setimmediate/es6-extensions.js:a7846fdeffeb1ebf6241
36
- node_modules/regenerator-runtime_0.13.11/runtime.js:af823d9710c534173a4d
37
- node_modules/@babel/runtime_7.26.0/helpers/get.js:4b1a4e373780ac89a3a3
38
- node_modules/@babel/runtime_7.26.0/helpers/superPropBase.js:b7261b01f9f721400840
39
- node_modules/event-target-shim_5.0.1/dist/event-target-shim.js:2bd3f165b1ed6b916de7
40
- node_modules/base64-js_1.5.1/index.js:71af70f51435e3e1b37b
41
- node_modules/whatwg-fetch_3.6.20/dist/fetch.umd.js:ca4b0363146267ef3e77
42
- node_modules/@babel/runtime_7.26.0/helpers/objectWithoutProperties.js:288fc9023aadbf916360
43
- node_modules/@babel/runtime_7.26.0/helpers/objectWithoutPropertiesLoose.js:227b8be7a5ddac0008f4
44
- node_modules/abort-controller_3.0.0/dist/abort-controller.js:ea8fcbd647aab1cfcdaa
45
- node_modules/@react-native/normalize-colors_0.72.0/index.js:bab9017c6ff43bb4a95b
46
- node_modules/@babel/runtime_7.26.0/helpers/defineProperty.js:f08cf7e9c32002e6bb9e
47
- node_modules/@react-native/assets-registry_0.72.0/registry.js:05d58bec2a6d939f08d8
48
- node_modules/@react-native/assets-registry_0.72.0/path-support.js:914260cfb55fe13c431c
49
- node_modules/scheduler_0.24.0-canary-efb381bbf-20230505/index.native.js:d57407eff7026d491c8a
50
- node_modules/scheduler_0.24.0-canary-efb381bbf-20230505/cjs/scheduler.native.production.min.js:9daefd1335ff675770cb
51
- node_modules/deprecated-react-native-prop-types_4.1.0/index.js:4b5aec8d0b1af0b13fc9
52
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedColorPropType.js:0ff2848f3ff6f1a02356
53
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedEdgeInsetsPropType.js:e113bc2a6b8133e753f1
54
- node_modules/prop-types_15.8.1/index.js:385f56cce85bf58dda18
55
- node_modules/prop-types_15.8.1/factoryWithThrowingShims.js:211f6d600f40629e26d0
56
- node_modules/prop-types_15.8.1/lib/ReactPropTypesSecret.js:3ac224506c12c2b4339c
57
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedImagePropType.js:9f1779357aba412bb49f
58
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedViewPropTypes.js:6a37ec0494ff683c49f2
59
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedViewAccessibility.js:dc269c006cd52aa8a392
60
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedStyleSheetPropType.js:ecd8893ff4b33ee73955
61
- node_modules/deprecated-react-native-prop-types_4.1.0/deprecatedCreateStrictShapeTypeChecker.js:2c266ae4211321471d0d
62
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedViewStylePropTypes.js:b0bd5168a69d8a903511
63
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedLayoutPropTypes.js:fdc284a1196df7b8b1c7
64
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedShadowPropTypesIOS.js:c694fefe532e4748da9d
65
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedTransformPropTypes.js:1dd7395967b3c81dc0f2
66
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedImageSourcePropType.js:00fed86b64880bf848bf
67
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedImageStylePropTypes.js:0b77c2d463c8dbef3508
68
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedPointPropType.js:792d53fa12840d39c921
69
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedTextInputPropTypes.js:a287f54379336e9f732c
70
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedTextPropTypes.js:14b8482f38362fa2f8cd
71
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedTextStylePropTypes.js:41bd16fe8e2d1af40264
72
- node_modules/memoize-one_5.2.1/dist/memoize-one.cjs.js:d381691ed29bec5a2050
73
- node_modules/@react-native/virtualized-lists_0.72.8/index.js:27b237d1799650306cb9
74
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/VirtualizeUtils.js:a26dbe2a3afa21c3cf22
75
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/VirtualizedList.js:c4b46015e44050527820
76
- node_modules/@react-native/virtualized-lists_0.72.8/Interaction/Batchinator.js:1953ac0cbf7ac32b33d6
77
- node_modules/@react-native/virtualized-lists_0.72.8/Utilities/clamp.js:a30729068ebd0dea58f8
78
- node_modules/@react-native/virtualized-lists_0.72.8/Utilities/infoLog.js:4fd7218f700134f011e9
79
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/ChildListCollection.js:718d6cdfb3fb081a232d
80
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/FillRateHelper.js:3e01a5bc929e85870fe5
81
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/StateSafePureComponent.js:04ffc79d4da370644bce
82
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/ViewabilityHelper.js:8bafab90a37cab64b100
83
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/VirtualizedListCellRenderer.js:ce5f423367f40f3628a8
84
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/VirtualizedListContext.js:e6b1ef1f5b720d640981
85
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/CellRenderMask.js:de5ab026f9499640d730
86
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/VirtualizedSectionList.js:d2355175ff6609a3def1
87
- node_modules/@babel/runtime_7.26.0/helpers/asyncToGenerator.js:ea48108a6867e7ab71ad
88
- node_modules/use-sync-external-store_1.2.2/shim/index.native.js:f1b3855a69d8eff82434
89
- node_modules/use-sync-external-store_1.2.2/cjs/use-sync-external-store-shim.native.production.min.js:5d8c3034f885ee036c2b
90
- node_modules/@babel/runtime_7.26.0/helpers/classPrivateFieldLooseKey.js:7f66c94a6a95aa0d133b
91
- node_modules/@babel/runtime_7.26.0/helpers/classPrivateFieldLooseBase.js:ad166880e439eedd808a
@@ -1,24 +0,0 @@
1
- License from LICENSE:
2
- ========================================
3
-
4
- MIT License
5
-
6
- Copyright (c) 2019 Th3rd Wave
7
-
8
- Permission is hereby granted, free of charge, to any person obtaining a copy
9
- of this software and associated documentation files (the "Software"), to deal
10
- in the Software without restriction, including without limitation the rights
11
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- copies of the Software, and to permit persons to whom the Software is
13
- furnished to do so, subject to the following conditions:
14
-
15
- The above copyright notice and this permission notice shall be included in all
16
- copies or substantial portions of the Software.
17
-
18
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
- SOFTWARE.
@@ -1,22 +0,0 @@
1
- package com.th3rdwave.safeareacontext;
2
-
3
- /* package */ class EdgeInsets {
4
- float top;
5
- float right;
6
- float bottom;
7
- float left;
8
-
9
- EdgeInsets(float top, float right, float bottom, float left) {
10
- this.top = top;
11
- this.right = right;
12
- this.bottom = bottom;
13
- this.left = left;
14
- }
15
-
16
- boolean equalsToEdgeInsets(EdgeInsets other) {
17
- if (this == other) {
18
- return true;
19
- }
20
- return this.top == other.top && this.right == other.right && this.bottom == other.bottom && this.left == other.left;
21
- }
22
- }
@@ -1,33 +0,0 @@
1
- package com.th3rdwave.safeareacontext;
2
-
3
- import com.facebook.react.bridge.Arguments;
4
- import com.facebook.react.bridge.WritableMap;
5
- import com.facebook.react.uimanager.events.Event;
6
- import com.facebook.react.uimanager.events.RCTEventEmitter;
7
-
8
- /* package */ class InsetsChangeEvent extends Event<InsetsChangeEvent> {
9
- static final String EVENT_NAME = "topInsetsChange";
10
-
11
- private EdgeInsets mInsets;
12
- private Rect mFrame;
13
-
14
- InsetsChangeEvent(int viewTag, EdgeInsets insets, Rect frame) {
15
- super(viewTag);
16
-
17
- mInsets = insets;
18
- mFrame = frame;
19
- }
20
-
21
- @Override
22
- public String getEventName() {
23
- return EVENT_NAME;
24
- }
25
-
26
- @Override
27
- public void dispatch(RCTEventEmitter rctEventEmitter) {
28
- WritableMap event = Arguments.createMap();
29
- event.putMap("insets", SerializationUtils.edgeInsetsToJsMap(mInsets));
30
- event.putMap("frame", SerializationUtils.rectToJsMap(mFrame));
31
- rctEventEmitter.receiveEvent(getViewTag(), getEventName(), event);
32
- }
33
- }
@@ -1,22 +0,0 @@
1
- package com.th3rdwave.safeareacontext;
2
-
3
- /* package */ class Rect {
4
- float x;
5
- float y;
6
- float width;
7
- float height;
8
-
9
- Rect(float x, float y, float width, float height) {
10
- this.x = x;
11
- this.y = y;
12
- this.width = width;
13
- this.height = height;
14
- }
15
-
16
- boolean equalsToRect(Rect other) {
17
- if (this == other) {
18
- return true;
19
- }
20
- return this.x == other.x && this.y == other.y && this.width == other.width && this.height == other.height;
21
- }
22
- }
@@ -1,31 +0,0 @@
1
- package com.th3rdwave.safeareacontext;
2
-
3
- import androidx.annotation.NonNull;
4
-
5
- import com.facebook.react.ReactPackage;
6
- import com.facebook.react.bridge.NativeModule;
7
- import com.facebook.react.bridge.ReactApplicationContext;
8
- import com.facebook.react.uimanager.ViewManager;
9
-
10
- import java.util.Arrays;
11
- import java.util.Collections;
12
- import java.util.List;
13
-
14
- public class SafeAreaContextPackage implements ReactPackage {
15
-
16
- @NonNull
17
- @Override
18
- public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
19
- return Collections.emptyList();
20
- }
21
-
22
- @NonNull
23
- @Override
24
- public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
25
- return Arrays.<ViewManager>asList(
26
- new SafeAreaProviderManager(reactContext),
27
- new SafeAreaViewManager()
28
- );
29
- }
30
-
31
- }
@@ -1,66 +0,0 @@
1
- package com.th3rdwave.safeareacontext;
2
-
3
- import android.annotation.SuppressLint;
4
- import android.content.Context;
5
- import android.view.ViewGroup;
6
- import android.view.ViewTreeObserver;
7
-
8
- import com.facebook.infer.annotation.Assertions;
9
- import com.facebook.react.views.view.ReactViewGroup;
10
-
11
- import androidx.annotation.Nullable;
12
-
13
- @SuppressLint("ViewConstructor")
14
- public class SafeAreaProvider extends ReactViewGroup implements ViewTreeObserver.OnPreDrawListener {
15
- public interface OnInsetsChangeListener {
16
- void onInsetsChange(SafeAreaProvider view, EdgeInsets insets, Rect frame);
17
- }
18
-
19
- private @Nullable OnInsetsChangeListener mInsetsChangeListener;
20
- private @Nullable EdgeInsets mLastInsets;
21
- private @Nullable Rect mLastFrame;
22
-
23
- public SafeAreaProvider(Context context) {
24
- super(context);
25
- }
26
-
27
- private void maybeUpdateInsets() {
28
- EdgeInsets edgeInsets = SafeAreaUtils.getSafeAreaInsets(this);
29
- Rect frame = SafeAreaUtils.getFrame((ViewGroup) getRootView(), this);
30
- if (edgeInsets != null && frame != null &&
31
- (mLastInsets == null ||
32
- mLastFrame == null ||
33
- !mLastInsets.equalsToEdgeInsets(edgeInsets) ||
34
- !mLastFrame.equalsToRect(frame))) {
35
- Assertions.assertNotNull(mInsetsChangeListener).onInsetsChange(this, edgeInsets, frame);
36
- mLastInsets = edgeInsets;
37
- mLastFrame = frame;
38
- }
39
- }
40
-
41
- @Override
42
- protected void onAttachedToWindow() {
43
- super.onAttachedToWindow();
44
-
45
- getViewTreeObserver().addOnPreDrawListener(this);
46
- maybeUpdateInsets();
47
- }
48
-
49
- @Override
50
- protected void onDetachedFromWindow() {
51
- super.onDetachedFromWindow();
52
-
53
- getViewTreeObserver().removeOnPreDrawListener(this);
54
- }
55
-
56
- @Override
57
- public boolean onPreDraw() {
58
- maybeUpdateInsets();
59
- return true;
60
- }
61
-
62
-
63
- public void setOnInsetsChangeListener(OnInsetsChangeListener listener) {
64
- mInsetsChangeListener = listener;
65
- }
66
- }
@@ -1,94 +0,0 @@
1
- package com.th3rdwave.safeareacontext;
2
-
3
- import android.app.Activity;
4
- import android.view.View;
5
- import android.view.ViewGroup;
6
-
7
- import com.facebook.react.bridge.ReactApplicationContext;
8
- import com.facebook.react.common.MapBuilder;
9
- import com.facebook.react.uimanager.ThemedReactContext;
10
- import com.facebook.react.uimanager.UIManagerModule;
11
- import com.facebook.react.uimanager.ViewGroupManager;
12
- import com.facebook.react.uimanager.events.EventDispatcher;
13
-
14
- import java.util.Map;
15
-
16
- import androidx.annotation.NonNull;
17
- import androidx.annotation.Nullable;
18
-
19
- public class SafeAreaProviderManager extends ViewGroupManager<SafeAreaProvider> {
20
- private final ReactApplicationContext mContext;
21
-
22
- public SafeAreaProviderManager(ReactApplicationContext context) {
23
- super();
24
-
25
- mContext = context;
26
- }
27
-
28
- @Override
29
- @NonNull
30
- public String getName() {
31
- return "RNCSafeAreaProvider";
32
- }
33
-
34
- @Override
35
- @NonNull
36
- public SafeAreaProvider createViewInstance(@NonNull ThemedReactContext context) {
37
- return new SafeAreaProvider(context);
38
- }
39
-
40
- @Override
41
- protected void addEventEmitters(@NonNull ThemedReactContext reactContext, @NonNull final SafeAreaProvider view) {
42
- final EventDispatcher dispatcher =
43
- reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();
44
- view.setOnInsetsChangeListener(new SafeAreaProvider.OnInsetsChangeListener() {
45
- @Override
46
- public void onInsetsChange(SafeAreaProvider view, EdgeInsets insets, Rect frame) {
47
- dispatcher.dispatchEvent(new InsetsChangeEvent(view.getId(), insets, frame));
48
- }
49
- });
50
- }
51
-
52
- @Override
53
- public Map<String, Object> getExportedCustomDirectEventTypeConstants() {
54
- return MapBuilder.<String, Object>builder()
55
- .put(InsetsChangeEvent.EVENT_NAME, MapBuilder.of("registrationName", "onInsetsChange"))
56
- .build();
57
- }
58
-
59
- private @Nullable Map<String, Object> getInitialWindowMetrics() {
60
- Activity activity = mContext.getCurrentActivity();
61
- if (activity == null) {
62
- return null;
63
- }
64
-
65
- ViewGroup decorView = (ViewGroup) activity.getWindow().getDecorView();
66
- if (decorView == null) {
67
- return null;
68
- }
69
-
70
- View contentView = decorView.findViewById(android.R.id.content);
71
- if (contentView == null) {
72
- return null;
73
- }
74
- EdgeInsets insets = SafeAreaUtils.getSafeAreaInsets(decorView);
75
- Rect frame = SafeAreaUtils.getFrame(decorView, contentView);
76
- if (insets == null || frame == null) {
77
- return null;
78
- }
79
- return MapBuilder.<String, Object>of(
80
- "insets",
81
- SerializationUtils.edgeInsetsToJavaMap(insets),
82
- "frame",
83
- SerializationUtils.rectToJavaMap(frame));
84
- }
85
-
86
- @Nullable
87
- @Override
88
- public Map<String, Object> getExportedViewConstants() {
89
- return MapBuilder.<String, Object>of(
90
- "initialWindowMetrics",
91
- getInitialWindowMetrics());
92
-
93
- }
94
- }
@@ -1,82 +0,0 @@
1
- package com.th3rdwave.safeareacontext;
2
-
3
- import android.graphics.Rect;
4
- import android.os.Build;
5
- import android.view.View;
6
- import android.view.ViewGroup;
7
- import android.view.WindowInsets;
8
-
9
- import androidx.annotation.Nullable;
10
-
11
- /* package */ class SafeAreaUtils {
12
-
13
- private static @Nullable EdgeInsets getRootWindowInsetsCompat(View rootView) {
14
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
15
- WindowInsets insets = rootView.getRootWindowInsets();
16
- if (insets == null) {
17
- return null;
18
- }
19
- return new EdgeInsets(
20
- insets.getSystemWindowInsetTop(),
21
- insets.getSystemWindowInsetRight(),
22
- // System insets are more reliable to account for notches but the
23
- // system inset for bottom includes the soft keyboard which we don't
24
- // want to be consistent with iOS. Using the min value makes sure we
25
- // never get the keyboard offset while still working with devices that
26
- // hide the navigation bar.
27
- Math.min(insets.getSystemWindowInsetBottom(), insets.getStableInsetBottom()),
28
- insets.getSystemWindowInsetLeft());
29
- } else {
30
- Rect visibleRect = new Rect();
31
- rootView.getWindowVisibleDisplayFrame(visibleRect);
32
- return new EdgeInsets(
33
- visibleRect.top,
34
- rootView.getWidth() - visibleRect.right,
35
- rootView.getHeight() - visibleRect.bottom,
36
- visibleRect.left);
37
- }
38
- }
39
-
40
- static @Nullable EdgeInsets getSafeAreaInsets(View view) {
41
- // The view has not been layout yet.
42
- if (view.getHeight() == 0) {
43
- return null;
44
- }
45
- View rootView = view.getRootView();
46
- EdgeInsets windowInsets = getRootWindowInsetsCompat(rootView);
47
- if (windowInsets == null) {
48
- return null;
49
- }
50
-
51
- // Calculate the part of the view that overlaps with window insets.
52
- float windowWidth = rootView.getWidth();
53
- float windowHeight = rootView.getHeight();
54
- Rect visibleRect = new Rect();
55
- view.getGlobalVisibleRect(visibleRect);
56
-
57
- windowInsets.top = Math.max(windowInsets.top - visibleRect.top, 0);
58
- windowInsets.left = Math.max(windowInsets.left - visibleRect.left, 0);
59
- windowInsets.bottom = Math.max(Math.min(visibleRect.top + view.getHeight() - windowHeight, 0) + windowInsets.bottom, 0);
60
- windowInsets.right = Math.max(Math.min(visibleRect.left + view.getWidth() - windowWidth, 0) + windowInsets.right, 0);
61
- return windowInsets;
62
- }
63
-
64
- static @Nullable com.th3rdwave.safeareacontext.Rect getFrame(ViewGroup rootView, View view) {
65
- // This can happen while the view gets unmounted.
66
- if (view.getParent() == null) {
67
- return null;
68
- }
69
- Rect offset = new Rect();
70
- view.getDrawingRect(offset);
71
- try {
72
- rootView.offsetDescendantRectToMyCoords(view, offset);
73
- } catch (IllegalArgumentException ex) {
74
- // This can throw if the view is not a descendant of rootView. This should not
75
- // happen but avoid potential crashes.
76
- ex.printStackTrace();
77
- return null;
78
- }
79
-
80
- return new com.th3rdwave.safeareacontext.Rect(offset.left, offset.top, view.getWidth(), view.getHeight());
81
- }
82
- }