@amazon-devices/react-native-safe-area-context 2.0.9000000000 → 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 (259) hide show
  1. package/README.md +6 -302
  2. package/SystemBundles/{85c8d24b7f717b77a2deb00e32cc2aaa293a5a16c46eecebca21e95bda425730.bundle → 920f0b3a0c43cc93db1621b4c3a47e06a0d4ed32175c793e9934ad9c764fbc25.bundle} +6447 -9418
  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 +6 -6
  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 -124
  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 +55 -34
  83. package/lib/commonjs/SafeAreaContext.js.map +1 -1
  84. package/lib/commonjs/SafeAreaView.js +39 -71
  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/85c8d24b7f717b77a2deb00e32cc2aaa293a5a16c46eecebca21e95bda425730.map +0 -4335
  194. package/SystemModules/amzn__react-native-safe-area-context-2.modules.txt +0 -55
  195. package/SystemModules/amzn__react-native-safe-area-context-2.private.modules.txt +0 -90
  196. package/THIRD_PARTY_NOTICES.txt +0 -24
  197. package/android/src/main/java/com/th3rdwave/safeareacontext/EdgeInsets.java +0 -22
  198. package/android/src/main/java/com/th3rdwave/safeareacontext/InsetsChangeEvent.java +0 -33
  199. package/android/src/main/java/com/th3rdwave/safeareacontext/Rect.java +0 -22
  200. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaContextPackage.java +0 -31
  201. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaProvider.java +0 -66
  202. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaProviderManager.java +0 -94
  203. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaUtils.java +0 -82
  204. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaView.java +0 -159
  205. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaViewEdges.java +0 -8
  206. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaViewLocalData.java +0 -27
  207. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaViewManager.java +0 -72
  208. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaViewMode.java +0 -6
  209. package/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaViewShadowNode.java +0 -201
  210. package/android/src/main/java/com/th3rdwave/safeareacontext/SerializationUtils.java +0 -52
  211. package/ios/SafeAreaView/RCTView+SafeAreaCompat.h +0 -16
  212. package/ios/SafeAreaView/RCTView+SafeAreaCompat.m +0 -57
  213. package/ios/SafeAreaView/RNCSafeAreaProvider.m +0 -65
  214. package/ios/SafeAreaView/RNCSafeAreaProviderManager.m +0 -61
  215. package/ios/SafeAreaView/RNCSafeAreaView.m +0 -118
  216. package/ios/SafeAreaView/RNCSafeAreaViewEdges.h +0 -9
  217. package/ios/SafeAreaView/RNCSafeAreaViewEdges.m +0 -13
  218. package/ios/SafeAreaView/RNCSafeAreaViewMode.m +0 -11
  219. package/lib/commonjs/NativeSafeAreaProvider.macos.js +0 -9
  220. package/lib/commonjs/NativeSafeAreaProvider.macos.js.map +0 -1
  221. package/lib/commonjs/NativeSafeAreaProvider.native.js +0 -9
  222. package/lib/commonjs/NativeSafeAreaProvider.native.js.map +0 -1
  223. package/lib/commonjs/SafeAreaView.macos.js +0 -9
  224. package/lib/commonjs/SafeAreaView.macos.js.map +0 -1
  225. package/lib/commonjs/SafeAreaView.native.js +0 -9
  226. package/lib/commonjs/SafeAreaView.native.js.map +0 -1
  227. package/lib/commonjs/useWindowDimensions.js +0 -32
  228. package/lib/commonjs/useWindowDimensions.js.map +0 -1
  229. package/lib/module/NativeSafeAreaProvider.macos.js +0 -3
  230. package/lib/module/NativeSafeAreaProvider.macos.js.map +0 -1
  231. package/lib/module/NativeSafeAreaProvider.native.js +0 -3
  232. package/lib/module/NativeSafeAreaProvider.native.js.map +0 -1
  233. package/lib/module/SafeAreaView.macos.js +0 -3
  234. package/lib/module/SafeAreaView.macos.js.map +0 -1
  235. package/lib/module/SafeAreaView.native.js +0 -3
  236. package/lib/module/SafeAreaView.native.js.map +0 -1
  237. package/lib/module/useWindowDimensions.js +0 -26
  238. package/lib/module/useWindowDimensions.js.map +0 -1
  239. package/lib/typescript/src/CompatNativeSafeAreaProvider.d.ts +0 -2
  240. package/lib/typescript/src/NativeSafeAreaProvider.d.ts +0 -2
  241. package/lib/typescript/src/NativeSafeAreaProvider.kepler.d.ts +0 -2
  242. package/lib/typescript/src/NativeSafeAreaProvider.macos.d.ts +0 -2
  243. package/lib/typescript/src/NativeSafeAreaProvider.native.d.ts +0 -3
  244. package/lib/typescript/src/NativeSafeAreaProvider.windows.d.ts +0 -2
  245. package/lib/typescript/src/SafeArea.types.d.ts +0 -31
  246. package/lib/typescript/src/SafeAreaView.d.ts +0 -2
  247. package/lib/typescript/src/SafeAreaView.macos.d.ts +0 -2
  248. package/lib/typescript/src/SafeAreaView.native.d.ts +0 -2
  249. package/lib/typescript/src/SafeAreaView.windows.d.ts +0 -2
  250. package/lib/typescript/src/useWindowDimensions.d.ts +0 -8
  251. package/src/NativeSafeAreaProvider.macos.tsx +0 -3
  252. package/src/NativeSafeAreaProvider.native.tsx +0 -6
  253. package/src/SafeAreaView.macos.tsx +0 -3
  254. package/src/SafeAreaView.native.tsx +0 -6
  255. package/src/useWindowDimensions.tsx +0 -35
  256. /package/ios/{SafeAreaView/RNCSafeAreaProviderManager.h → RNCSafeAreaProviderManager.h} +0 -0
  257. /package/ios/{SafeAreaView/RNCSafeAreaShadowView.h → RNCSafeAreaShadowView.h} +0 -0
  258. /package/ios/{SafeAreaView/RNCSafeAreaViewManager.h → RNCSafeAreaViewManager.h} +0 -0
  259. /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,90 +0,0 @@
1
- node_modules/@react-native/js-polyfills_0.83.0/console.js:2d15cb9b42170067dfb8
2
- node_modules/@react-native/js-polyfills_0.83.0/error-guard.js:f1e83584808fa19b4c7a
3
- node_modules/@babel/runtime_7.28.4/helpers/interopRequireDefault.js:277a84013d7e1a1ace05
4
- node_modules/@babel/runtime_7.28.4/helpers/toConsumableArray.js:838d7a057beeb5db50df
5
- node_modules/@babel/runtime_7.28.4/helpers/arrayWithoutHoles.js:a425fd4fe3cf47759e99
6
- node_modules/@babel/runtime_7.28.4/helpers/arrayLikeToArray.js:378be3062418cfac9327
7
- node_modules/@babel/runtime_7.28.4/helpers/iterableToArray.js:67d028b72bb61755baea
8
- node_modules/@babel/runtime_7.28.4/helpers/unsupportedIterableToArray.js:e7044bb724c5bd68e2cc
9
- node_modules/@babel/runtime_7.28.4/helpers/nonIterableSpread.js:b4810fa44dd496b7d9f5
10
- node_modules/@babel/runtime_7.28.4/helpers/classCallCheck.js:cb664999166f9660a878
11
- node_modules/@babel/runtime_7.28.4/helpers/createClass.js:68819e29ebee24bb0e88
12
- node_modules/@babel/runtime_7.28.4/helpers/toPropertyKey.js:cbba112244d360ffda7a
13
- node_modules/@babel/runtime_7.28.4/helpers/toPrimitive.js:ad82d340d0b5dc5f0801
14
- node_modules/@babel/runtime_7.28.4/helpers/typeof.js:e08c69ed06cf526909e3
15
- node_modules/invariant_2.2.4/browser.js:fd099686726b2dfb6f66
16
- node_modules/@babel/runtime_7.28.4/helpers/slicedToArray.js:d73b3a84588342abd1b6
17
- node_modules/@babel/runtime_7.28.4/helpers/arrayWithHoles.js:c18fba4833d885627fc3
18
- node_modules/@babel/runtime_7.28.4/helpers/iterableToArrayLimit.js:db861c9134e305a92464
19
- node_modules/@babel/runtime_7.28.4/helpers/nonIterableRest.js:d2c95b166a5bd41ca703
20
- node_modules/nullthrows_1.1.1/nullthrows.js:afd4874b36ccd4e13961
21
- node_modules/@babel/runtime_7.28.4/helpers/possibleConstructorReturn.js:aab42168bb4cb23540ec
22
- node_modules/@babel/runtime_7.28.4/helpers/assertThisInitialized.js:0716ce96f45f287fb302
23
- node_modules/@babel/runtime_7.28.4/helpers/getPrototypeOf.js:ba9efe5c53f1d07f5c9d
24
- node_modules/@babel/runtime_7.28.4/helpers/inherits.js:9822a58ca7726d551fe0
25
- node_modules/@babel/runtime_7.28.4/helpers/setPrototypeOf.js:79c731bcf4b10abe8e4d
26
- node_modules/@babel/runtime_7.28.4/helpers/readOnlyError.js:9a3a31f49f0e1fee57b0
27
- node_modules/@babel/runtime_7.28.4/helpers/wrapNativeSuper.js:66be7ef871ad04671969
28
- node_modules/@babel/runtime_7.28.4/helpers/isNativeFunction.js:9cf198b81404c8b483b0
29
- node_modules/@babel/runtime_7.28.4/helpers/construct.js:20524c8783215c6329fe
30
- node_modules/@babel/runtime_7.28.4/helpers/isNativeReflectConstruct.js:df21df9938c0adbd59f1
31
- node_modules/stacktrace-parser_0.1.11/dist/stack-trace-parser.cjs.js:aa725aa4c0b37e1add33
32
- node_modules/promise_8.3.0/setimmediate/finally.js:15bc4ccb25fc2d0c4428
33
- node_modules/promise_8.3.0/setimmediate/core.js:890f60fa94d3f6854a19
34
- node_modules/promise_8.3.0/setimmediate/es6-extensions.js:a7846fdeffeb1ebf6241
35
- node_modules/regenerator-runtime_0.13.11/runtime.js:af823d9710c534173a4d
36
- node_modules/@babel/runtime_7.28.4/helpers/get.js:55062adb34159de0ea92
37
- node_modules/@babel/runtime_7.28.4/helpers/superPropBase.js:d53f05ad44723a08f608
38
- node_modules/event-target-shim_5.0.1/dist/event-target-shim.js:2bd3f165b1ed6b916de7
39
- node_modules/base64-js_1.5.1/index.js:71af70f51435e3e1b37b
40
- node_modules/whatwg-fetch_3.6.20/dist/fetch.umd.js:ca4b0363146267ef3e77
41
- node_modules/@babel/runtime_7.28.4/helpers/objectWithoutProperties.js:a2c8e692f78bae5b8b98
42
- node_modules/@babel/runtime_7.28.4/helpers/objectWithoutPropertiesLoose.js:5927789db7c756c318ed
43
- node_modules/abort-controller_3.0.0/dist/abort-controller.js:ea8fcbd647aab1cfcdaa
44
- node_modules/@react-native/normalize-colors_0.72.0/index.js:bab9017c6ff43bb4a95b
45
- node_modules/@babel/runtime_7.28.4/helpers/defineProperty.js:4926d0dbc109dc5bb6c9
46
- node_modules/@react-native/assets-registry_0.72.0/registry.js:05d58bec2a6d939f08d8
47
- node_modules/@react-native/assets-registry_0.72.0/path-support.js:914260cfb55fe13c431c
48
- node_modules/scheduler_0.24.0-canary-efb381bbf-20230505/index.native.js:d57407eff7026d491c8a
49
- node_modules/scheduler_0.24.0-canary-efb381bbf-20230505/cjs/scheduler.native.production.min.js:9daefd1335ff675770cb
50
- node_modules/deprecated-react-native-prop-types_4.1.0/index.js:4b5aec8d0b1af0b13fc9
51
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedColorPropType.js:0ff2848f3ff6f1a02356
52
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedEdgeInsetsPropType.js:e113bc2a6b8133e753f1
53
- node_modules/prop-types_15.8.1/index.js:385f56cce85bf58dda18
54
- node_modules/prop-types_15.8.1/factoryWithThrowingShims.js:211f6d600f40629e26d0
55
- node_modules/prop-types_15.8.1/lib/ReactPropTypesSecret.js:3ac224506c12c2b4339c
56
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedImagePropType.js:9f1779357aba412bb49f
57
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedViewPropTypes.js:6a37ec0494ff683c49f2
58
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedViewAccessibility.js:dc269c006cd52aa8a392
59
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedStyleSheetPropType.js:ecd8893ff4b33ee73955
60
- node_modules/deprecated-react-native-prop-types_4.1.0/deprecatedCreateStrictShapeTypeChecker.js:2c266ae4211321471d0d
61
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedViewStylePropTypes.js:b0bd5168a69d8a903511
62
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedLayoutPropTypes.js:fdc284a1196df7b8b1c7
63
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedShadowPropTypesIOS.js:c694fefe532e4748da9d
64
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedTransformPropTypes.js:1dd7395967b3c81dc0f2
65
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedImageSourcePropType.js:00fed86b64880bf848bf
66
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedImageStylePropTypes.js:0b77c2d463c8dbef3508
67
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedPointPropType.js:792d53fa12840d39c921
68
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedTextInputPropTypes.js:a287f54379336e9f732c
69
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedTextPropTypes.js:14b8482f38362fa2f8cd
70
- node_modules/deprecated-react-native-prop-types_4.1.0/DeprecatedTextStylePropTypes.js:41bd16fe8e2d1af40264
71
- node_modules/memoize-one_5.2.1/dist/memoize-one.cjs.js:d381691ed29bec5a2050
72
- node_modules/@react-native/virtualized-lists_0.72.8/index.js:27b237d1799650306cb9
73
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/VirtualizeUtils.js:a26dbe2a3afa21c3cf22
74
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/VirtualizedList.js:c4b46015e44050527820
75
- node_modules/@react-native/virtualized-lists_0.72.8/Interaction/Batchinator.js:1953ac0cbf7ac32b33d6
76
- node_modules/@react-native/virtualized-lists_0.72.8/Utilities/clamp.js:a30729068ebd0dea58f8
77
- node_modules/@react-native/virtualized-lists_0.72.8/Utilities/infoLog.js:4fd7218f700134f011e9
78
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/ChildListCollection.js:718d6cdfb3fb081a232d
79
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/FillRateHelper.js:3e01a5bc929e85870fe5
80
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/StateSafePureComponent.js:04ffc79d4da370644bce
81
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/ViewabilityHelper.js:8bafab90a37cab64b100
82
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/VirtualizedListCellRenderer.js:ce5f423367f40f3628a8
83
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/VirtualizedListContext.js:e6b1ef1f5b720d640981
84
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/CellRenderMask.js:de5ab026f9499640d730
85
- node_modules/@react-native/virtualized-lists_0.72.8/Lists/VirtualizedSectionList.js:d2355175ff6609a3def1
86
- node_modules/@babel/runtime_7.28.4/helpers/asyncToGenerator.js:77f56f33f638c3751138
87
- node_modules/use-sync-external-store_1.6.0/shim/index.native.js:962cceb83a0665e556b0
88
- node_modules/use-sync-external-store_1.6.0/cjs/use-sync-external-store-shim.native.production.js:882f173eeacafe179433
89
- node_modules/@babel/runtime_7.28.4/helpers/classPrivateFieldLooseKey.js:cb8ece4f72f02a959885
90
- node_modules/@babel/runtime_7.28.4/helpers/classPrivateFieldLooseBase.js:39eb90fd8fb300b049c2
@@ -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
- }