mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
5bd5fcdd38
Summary: The current implementation of LayoutAnimations assumed that the "previous/old" ShadowView passed into the diff mutation didn't matter except for purposes of diffing. As it turns out, iOS components could possibly use the "old" version of props, state, etc - so we should try to keep track of the current value in the tree as much as possible. This diff accomplishes that by keeping track of the "previous" view, which the AnimationDriver will update over time. This also allows us to simplify logic around conflicting animations. I'm also adding a few additional asserts to assist in debugging. This doesn't totally eliminate all asserts hit on iOS, yet, but it does reduce the number of times the asserts are hit in StubViewTree. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D25048644 fbshipit-source-id: d00aeece5af04624d8193063be453c7ce4a6e565
42 lines
1.1 KiB
C++
42 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <react/renderer/core/EventTarget.h>
|
|
#include <react/renderer/mounting/Differentiator.h>
|
|
#include <react/renderer/mounting/MountingCoordinator.h>
|
|
#include <react/renderer/mounting/MountingOverrideDelegate.h>
|
|
#include <react/renderer/mounting/MountingTransaction.h>
|
|
#include <react/renderer/uimanager/UIManagerAnimationDelegate.h>
|
|
|
|
#include <folly/dynamic.h>
|
|
|
|
#include "LayoutAnimationKeyFrameManager.h"
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
class LayoutAnimationDriver : public LayoutAnimationKeyFrameManager {
|
|
public:
|
|
LayoutAnimationDriver(
|
|
RuntimeExecutor runtimeExecutor,
|
|
LayoutAnimationStatusDelegate *delegate)
|
|
: LayoutAnimationKeyFrameManager(runtimeExecutor, delegate) {}
|
|
|
|
virtual ~LayoutAnimationDriver() {}
|
|
|
|
protected:
|
|
virtual void animationMutationsForFrame(
|
|
SurfaceId surfaceId,
|
|
ShadowViewMutation::List &mutationsList,
|
|
uint64_t now) const override;
|
|
};
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|