react-native-tvos 0.69.6-2 → 0.69.8-0rc

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 (196) hide show
  1. package/Libraries/Components/Pressable/Pressable.js +11 -2
  2. package/Libraries/Components/ScrollView/ScrollView.js +1 -0
  3. package/Libraries/Components/TV/TVEventHandler.js +4 -2
  4. package/Libraries/Components/TV/TVFocusEventHandler.js +4 -2
  5. package/Libraries/Components/TV/TVFocusGuideView.js +75 -47
  6. package/Libraries/Components/TV/TVViewPropTypes.js +7 -0
  7. package/Libraries/Components/TV/useTVEventHandler.js +2 -1
  8. package/Libraries/Components/TextInput/TextInput.js +1 -1
  9. package/Libraries/Components/Touchable/TouchableBounce.js +5 -0
  10. package/Libraries/Components/Touchable/TouchableHighlight.js +7 -2
  11. package/Libraries/Components/Touchable/TouchableOpacity.js +7 -2
  12. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +7 -0
  13. package/Libraries/Components/View/ViewNativeComponent.js +1 -1
  14. package/Libraries/Core/ReactNativeVersion.js +2 -2
  15. package/Libraries/Lists/VirtualizedList.js +25 -10
  16. package/Libraries/LogBox/UI/LogBoxButton.js +16 -12
  17. package/Libraries/LogBox/UI/LogBoxNotification.js +1 -1
  18. package/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm +2 -20
  19. package/Libraries/StyleSheet/StyleSheetTypes.js +1 -0
  20. package/Libraries/Types/CoreEventTypes.js +9 -0
  21. package/README.md +3 -1
  22. package/React/Base/RCTVersion.m +2 -2
  23. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +89 -8
  24. package/React/Views/RCTTVView.h +11 -1
  25. package/React/Views/RCTTVView.m +77 -0
  26. package/React/Views/RCTViewManager.m +6 -1
  27. package/ReactAndroid/gradle.properties +1 -1
  28. package/ReactAndroid/src/main/java/com/facebook/react/animated/EventAnimationDriver.java +6 -1
  29. package/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java +4 -5
  30. package/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java +57 -62
  31. package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +7 -1
  32. package/ReactAndroid/src/main/java/com/facebook/react/modules/core/ReactAndroidHWInputDeviceHelper.java +44 -14
  33. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +2 -2
  34. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/Event.java +18 -0
  35. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java +25 -0
  36. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +245 -7
  37. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.java +45 -4
  38. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  39. package/ReactCommon/react/renderer/components/view/ViewProps.cpp +87 -11
  40. package/ReactCommon/react/renderer/components/view/ViewProps.h +10 -1
  41. package/android/com/facebook/react/hermes-engine/{0.69.6-2/hermes-engine-0.69.6-2-release-javadoc.jar → 0.69.8-0rc/hermes-engine-0.69.8-0rc-debug-javadoc.jar} +0 -0
  42. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc-debug-javadoc.jar.md5 +1 -0
  43. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc-debug-javadoc.jar.sha1 +1 -0
  44. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc-debug-javadoc.jar.sha256 +1 -0
  45. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc-debug-javadoc.jar.sha512 +1 -0
  46. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc-debug.aar +0 -0
  47. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc-debug.aar.md5 +1 -0
  48. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc-debug.aar.sha1 +1 -0
  49. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc-debug.aar.sha256 +1 -0
  50. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc-debug.aar.sha512 +1 -0
  51. package/android/com/facebook/react/hermes-engine/{0.69.6-2/hermes-engine-0.69.6-2-debug-javadoc.jar → 0.69.8-0rc/hermes-engine-0.69.8-0rc-release-javadoc.jar} +0 -0
  52. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc-release-javadoc.jar.md5 +1 -0
  53. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc-release-javadoc.jar.sha1 +1 -0
  54. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc-release-javadoc.jar.sha256 +1 -0
  55. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc-release-javadoc.jar.sha512 +1 -0
  56. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc-release.aar +0 -0
  57. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc-release.aar.md5 +1 -0
  58. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc-release.aar.sha1 +1 -0
  59. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc-release.aar.sha256 +1 -0
  60. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc-release.aar.sha512 +1 -0
  61. package/android/com/facebook/react/hermes-engine/{0.69.6-2/hermes-engine-0.69.6-2.module → 0.69.8-0rc/hermes-engine-0.69.8-0rc.module} +47 -47
  62. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc.module.md5 +1 -0
  63. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc.module.sha1 +1 -0
  64. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc.module.sha256 +1 -0
  65. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc.module.sha512 +1 -0
  66. package/android/com/facebook/react/hermes-engine/{0.69.6-2/hermes-engine-0.69.6-2.pom → 0.69.8-0rc/hermes-engine-0.69.8-0rc.pom} +1 -1
  67. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc.pom.md5 +1 -0
  68. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc.pom.sha1 +1 -0
  69. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc.pom.sha256 +1 -0
  70. package/android/com/facebook/react/hermes-engine/0.69.8-0rc/hermes-engine-0.69.8-0rc.pom.sha512 +1 -0
  71. package/android/com/facebook/react/hermes-engine/maven-metadata.xml +4 -4
  72. package/android/com/facebook/react/hermes-engine/maven-metadata.xml.md5 +1 -1
  73. package/android/com/facebook/react/hermes-engine/maven-metadata.xml.sha1 +1 -1
  74. package/android/com/facebook/react/hermes-engine/maven-metadata.xml.sha256 +1 -1
  75. package/android/com/facebook/react/hermes-engine/maven-metadata.xml.sha512 +1 -1
  76. package/android/com/facebook/react/react-native/{0.69.6-2/react-native-0.69.6-2-debug-javadoc.jar → 0.69.8-0rc/react-native-0.69.8-0rc-debug-javadoc.jar} +0 -0
  77. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-debug-javadoc.jar.md5 +1 -0
  78. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-debug-javadoc.jar.sha1 +1 -0
  79. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-debug-javadoc.jar.sha256 +1 -0
  80. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-debug-javadoc.jar.sha512 +1 -0
  81. package/android/com/facebook/react/react-native/{0.69.6-2/react-native-0.69.6-2-debug-sources.jar → 0.69.8-0rc/react-native-0.69.8-0rc-debug-sources.jar} +0 -0
  82. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-debug-sources.jar.md5 +1 -0
  83. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-debug-sources.jar.sha1 +1 -0
  84. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-debug-sources.jar.sha256 +1 -0
  85. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-debug-sources.jar.sha512 +1 -0
  86. package/android/com/facebook/react/react-native/{0.69.6-2/react-native-0.69.6-2-debug.aar → 0.69.8-0rc/react-native-0.69.8-0rc-debug.aar} +0 -0
  87. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-debug.aar.md5 +1 -0
  88. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-debug.aar.sha1 +1 -0
  89. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-debug.aar.sha256 +1 -0
  90. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-debug.aar.sha512 +1 -0
  91. package/android/com/facebook/react/react-native/{0.69.6-2/react-native-0.69.6-2-release-javadoc.jar → 0.69.8-0rc/react-native-0.69.8-0rc-release-javadoc.jar} +0 -0
  92. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-release-javadoc.jar.md5 +1 -0
  93. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-release-javadoc.jar.sha1 +1 -0
  94. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-release-javadoc.jar.sha256 +1 -0
  95. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-release-javadoc.jar.sha512 +1 -0
  96. package/android/com/facebook/react/react-native/{0.69.6-2/react-native-0.69.6-2-release-sources.jar → 0.69.8-0rc/react-native-0.69.8-0rc-release-sources.jar} +0 -0
  97. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-release-sources.jar.md5 +1 -0
  98. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-release-sources.jar.sha1 +1 -0
  99. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-release-sources.jar.sha256 +1 -0
  100. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-release-sources.jar.sha512 +1 -0
  101. package/android/com/facebook/react/react-native/{0.69.6-2/react-native-0.69.6-2-release.aar → 0.69.8-0rc/react-native-0.69.8-0rc-release.aar} +0 -0
  102. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-release.aar.md5 +1 -0
  103. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-release.aar.sha1 +1 -0
  104. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-release.aar.sha256 +1 -0
  105. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc-release.aar.sha512 +1 -0
  106. package/android/com/facebook/react/react-native/{0.69.6-2/react-native-0.69.6-2.module → 0.69.8-0rc/react-native-0.69.8-0rc.module} +57 -57
  107. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc.module.md5 +1 -0
  108. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc.module.sha1 +1 -0
  109. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc.module.sha256 +1 -0
  110. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc.module.sha512 +1 -0
  111. package/android/com/facebook/react/react-native/{0.69.6-2/react-native-0.69.6-2.pom → 0.69.8-0rc/react-native-0.69.8-0rc.pom} +1 -1
  112. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc.pom.md5 +1 -0
  113. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc.pom.sha1 +1 -0
  114. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc.pom.sha256 +1 -0
  115. package/android/com/facebook/react/react-native/0.69.8-0rc/react-native-0.69.8-0rc.pom.sha512 +1 -0
  116. package/android/com/facebook/react/react-native/maven-metadata.xml +4 -4
  117. package/android/com/facebook/react/react-native/maven-metadata.xml.md5 +1 -1
  118. package/android/com/facebook/react/react-native/maven-metadata.xml.sha1 +1 -1
  119. package/android/com/facebook/react/react-native/maven-metadata.xml.sha256 +1 -1
  120. package/android/com/facebook/react/react-native/maven-metadata.xml.sha512 +1 -1
  121. package/index.js +1 -7
  122. package/package.json +2 -2
  123. package/sdks/hermesc/linux64-bin/hermesc +0 -0
  124. package/sdks/hermesc/osx-bin/hermesc +0 -0
  125. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  126. package/template/package.json +1 -1
  127. package/tvos-types.d.ts +37 -5
  128. package/Libraries/DeprecatedPropTypes/DeprecatedTVViewPropTypes.js +0 -23
  129. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2-debug-javadoc.jar.md5 +0 -1
  130. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2-debug-javadoc.jar.sha1 +0 -1
  131. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2-debug-javadoc.jar.sha256 +0 -1
  132. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2-debug-javadoc.jar.sha512 +0 -1
  133. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2-debug.aar +0 -0
  134. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2-debug.aar.md5 +0 -1
  135. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2-debug.aar.sha1 +0 -1
  136. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2-debug.aar.sha256 +0 -1
  137. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2-debug.aar.sha512 +0 -1
  138. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2-release-javadoc.jar.md5 +0 -1
  139. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2-release-javadoc.jar.sha1 +0 -1
  140. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2-release-javadoc.jar.sha256 +0 -1
  141. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2-release-javadoc.jar.sha512 +0 -1
  142. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2-release.aar +0 -0
  143. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2-release.aar.md5 +0 -1
  144. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2-release.aar.sha1 +0 -1
  145. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2-release.aar.sha256 +0 -1
  146. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2-release.aar.sha512 +0 -1
  147. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2.module.md5 +0 -1
  148. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2.module.sha1 +0 -1
  149. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2.module.sha256 +0 -1
  150. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2.module.sha512 +0 -1
  151. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2.pom.md5 +0 -1
  152. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2.pom.sha1 +0 -1
  153. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2.pom.sha256 +0 -1
  154. package/android/com/facebook/react/hermes-engine/0.69.6-2/hermes-engine-0.69.6-2.pom.sha512 +0 -1
  155. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-debug-javadoc.jar.md5 +0 -1
  156. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-debug-javadoc.jar.sha1 +0 -1
  157. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-debug-javadoc.jar.sha256 +0 -1
  158. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-debug-javadoc.jar.sha512 +0 -1
  159. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-debug-sources.jar.md5 +0 -1
  160. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-debug-sources.jar.sha1 +0 -1
  161. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-debug-sources.jar.sha256 +0 -1
  162. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-debug-sources.jar.sha512 +0 -1
  163. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-debug.aar.md5 +0 -1
  164. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-debug.aar.sha1 +0 -1
  165. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-debug.aar.sha256 +0 -1
  166. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-debug.aar.sha512 +0 -1
  167. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-release-javadoc.jar.md5 +0 -1
  168. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-release-javadoc.jar.sha1 +0 -1
  169. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-release-javadoc.jar.sha256 +0 -1
  170. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-release-javadoc.jar.sha512 +0 -1
  171. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-release-sources.jar.md5 +0 -1
  172. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-release-sources.jar.sha1 +0 -1
  173. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-release-sources.jar.sha256 +0 -1
  174. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-release-sources.jar.sha512 +0 -1
  175. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-release.aar.md5 +0 -1
  176. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-release.aar.sha1 +0 -1
  177. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-release.aar.sha256 +0 -1
  178. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2-release.aar.sha512 +0 -1
  179. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2.module.md5 +0 -1
  180. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2.module.sha1 +0 -1
  181. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2.module.sha256 +0 -1
  182. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2.module.sha512 +0 -1
  183. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2.pom.md5 +0 -1
  184. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2.pom.sha1 +0 -1
  185. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2.pom.sha256 +0 -1
  186. package/android/com/facebook/react/react-native/0.69.6-2/react-native-0.69.6-2.pom.sha512 +0 -1
  187. /package/android/com/facebook/react/hermes-engine/{0.69.6-2/hermes-engine-0.69.6-2-debug-sources.jar → 0.69.8-0rc/hermes-engine-0.69.8-0rc-debug-sources.jar} +0 -0
  188. /package/android/com/facebook/react/hermes-engine/{0.69.6-2/hermes-engine-0.69.6-2-debug-sources.jar.md5 → 0.69.8-0rc/hermes-engine-0.69.8-0rc-debug-sources.jar.md5} +0 -0
  189. /package/android/com/facebook/react/hermes-engine/{0.69.6-2/hermes-engine-0.69.6-2-debug-sources.jar.sha1 → 0.69.8-0rc/hermes-engine-0.69.8-0rc-debug-sources.jar.sha1} +0 -0
  190. /package/android/com/facebook/react/hermes-engine/{0.69.6-2/hermes-engine-0.69.6-2-debug-sources.jar.sha256 → 0.69.8-0rc/hermes-engine-0.69.8-0rc-debug-sources.jar.sha256} +0 -0
  191. /package/android/com/facebook/react/hermes-engine/{0.69.6-2/hermes-engine-0.69.6-2-debug-sources.jar.sha512 → 0.69.8-0rc/hermes-engine-0.69.8-0rc-debug-sources.jar.sha512} +0 -0
  192. /package/android/com/facebook/react/hermes-engine/{0.69.6-2/hermes-engine-0.69.6-2-release-sources.jar → 0.69.8-0rc/hermes-engine-0.69.8-0rc-release-sources.jar} +0 -0
  193. /package/android/com/facebook/react/hermes-engine/{0.69.6-2/hermes-engine-0.69.6-2-release-sources.jar.md5 → 0.69.8-0rc/hermes-engine-0.69.8-0rc-release-sources.jar.md5} +0 -0
  194. /package/android/com/facebook/react/hermes-engine/{0.69.6-2/hermes-engine-0.69.6-2-release-sources.jar.sha1 → 0.69.8-0rc/hermes-engine-0.69.8-0rc-release-sources.jar.sha1} +0 -0
  195. /package/android/com/facebook/react/hermes-engine/{0.69.6-2/hermes-engine-0.69.6-2-release-sources.jar.sha256 → 0.69.8-0rc/hermes-engine-0.69.8-0rc-release-sources.jar.sha256} +0 -0
  196. /package/android/com/facebook/react/hermes-engine/{0.69.6-2/hermes-engine-0.69.6-2-release-sources.jar.sha512 → 0.69.8-0rc/hermes-engine-0.69.8-0rc-release-sources.jar.sha512} +0 -0
@@ -52,6 +52,13 @@ using namespace facebook::react;
52
52
  UIView *_nextFocusLeft;
53
53
  UIView *_nextFocusRight;
54
54
  UIView *_nextFocusActiveTarget;
55
+ BOOL _autoFocus;
56
+ BOOL _trapFocusUp;
57
+ BOOL _trapFocusDown;
58
+ BOOL _trapFocusLeft;
59
+ BOOL _trapFocusRight;
60
+ NSArray* _focusDestinations;
61
+ id<UIFocusItem> _previouslyFocusedItem;
55
62
  }
56
63
 
57
64
  @synthesize removeClippedSubviews = _removeClippedSubviews;
@@ -131,7 +138,7 @@ using namespace facebook::react;
131
138
  return (RCTRootComponentView *)rootview;
132
139
  }
133
140
 
134
- - (void)addFocusDestinations:(NSArray*)destinations {
141
+ - (void)addFocusGuide:(NSArray*)destinations {
135
142
  if (self.focusGuide == nil) {
136
143
  self.focusGuide = [UIFocusGuide new];
137
144
  [self addLayoutGuide:self.focusGuide];
@@ -141,10 +148,49 @@ using namespace facebook::react;
141
148
  [self.focusGuide.widthAnchor constraintEqualToAnchor:self.widthAnchor].active = YES;
142
149
  [self.focusGuide.heightAnchor constraintEqualToAnchor:self.heightAnchor].active = YES;
143
150
  }
144
-
151
+
145
152
  self.focusGuide.preferredFocusEnvironments = destinations;
146
153
  }
147
154
 
155
+ - (void)removeFocusGuide {
156
+ if (self.focusGuide != nil) {
157
+ _focusDestinations = nil;
158
+ _previouslyFocusedItem = nil;
159
+
160
+ [self removeLayoutGuide:self.focusGuide];
161
+ self.focusGuide = nil;
162
+ }
163
+ }
164
+
165
+ /// Responsible of determining what focusGuide's next state should be based on the active properties of the component.
166
+ - (void)handleFocusGuide
167
+ {
168
+ // `destinations` should always be favored against `autoFocus` feature, if provided.
169
+ if (_focusDestinations != nil) {
170
+ [self addFocusGuide:_focusDestinations];
171
+ } else if (_autoFocus && _previouslyFocusedItem != nil) {
172
+ // We also add `self` as the second option in case `previouslyFocusedItem` becomes unreachable (e.g gets detached).
173
+ // `self` helps redirecting focus to the first focusable element in that case.
174
+ [self addFocusGuide:@[_previouslyFocusedItem, self]];
175
+ } else if (_autoFocus) {
176
+ [self addFocusGuide:@[self]];
177
+ } else {
178
+ // Then there's no need to have `focusGuide`, remove it to prevent potential bugs.
179
+ [self removeFocusGuide];
180
+ }
181
+ }
182
+
183
+ - (void)setFocusDestinations:(NSArray*)destinations
184
+ {
185
+ if(destinations.count == 0) {
186
+ _focusDestinations = nil;
187
+ } else {
188
+ _focusDestinations = destinations;
189
+ }
190
+
191
+ [self handleFocusGuide];
192
+ }
193
+
148
194
  - (void)sendFocusNotification:(__unused UIFocusUpdateContext *)context
149
195
  {
150
196
  [self sendNotificationWithEventType:@"focus"];
@@ -411,11 +457,38 @@ using namespace facebook::react;
411
457
  }
412
458
  }
413
459
 
460
+ - (BOOL)shouldUpdateFocusInContext:(UIFocusUpdateContext *)context
461
+ {
462
+ // This is the `trapFocus*` logic that prevents the focus updates if
463
+ // focus should be trapped and `nextFocusedItem` is not a child FocusEnv.
464
+ if ((_trapFocusUp && context.focusHeading == UIFocusHeadingUp)
465
+ || (_trapFocusDown && context.focusHeading == UIFocusHeadingDown)
466
+ || (_trapFocusLeft && context.focusHeading == UIFocusHeadingLeft)
467
+ || (_trapFocusRight && context.focusHeading == UIFocusHeadingRight)) {
468
+
469
+ // Checks if `nextFocusedItem` is a child `FocusEnvironment`.
470
+ // If not, it returns false thus it keeps the focus inside.
471
+ return [UIFocusSystem environment:self containsEnvironment:context.nextFocusedItem];
472
+ }
473
+
474
+ return [super shouldUpdateFocusInContext:context];
475
+ }
476
+
414
477
  - (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator
415
478
  {
416
479
  if (context.previouslyFocusedView == context.nextFocusedView) {
417
480
  return;
418
481
  }
482
+
483
+ if (_autoFocus && self.focusGuide != nil && context.previouslyFocusedItem != nil) {
484
+ // Whenever focus leaves the container, `nextFocusedView` is the destination, the item outside the container.
485
+ // So, `previouslyFocusedItem` is always the last focused child of `TVFocusGuide`.
486
+ // We should update `preferredFocusEnvironments` in this case to make sure `FocusGuide` remembers
487
+ // the last focused element and redirects the focus to it whenever focus comes back.
488
+ _previouslyFocusedItem = context.previouslyFocusedItem;
489
+ [self handleFocusGuide];
490
+ }
491
+
419
492
  if (context.nextFocusedView == self && self.isUserInteractionEnabled ) {
420
493
  [self becomeFirstResponder];
421
494
  [self enableDirectionalFocusGuides];
@@ -459,7 +532,7 @@ using namespace facebook::react;
459
532
  [destinations addObject:view];
460
533
  }
461
534
  }
462
- [self addFocusDestinations:destinations];
535
+ [self setFocusDestinations:destinations];
463
536
  return;
464
537
  #endif
465
538
  }
@@ -825,6 +898,17 @@ using namespace facebook::react;
825
898
  _nextFocusRight = nil;
826
899
  }
827
900
  }
901
+
902
+ // `autoFocus`
903
+ if (oldViewProps.autoFocus != newViewProps.autoFocus) {
904
+ _autoFocus = newViewProps.autoFocus;
905
+ [self handleFocusGuide];
906
+ }
907
+
908
+ _trapFocusUp = newViewProps.trapFocusUp;
909
+ _trapFocusDown = newViewProps.trapFocusDown;
910
+ _trapFocusLeft = newViewProps.trapFocusLeft;
911
+ _trapFocusRight = newViewProps.trapFocusRight;
828
912
  #endif
829
913
 
830
914
 
@@ -910,11 +994,8 @@ using namespace facebook::react;
910
994
  if ([_propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN containsObject:@"opacity"]) {
911
995
  self.layer.opacity = (float)props.opacity;
912
996
  }
913
-
914
- if (self.focusGuide != nil) {
915
- [self removeLayoutGuide:self.focusGuide];
916
- self.focusGuide = nil;
917
- }
997
+
998
+ [self removeFocusGuide];
918
999
 
919
1000
  _propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN = nil;
920
1001
  _eventEmitter.reset();
@@ -42,6 +42,16 @@
42
42
  @property (nonatomic, strong) UIFocusGuide * focusGuideLeft;
43
43
  @property (nonatomic, strong) UIFocusGuide * focusGuideRight;
44
44
 
45
+ /**
46
+ * Auto focus
47
+ */
48
+ @property (nonatomic, assign) BOOL autoFocus;
49
+
50
+ @property (nonatomic, assign) BOOL trapFocusUp;
51
+ @property (nonatomic, assign) BOOL trapFocusDown;
52
+ @property (nonatomic, assign) BOOL trapFocusLeft;
53
+ @property (nonatomic, assign) BOOL trapFocusRight;
54
+
45
55
  - (instancetype)initWithBridge:(RCTBridge *)bridge;
46
56
 
47
57
  /**
@@ -70,7 +80,7 @@
70
80
  - (void)removeParallaxMotionEffects;
71
81
 
72
82
 
73
- - (void)addFocusGuide:(NSArray*)destinations;
83
+ - (void)setFocusDestinations:(NSArray*)destinations;
74
84
 
75
85
  @property (nonatomic, strong) UIFocusGuide * focusGuide;
76
86
 
@@ -23,6 +23,9 @@
23
23
  __weak RCTBridge *_bridge;
24
24
  UITapGestureRecognizer *_selectRecognizer;
25
25
  BOOL motionEffectsAdded;
26
+ NSArray* focusDestinations;
27
+ id<UIFocusItem> previouslyFocusedItem;
28
+
26
29
  }
27
30
 
28
31
  - (instancetype)initWithBridge:(RCTBridge *)bridge {
@@ -255,12 +258,39 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
255
258
  motionEffectsAdded = NO;
256
259
  }
257
260
 
261
+ - (BOOL)shouldUpdateFocusInContext:(UIFocusUpdateContext *)context
262
+ {
263
+ // This is the `trapFocus*` logic that prevents the focus updates if
264
+ // focus should be trapped and `nextFocusedItem` is not a child FocusEnv.
265
+ if ((_trapFocusUp && context.focusHeading == UIFocusHeadingUp)
266
+ || (_trapFocusDown && context.focusHeading == UIFocusHeadingDown)
267
+ || (_trapFocusLeft && context.focusHeading == UIFocusHeadingLeft)
268
+ || (_trapFocusRight && context.focusHeading == UIFocusHeadingRight)) {
269
+
270
+ // Checks if `nextFocusedItem` is a child `FocusEnvironment`.
271
+ // If not, it returns false thus it keeps the focus inside.
272
+ return [UIFocusSystem environment:self containsEnvironment:context.nextFocusedItem];
273
+ }
274
+
275
+ return [super shouldUpdateFocusInContext:context];
276
+ }
277
+
258
278
  - (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context
259
279
  withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator
260
280
  {
261
281
  if (context.previouslyFocusedView == context.nextFocusedView) {
262
282
  return;
263
283
  }
284
+
285
+ if (_autoFocus && self.focusGuide != nil && context.previouslyFocusedItem != nil) {
286
+ // Whenever focus leaves the container, `nextFocusedView` is the destination, the item outside the container.
287
+ // So, `previouslyFocusedItem` is always the last focused child of `TVFocusGuide`.
288
+ // We should update `preferredFocusEnvironments` in this case to make sure `FocusGuide` remembers
289
+ // the last focused element and redirects the focus to it whenever focus comes back.
290
+ previouslyFocusedItem = context.previouslyFocusedItem;
291
+ [self handleFocusGuide];
292
+ }
293
+
264
294
  if (context.nextFocusedView == self && self.isTVSelectable ) {
265
295
  [self becomeFirstResponder];
266
296
  [self enableDirectionalFocusGuides];
@@ -432,6 +462,14 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
432
462
  [self setPreferredFocus:hasTVPreferredFocus];
433
463
  }
434
464
 
465
+ - (void)setAutoFocus:(BOOL)autoFocus
466
+ {
467
+ if (_autoFocus != autoFocus) {
468
+ _autoFocus = autoFocus;
469
+ [self handleFocusGuide];
470
+ }
471
+ }
472
+
435
473
  - (void)addFocusGuide:(NSArray*)destinations {
436
474
  if (self.focusGuide == nil) {
437
475
  self.focusGuide = [UIFocusGuide new];
@@ -446,4 +484,43 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
446
484
  self.focusGuide.preferredFocusEnvironments = destinations;
447
485
  }
448
486
 
487
+ - (void)removeFocusGuide {
488
+ if (self.focusGuide != nil) {
489
+ focusDestinations = nil;
490
+ previouslyFocusedItem = nil;
491
+
492
+ [self removeLayoutGuide:self.focusGuide];
493
+ self.focusGuide = nil;
494
+ }
495
+ }
496
+
497
+ /// Responsible of determining what focusGuide's next state should be based on the active properties of the component.
498
+ - (void)handleFocusGuide
499
+ {
500
+ // `destinations` should always be favored against `autoFocus` feature, if provided.
501
+ if (focusDestinations != nil) {
502
+ [self addFocusGuide:focusDestinations];
503
+ } else if (_autoFocus && previouslyFocusedItem != nil) {
504
+ // We also add `self` as the second option in case `previouslyFocusedItem` becomes unreachable (e.g gets detached).
505
+ // `self` helps redirecting focus to the first focusable element in that case.
506
+ [self addFocusGuide:@[previouslyFocusedItem, self]];
507
+ } else if (_autoFocus) {
508
+ [self addFocusGuide:@[self]];
509
+ } else {
510
+ // Then there's no need to have `focusGuide`, remove it to prevent potential bugs.
511
+ [self removeFocusGuide];
512
+ }
513
+ }
514
+
515
+ - (void)setFocusDestinations:(NSArray*)destinations
516
+ {
517
+ if(destinations.count == 0) {
518
+ focusDestinations = nil;
519
+ } else {
520
+ focusDestinations = destinations;
521
+ }
522
+
523
+ [self handleFocusGuide];
524
+ }
525
+
449
526
  @end
@@ -137,6 +137,11 @@ RCT_EXPORT_VIEW_PROPERTY(nextFocusUp, NSNumber)
137
137
  RCT_EXPORT_VIEW_PROPERTY(nextFocusDown, NSNumber)
138
138
  RCT_EXPORT_VIEW_PROPERTY(nextFocusLeft, NSNumber)
139
139
  RCT_EXPORT_VIEW_PROPERTY(nextFocusRight, NSNumber)
140
+ RCT_EXPORT_VIEW_PROPERTY(autoFocus, BOOL)
141
+ RCT_EXPORT_VIEW_PROPERTY(trapFocusUp, BOOL)
142
+ RCT_EXPORT_VIEW_PROPERTY(trapFocusDown, BOOL)
143
+ RCT_EXPORT_VIEW_PROPERTY(trapFocusLeft, BOOL)
144
+ RCT_EXPORT_VIEW_PROPERTY(trapFocusRight, BOOL)
140
145
  #endif
141
146
 
142
147
  // Accessibility related properties
@@ -451,7 +456,7 @@ RCT_EXPORT_METHOD(setDestinations : (nonnull NSNumber *)viewTag reactTags : (NSA
451
456
  [destinations addObject:destination];
452
457
  }
453
458
  }
454
- [view addFocusGuide:destinations];
459
+ [view setFocusDestinations:destinations];
455
460
  }];
456
461
  }
457
462
  #endif
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.69.6-2
1
+ VERSION_NAME=0.69.8-0rc
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  POM_NAME=ReactNative
@@ -21,8 +21,13 @@ import java.util.List;
21
21
  /* package */ class EventAnimationDriver implements RCTEventEmitter {
22
22
  private List<String> mEventPath;
23
23
  /* package */ ValueAnimatedNode mValueNode;
24
+ /* package */ String mEventName;
25
+ /* package */ int mViewTag;
24
26
 
25
- public EventAnimationDriver(List<String> eventPath, ValueAnimatedNode valueNode) {
27
+ public EventAnimationDriver(
28
+ String eventName, int viewTag, List<String> eventPath, ValueAnimatedNode valueNode) {
29
+ mEventName = eventName;
30
+ mViewTag = viewTag;
26
31
  mEventPath = eventPath;
27
32
  mValueNode = valueNode;
28
33
  }
@@ -113,7 +113,7 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
113
113
 
114
114
  @AnyThread
115
115
  boolean isEmpty() {
116
- return mQueue.isEmpty();
116
+ return mQueue.isEmpty() && mPeekedOperation != null;
117
117
  }
118
118
 
119
119
  void setSynchronizedAccess(boolean isSynchronizedAccess) {
@@ -393,8 +393,8 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
393
393
 
394
394
  /**
395
395
  * Given a viewTag, detect if we're running in Fabric or non-Fabric and attach an event listener
396
- * to the correct UIManager, if necessary. This is expected to only be called from the JS thread,
397
- * and not concurrently.
396
+ * to the correct UIManager, if necessary. This is expected to only be called from the native
397
+ * module thread, and not concurrently.
398
398
  *
399
399
  * @param viewTag
400
400
  */
@@ -417,8 +417,7 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
417
417
  }
418
418
 
419
419
  // Subscribe to UIManager (Fabric or non-Fabric) lifecycle events if we haven't yet
420
- if ((mInitializedForFabric && mUIManagerType == UIManagerType.FABRIC)
421
- || (mInitializedForNonFabric && mUIManagerType == UIManagerType.DEFAULT)) {
420
+ if (mUIManagerType == UIManagerType.FABRIC ? mInitializedForFabric : mInitializedForNonFabric) {
422
421
  return;
423
422
  }
424
423
 
@@ -30,11 +30,9 @@ import com.facebook.react.uimanager.events.EventDispatcher;
30
30
  import com.facebook.react.uimanager.events.EventDispatcherListener;
31
31
  import java.util.ArrayDeque;
32
32
  import java.util.ArrayList;
33
- import java.util.HashMap;
34
33
  import java.util.LinkedList;
35
34
  import java.util.List;
36
35
  import java.util.ListIterator;
37
- import java.util.Map;
38
36
  import java.util.Queue;
39
37
 
40
38
  /**
@@ -57,9 +55,9 @@ import java.util.Queue;
57
55
  private final SparseArray<AnimatedNode> mAnimatedNodes = new SparseArray<>();
58
56
  private final SparseArray<AnimationDriver> mActiveAnimations = new SparseArray<>();
59
57
  private final SparseArray<AnimatedNode> mUpdatedNodes = new SparseArray<>();
60
- // Mapping of a view tag and an event name to a list of event animation drivers. 99% of the time
61
- // there will be only one driver per mapping so all code code should be optimized around that.
62
- private final Map<String, List<EventAnimationDriver>> mEventDrivers = new HashMap<>();
58
+ // List of event animation drivers for an event on view.
59
+ // There may be multiple drivers for the same event and view.
60
+ private final List<EventAnimationDriver> mEventDrivers = new ArrayList<>();
63
61
  private final ReactApplicationContext mReactApplicationContext;
64
62
  private int mAnimatedGraphBFSColor = 0;
65
63
  // Used to avoid allocating a new array on every frame in `runUpdates` and `onEventDispatch`.
@@ -76,36 +74,27 @@ import java.util.Queue;
76
74
 
77
75
  /**
78
76
  * Initialize event listeners for Fabric UIManager or non-Fabric UIManager, exactly once. Once
79
- * Fabric is the only UIManager, this logic can be simplified. This is only called on the JS
80
- * thread.
77
+ * Fabric is the only UIManager, this logic can be simplified. This is expected to only be called
78
+ * from the native module thread.
81
79
  *
82
80
  * @param uiManagerType
83
81
  */
84
- @UiThread
85
82
  public void initializeEventListenerForUIManagerType(@UIManagerType final int uiManagerType) {
86
- if ((uiManagerType == UIManagerType.FABRIC && mEventListenerInitializedForFabric)
87
- || (uiManagerType == UIManagerType.DEFAULT && mEventListenerInitializedForNonFabric)) {
83
+ if (uiManagerType == UIManagerType.FABRIC
84
+ ? mEventListenerInitializedForFabric
85
+ : mEventListenerInitializedForNonFabric) {
88
86
  return;
89
87
  }
90
88
 
91
- final NativeAnimatedNodesManager self = this;
92
- mReactApplicationContext.runOnUiQueueThread(
93
- new Runnable() {
94
- @Override
95
- public void run() {
96
- UIManager uiManager =
97
- UIManagerHelper.getUIManager(mReactApplicationContext, uiManagerType);
98
- if (uiManager != null) {
99
- uiManager.<EventDispatcher>getEventDispatcher().addListener(self);
100
-
101
- if (uiManagerType == UIManagerType.FABRIC) {
102
- mEventListenerInitializedForFabric = true;
103
- } else {
104
- mEventListenerInitializedForNonFabric = true;
105
- }
106
- }
107
- }
108
- });
89
+ UIManager uiManager = UIManagerHelper.getUIManager(mReactApplicationContext, uiManagerType);
90
+ if (uiManager != null) {
91
+ uiManager.<EventDispatcher>getEventDispatcher().addListener(this);
92
+ if (uiManagerType == UIManagerType.FABRIC) {
93
+ mEventListenerInitializedForFabric = true;
94
+ } else {
95
+ mEventListenerInitializedForNonFabric = true;
96
+ }
97
+ }
109
98
  }
110
99
 
111
100
  /*package*/ @Nullable
@@ -471,7 +460,8 @@ import java.util.Queue;
471
460
  }
472
461
 
473
462
  @UiThread
474
- public void addAnimatedEventToView(int viewTag, String eventName, ReadableMap eventMapping) {
463
+ public void addAnimatedEventToView(
464
+ int viewTag, String eventHandlerName, ReadableMap eventMapping) {
475
465
  int nodeTag = eventMapping.getInt("animatedValueTag");
476
466
  AnimatedNode node = mAnimatedNodes.get(nodeTag);
477
467
  if (node == null) {
@@ -482,8 +472,8 @@ import java.util.Queue;
482
472
  throw new JSApplicationIllegalArgumentException(
483
473
  "addAnimatedEventToView: Animated node on view ["
484
474
  + viewTag
485
- + "] connected to event ("
486
- + eventName
475
+ + "] connected to event handler ("
476
+ + eventHandlerName
487
477
  + ") should be of type "
488
478
  + ValueAnimatedNode.class.getName());
489
479
  }
@@ -494,37 +484,31 @@ import java.util.Queue;
494
484
  pathList.add(path.getString(i));
495
485
  }
496
486
 
497
- EventAnimationDriver event = new EventAnimationDriver(pathList, (ValueAnimatedNode) node);
498
- String key = viewTag + eventName;
499
- if (mEventDrivers.containsKey(key)) {
500
- mEventDrivers.get(key).add(event);
501
- } else {
502
- List<EventAnimationDriver> drivers = new ArrayList<>(1);
503
- drivers.add(event);
504
- mEventDrivers.put(key, drivers);
505
- }
487
+ String eventName = normalizeEventName(eventHandlerName);
488
+
489
+ EventAnimationDriver eventDriver =
490
+ new EventAnimationDriver(eventName, viewTag, pathList, (ValueAnimatedNode) node);
491
+ mEventDrivers.add(eventDriver);
506
492
  }
507
493
 
508
494
  @UiThread
509
- public void removeAnimatedEventFromView(int viewTag, String eventName, int animatedValueTag) {
510
- String key = viewTag + eventName;
511
- if (mEventDrivers.containsKey(key)) {
512
- List<EventAnimationDriver> driversForKey = mEventDrivers.get(key);
513
- if (driversForKey.size() == 1) {
514
- mEventDrivers.remove(viewTag + eventName);
515
- } else {
516
- ListIterator<EventAnimationDriver> it = driversForKey.listIterator();
517
- while (it.hasNext()) {
518
- if (it.next().mValueNode.mTag == animatedValueTag) {
519
- it.remove();
520
- break;
521
- }
522
- }
495
+ public void removeAnimatedEventFromView(
496
+ int viewTag, String eventHandlerName, int animatedValueTag) {
497
+
498
+ String eventName = normalizeEventName(eventHandlerName);
499
+
500
+ ListIterator<EventAnimationDriver> it = mEventDrivers.listIterator();
501
+ while (it.hasNext()) {
502
+ EventAnimationDriver driver = it.next();
503
+ if (eventName.equals(driver.mEventName)
504
+ && viewTag == driver.mViewTag
505
+ && animatedValueTag == driver.mValueNode.mTag) {
506
+ it.remove();
507
+ break;
523
508
  }
524
509
  }
525
510
  }
526
511
 
527
- @UiThread
528
512
  @Override
529
513
  public void onEventDispatch(final Event event) {
530
514
  // Events can be dispatched from any thread so we have to make sure handleEvent is run from the
@@ -556,18 +540,19 @@ import java.util.Queue;
556
540
  if (uiManager == null) {
557
541
  return;
558
542
  }
559
- String eventName = uiManager.resolveCustomDirectEventName(event.getEventName());
560
- if (eventName == null) {
561
- eventName = "";
562
- }
563
543
 
564
- List<EventAnimationDriver> driversForKey = mEventDrivers.get(event.getViewTag() + eventName);
565
- if (driversForKey != null) {
566
- for (EventAnimationDriver driver : driversForKey) {
544
+ boolean foundAtLeastOneDriver = false;
545
+ Event.EventAnimationDriverMatchSpec matchSpec = event.getEventAnimationDriverMatchSpec();
546
+ for (EventAnimationDriver driver : mEventDrivers) {
547
+ if (matchSpec.match(driver.mViewTag, driver.mEventName)) {
548
+ foundAtLeastOneDriver = true;
567
549
  stopAnimationsForNode(driver.mValueNode);
568
550
  event.dispatch(driver);
569
551
  mRunUpdateNodeList.add(driver.mValueNode);
570
552
  }
553
+ }
554
+
555
+ if (foundAtLeastOneDriver) {
571
556
  updateNodes(mRunUpdateNodeList);
572
557
  mRunUpdateNodeList.clear();
573
558
  }
@@ -782,4 +767,14 @@ import java.util.Queue;
782
767
  mWarnedAboutGraphTraversal = false;
783
768
  }
784
769
  }
770
+
771
+ private String normalizeEventName(String eventHandlerName) {
772
+ // Fabric UIManager also makes this assumption
773
+ String eventName = eventHandlerName;
774
+ if (eventHandlerName.startsWith("on")) {
775
+ eventName = "top" + eventHandlerName.substring(2);
776
+ }
777
+
778
+ return eventName;
779
+ }
785
780
  }
@@ -105,7 +105,13 @@ public class ReactFeatureFlags {
105
105
  public static boolean enableDelayedViewStateDeletion = false;
106
106
 
107
107
  /**
108
- * Send key down events as well as key up events
108
+ * Android TV: Send key down events as well as key up events.
109
+ * Enabling this flag will result in two 'select' TVRemoteEventHandler events
110
+ * (one with key action 0 and one with key action 1) for each press of the center
111
+ * DPad button. (Similarly for arrow keys.)
112
+ * Note: If you enable this flag, long presses of the select or center button will
113
+ * result in an initial 'select' with eventKeyAction = 0 (ACTION_DOWN), before
114
+ * the expected 'longSelect' events are fired. (Similarly for arrow keys.)
109
115
  */
110
116
  public static boolean enableKeyDownEvents = false;
111
117
 
@@ -81,8 +81,14 @@ public class ReactAndroidHWInputDeviceHelper {
81
81
  */
82
82
  private int mLastFocusedViewId = View.NO_ID;
83
83
 
84
+ // Presses longer than this number of milliseconds are treated as long presses
85
+ // This seems to be roughly the time the emulator waits after the first key down event
86
+ // before sending a continuous stream of rapid key downs on a long press.
87
+ private long mLongPressedDelta = 300;
88
+
89
+ // These are used for long press detection
84
90
  private long mLastKeyDownTime = 0;
85
- private long mPressedDelta = 1000;
91
+ private boolean longPressEventActive = false;
86
92
 
87
93
  public ReactAndroidHWInputDeviceHelper() {}
88
94
 
@@ -101,6 +107,12 @@ public class ReactAndroidHWInputDeviceHelper {
101
107
  eventKeyCode == KeyEvent.KEYCODE_DPAD_LEFT;
102
108
  }
103
109
 
110
+ // True if we are in the long press state and we are more than
111
+ // mLongPressedDelta milliseconds since the last long press event was fired
112
+ private boolean isLongPressEventTime(long time) {
113
+ return mLastKeyDownTime != 0 && time - mLastKeyDownTime > mLongPressedDelta;
114
+ }
115
+
104
116
  /** Called from {@link com.facebook.react.ReactRootView}. This is the main place the key events are handled. */
105
117
  public void handleKeyEvent(KeyEvent ev, ReactContext context) {
106
118
  int eventKeyCode = ev.getKeyCode();
@@ -108,30 +120,48 @@ public class ReactAndroidHWInputDeviceHelper {
108
120
  long time = SystemClock.uptimeMillis();
109
121
  boolean isSelectOrDPadEvent = isDPadEvent(eventKeyCode) || isSelectEvent(eventKeyCode);
110
122
 
111
- // Simple implementation of long press detection
112
- if ((eventKeyAction == KeyEvent.ACTION_DOWN)
113
- && isSelectOrDPadEvent && mLastKeyDownTime == 0) {
114
- mLastKeyDownTime = time;
123
+ // Simple implementation of long press detection for key down events
124
+ if ((eventKeyAction == KeyEvent.ACTION_DOWN) && isSelectOrDPadEvent) {
125
+ if (mLastKeyDownTime == 0) {
126
+ mLastKeyDownTime = time;
127
+ } else {
128
+ if (isLongPressEventTime(time)) {
129
+ // Activate long press state and don't reset until key up event arrives
130
+ longPressEventActive = true;
131
+ }
132
+ }
115
133
  }
116
134
 
117
- if (shouldDispatchEvent(eventKeyCode, eventKeyAction)) {
118
- long delta = time - mLastKeyDownTime;
119
- boolean isLongPress = delta > mPressedDelta;
120
-
121
- if(isLongPress && isSelectOrDPadEvent){
122
- dispatchEvent(KEY_EVENTS_LONG_PRESS_ACTIONS.get(eventKeyCode), mLastFocusedViewId, eventKeyAction, context);
135
+ if (shouldDispatchEvent(eventKeyCode, eventKeyAction, time)) {
136
+ if(longPressEventActive) {
137
+ // If we are not sending key down events to JS, send the long press event as a key up to make sure it is received
138
+ dispatchEvent(
139
+ KEY_EVENTS_LONG_PRESS_ACTIONS.get(eventKeyCode),
140
+ mLastFocusedViewId,
141
+ ReactFeatureFlags.enableKeyDownEvents ? eventKeyAction : KeyEvent.ACTION_UP,
142
+ context
143
+ );
144
+ // Update the start time for detecting the next long press event
145
+ mLastKeyDownTime = time;
123
146
  } else {
124
147
  dispatchEvent(KEY_EVENTS_ACTIONS.get(eventKeyCode), mLastFocusedViewId, eventKeyAction, context);
125
148
  }
149
+ }
150
+
151
+ // If this is key up event, reset long press detector
152
+ if ((eventKeyAction == KeyEvent.ACTION_UP) && isSelectOrDPadEvent) {
126
153
  mLastKeyDownTime = 0;
154
+ longPressEventActive = false;
127
155
  }
156
+
128
157
  }
129
158
 
130
- // Android TV: Only send key up actions, unless key down events are enabled
131
- private boolean shouldDispatchEvent(int eventKeyCode, int eventKeyAction) {
159
+ // Android TV: Only send key up actions, unless key down events are enabled or we need to send a long press event
160
+ private boolean shouldDispatchEvent(int eventKeyCode, int eventKeyAction, long time) {
132
161
  return KEY_EVENTS_ACTIONS.containsKey(eventKeyCode) && (
133
162
  (eventKeyAction == KeyEvent.ACTION_UP) ||
134
- (eventKeyAction == KeyEvent.ACTION_DOWN && ReactFeatureFlags.enableKeyDownEvents)
163
+ (eventKeyAction == KeyEvent.ACTION_DOWN && !longPressEventActive && ReactFeatureFlags.enableKeyDownEvents) ||
164
+ (eventKeyAction == KeyEvent.ACTION_DOWN && longPressEventActive && isLongPressEventTime(time))
135
165
  );
136
166
  }
137
167
 
@@ -17,6 +17,6 @@ public class ReactNativeVersion {
17
17
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
18
18
  "major", 0,
19
19
  "minor", 69,
20
- "patch", 6,
21
- "prerelease", "2");
20
+ "patch", 8,
21
+ "prerelease", "0rc");
22
22
  }