mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
e3302eeeab
Summary: Hook up onSuccess and onFailure callbacks to LayoutAnimations. Note that in non-Fabric RN, onSuccess is not known to work in Android. I could not find any uses of onFailure and it's not documented, so for now, it is only called if the setup of the animation fails. Changelog: [Internal] Reviewed By: shergin Differential Revision: D22889352 fbshipit-source-id: 4306debb350388dd2b7a2cbfe295eb99723988e2
46 lines
1.3 KiB
C++
46 lines
1.3 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;
|
|
virtual double getProgressThroughAnimation(
|
|
AnimationKeyFrame const &keyFrame,
|
|
LayoutAnimation const *layoutAnimation,
|
|
ShadowView const &animationStateView) const override;
|
|
};
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|