react-native-reanimated 3.16.5 → 3.16.6
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.
- package/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp +21 -13
- package/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h +2 -0
- package/lib/module/platform-specific/jsVersion.js +1 -1
- package/lib/typescript/platform-specific/jsVersion.d.ts +1 -1
- package/package.json +1 -1
- package/src/platform-specific/jsVersion.ts +1 -1
|
@@ -27,23 +27,31 @@ ReanimatedCommitHook::~ReanimatedCommitHook() noexcept {
|
|
|
27
27
|
uiManager_->unregisterCommitHook(*this);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
void ReanimatedCommitHook::maybeInitializeLayoutAnimations(
|
|
31
|
+
SurfaceId surfaceId) {
|
|
32
|
+
auto lock = std::unique_lock<std::mutex>(mutex_);
|
|
33
|
+
if (surfaceId > currentMaxSurfaceId_) {
|
|
34
|
+
// when a new surfaceId is observed we call setMountingOverrideDelegate
|
|
35
|
+
// for all yet unseen surfaces
|
|
36
|
+
uiManager_->getShadowTreeRegistry().enumerate(
|
|
37
|
+
[this](const ShadowTree &shadowTree, bool &stop) {
|
|
38
|
+
if (shadowTree.getSurfaceId() <= currentMaxSurfaceId_) {
|
|
39
|
+
// the set function actually adds our delegate to a list, so we
|
|
40
|
+
// shouldn't invoke it twice for the same surface
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
shadowTree.getMountingCoordinator()->setMountingOverrideDelegate(
|
|
44
|
+
layoutAnimationsProxy_);
|
|
45
|
+
});
|
|
46
|
+
currentMaxSurfaceId_ = surfaceId;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
30
50
|
RootShadowNode::Unshared ReanimatedCommitHook::shadowTreeWillCommit(
|
|
31
51
|
ShadowTree const &,
|
|
32
52
|
RootShadowNode::Shared const &,
|
|
33
53
|
RootShadowNode::Unshared const &newRootShadowNode) noexcept {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
{
|
|
37
|
-
auto lock = std::unique_lock<std::mutex>(mutex_);
|
|
38
|
-
if (surfaceId > currentMaxSurfaceId_) {
|
|
39
|
-
uiManager_->getShadowTreeRegistry().enumerate(
|
|
40
|
-
[this](const ShadowTree &shadowTree, bool &stop) {
|
|
41
|
-
shadowTree.getMountingCoordinator()->setMountingOverrideDelegate(
|
|
42
|
-
layoutAnimationsProxy_);
|
|
43
|
-
});
|
|
44
|
-
currentMaxSurfaceId_ = surfaceId;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
54
|
+
maybeInitializeLayoutAnimations(newRootShadowNode->getSurfaceId());
|
|
47
55
|
|
|
48
56
|
auto reaShadowNode =
|
|
49
57
|
std::reinterpret_pointer_cast<ReanimatedCommitShadowNode>(
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* version used to build the native part of the library in runtime. Remember to
|
|
4
4
|
* keep this in sync with the version declared in `package.json`
|
|
5
5
|
*/
|
|
6
|
-
export declare const jsVersion = "3.16.
|
|
6
|
+
export declare const jsVersion = "3.16.6";
|
|
7
7
|
//# sourceMappingURL=jsVersion.d.ts.map
|
package/package.json
CHANGED