Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 63996e0

Browse files
committed
Code formatting
1 parent 61a3284 commit 63996e0

File tree

5 files changed

+151
-87
lines changed

5 files changed

+151
-87
lines changed

‎packages/react-native-reanimated/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.cpp‎

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,8 @@ void LayoutAnimationsProxy::handleRemovals(
259259
node->unflattenedParent->removeChildFromUnflattenedTree(node); //???
260260
if (node->state != MOVED) {
261261
maybeCancelAnimation(node->tag);
262-
filteredMutations.push_back(
263-
ShadowViewMutation::DeleteMutation(
264-
node->mutation.oldChildShadowView));
262+
filteredMutations.push_back(ShadowViewMutation::DeleteMutation(
263+
node->mutation.oldChildShadowView));
265264
nodeForTag_.erase(node->tag);
266265
node->state = DELETED;
267266
#ifdef LAYOUT_ANIMATIONS_LOGS
@@ -313,21 +312,19 @@ void LayoutAnimationsProxy::handleUpdatesAndEnterings(
313312
auto layoutAnimationIt = layoutAnimations_.find(tag);
314313
if (layoutAnimationIt == layoutAnimations_.end()) {
315314
if (oldShadowViewsForReparentings.contains(tag)) {
316-
filteredMutations.push_back(
317-
ShadowViewMutation::InsertMutation(
318-
mutationParent,
319-
oldShadowViewsForReparentings[tag],
320-
mutation.index));
315+
filteredMutations.push_back(ShadowViewMutation::InsertMutation(
316+
mutationParent,
317+
oldShadowViewsForReparentings[tag],
318+
mutation.index));
321319
} else {
322320
filteredMutations.push_back(mutation);
323321
}
324322
continue;
325323
}
326324

327325
auto oldView = *layoutAnimationIt->second.currentView;
328-
filteredMutations.push_back(
329-
ShadowViewMutation::InsertMutation(
330-
mutationParent, oldView, mutation.index));
326+
filteredMutations.push_back(ShadowViewMutation::InsertMutation(
327+
mutationParent, oldView, mutation.index));
331328
if (movedViews.contains(tag)) {
332329
layoutAnimationIt->second.parentTag = movedViews.at(tag);
333330
}
@@ -349,9 +346,8 @@ void LayoutAnimationsProxy::handleUpdatesAndEnterings(
349346
std::shared_ptr<ShadowView> newView =
350347
cloneViewWithoutOpacity(mutation, propsParserContext);
351348

352-
filteredMutations.push_back(
353-
ShadowViewMutation::UpdateMutation(
354-
mutation.newChildShadowView, *newView, mutationParent));
349+
filteredMutations.push_back(ShadowViewMutation::UpdateMutation(
350+
mutation.newChildShadowView, *newView, mutationParent));
355351
break;
356352
}
357353

@@ -442,9 +438,8 @@ void LayoutAnimationsProxy::addOngoingAnimations(
442438
newView->props = updateValues.newProps;
443439
updateLayoutMetrics(newView->layoutMetrics, updateValues.frame);
444440

445-
mutations.push_back(
446-
ShadowViewMutation::UpdateMutation(
447-
*layoutAnimation.currentView, *newView, layoutAnimation.parentTag));
441+
mutations.push_back(ShadowViewMutation::UpdateMutation(
442+
*layoutAnimation.currentView, *newView, layoutAnimation.parentTag));
448443
layoutAnimation.currentView = newView;
449444
}
450445
updateMap.clear();
@@ -569,9 +564,8 @@ bool LayoutAnimationsProxy::startAnimationsRecursively(
569564
#ifdef LAYOUT_ANIMATIONS_LOGS
570565
LOG(INFO) << "delete " << subNode->tag << std::endl;
571566
#endif
572-
mutations.push_back(
573-
ShadowViewMutation::DeleteMutation(
574-
subNode->mutation.oldChildShadowView));
567+
mutations.push_back(ShadowViewMutation::DeleteMutation(
568+
subNode->mutation.oldChildShadowView));
575569
} else {
576570
subNode->state = WAITING;
577571
}

‎packages/react-native-reanimated/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h‎

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ struct LayoutAnimation {
3333
LayoutAnimation &operator=(const LayoutAnimation &other) = default;
3434
};
3535

36-
struct LayoutAnimationsProxy : public MountingOverrideDelegate,
37-
public std::enable_shared_from_this<LayoutAnimationsProxy> {
36+
struct LayoutAnimationsProxy
37+
: public MountingOverrideDelegate,
38+
public std::enable_shared_from_this<LayoutAnimationsProxy> {
3839
mutable std::unordered_map<Tag, std::shared_ptr<Node>> nodeForTag_;
3940
mutable std::unordered_map<Tag, LayoutAnimation> layoutAnimations_;
4041
mutable std::recursive_mutex mutex;
@@ -89,35 +90,49 @@ struct LayoutAnimationsProxy : public MountingOverrideDelegate,
8990
{
9091
}
9192

92-
void startEnteringAnimation(const int tag, ShadowViewMutation &mutation) const;
93+
void startEnteringAnimation(const int tag, ShadowViewMutation &mutation)
94+
const;
9395
void startExitingAnimation(const int tag, ShadowViewMutation &mutation) const;
94-
void startLayoutAnimation(const int tag, const ShadowViewMutation &mutation) const;
96+
void startLayoutAnimation(const int tag, const ShadowViewMutation &mutation)
97+
const;
9598

96-
void transferConfigFromNativeID(const std::string nativeId, const int tag) const;
97-
std::optional<SurfaceId> progressLayoutAnimation(int tag, const jsi::Object &newStyle);
99+
void transferConfigFromNativeID(const std::string nativeId, const int tag)
100+
const;
101+
std::optional<SurfaceId> progressLayoutAnimation(
102+
int tag,
103+
const jsi::Object &newStyle);
98104
std::optional<SurfaceId> endLayoutAnimation(int tag, bool shouldRemove) const;
99105
void maybeCancelAnimation(const int tag) const;
100106

101107
void parseRemoveMutations(
102108
std::unordered_map<Tag, Tag> &movedViews,
103109
ShadowViewMutationList &mutations,
104110
std::vector<std::shared_ptr<MutationNode>> &roots) const;
105-
void handleRemovals(ShadowViewMutationList &filteredMutations, std::vector<std::shared_ptr<MutationNode>> &roots)
106-
const;
111+
void handleRemovals(
112+
ShadowViewMutationList &filteredMutations,
113+
std::vector<std::shared_ptr<MutationNode>> &roots) const;
107114

108115
void handleUpdatesAndEnterings(
109116
ShadowViewMutationList &filteredMutations,
110117
const std::unordered_map<Tag, Tag> &movedViews,
111118
ShadowViewMutationList &mutations,
112119
const PropsParserContext &propsParserContext,
113120
SurfaceId surfaceId) const;
114-
void addOngoingAnimations(SurfaceId surfaceId, ShadowViewMutationList &mutations) const;
115-
void updateOngoingAnimationTarget(const int tag, const ShadowViewMutation &mutation) const;
121+
void addOngoingAnimations(
122+
SurfaceId surfaceId,
123+
ShadowViewMutationList &mutations) const;
124+
void updateOngoingAnimationTarget(
125+
const int tag,
126+
const ShadowViewMutation &mutation) const;
116127
std::shared_ptr<ShadowView> cloneViewWithoutOpacity(
117128
facebook::react::ShadowViewMutation &mutation,
118129
const PropsParserContext &propsParserContext) const;
119-
void maybeRestoreOpacity(LayoutAnimation &layoutAnimation, const jsi::Object &newStyle) const;
120-
void maybeUpdateWindowDimensions(facebook::react::ShadowViewMutation &mutation, SurfaceId surfaceId) const;
130+
void maybeRestoreOpacity(
131+
LayoutAnimation &layoutAnimation,
132+
const jsi::Object &newStyle) const;
133+
void maybeUpdateWindowDimensions(
134+
facebook::react::ShadowViewMutation &mutation,
135+
SurfaceId surfaceId) const;
121136
void createLayoutAnimation(
122137
const ShadowViewMutation &mutation,
123138
ShadowView &oldView,
@@ -126,23 +141,29 @@ struct LayoutAnimationsProxy : public MountingOverrideDelegate,
126141

127142
void updateIndexForMutation(ShadowViewMutation &mutation) const;
128143

129-
void removeRecursively(std::shared_ptr<MutationNode> node, ShadowViewMutationList &mutations) const;
144+
void removeRecursively(
145+
std::shared_ptr<MutationNode> node,
146+
ShadowViewMutationList &mutations) const;
130147
bool startAnimationsRecursively(
131148
std::shared_ptr<MutationNode> node,
132149
const bool shouldRemoveSubviewsWithoutAnimations,
133150
const bool shouldAnimate,
134151
const bool isScreenPop,
135152
ShadowViewMutationList &mutations) const;
136-
void endAnimationsRecursively(std::shared_ptr<MutationNode> node, ShadowViewMutationList &mutations) const;
153+
void endAnimationsRecursively(
154+
std::shared_ptr<MutationNode> node,
155+
ShadowViewMutationList &mutations) const;
137156
void maybeDropAncestors(
138157
std::shared_ptr<Node> node,
139158
std::shared_ptr<MutationNode> child,
140159
ShadowViewMutationList &cleanupMutations) const;
141160

142-
const ComponentDescriptor &getComponentDescriptorForShadowView(const ShadowView &shadowView) const;
161+
const ComponentDescriptor &getComponentDescriptorForShadowView(
162+
const ShadowView &shadowView) const;
143163
#ifdef ANDROID
144164
void restoreOpacityInCaseOfFlakyEnteringAnimation(SurfaceId surfaceId) const;
145-
const ShadowNode *findInShadowTreeByTag(const ShadowNode &node, Tag tag) const;
165+
const ShadowNode *findInShadowTreeByTag(const ShadowNode &node, Tag tag)
166+
const;
146167
#endif // ANDROID
147168
// MountingOverrideDelegate
148169

‎packages/react-native-reanimated/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,15 @@ ReanimatedModuleProxy::ReanimatedModuleProxy(
5656
staticPropsRegistry_(std::make_shared<StaticPropsRegistry>()),
5757
updatesRegistryManager_(
5858
std::make_shared<UpdatesRegistryManager>(staticPropsRegistry_)),
59-
viewStylesRepository_(
60-
std::make_shared<ViewStylesRepository>(
61-
staticPropsRegistry_,
62-
animatedPropsRegistry_)),
59+
viewStylesRepository_(std::make_shared<ViewStylesRepository>(
60+
staticPropsRegistry_,
61+
animatedPropsRegistry_)),
6362
cssAnimationKeyframesRegistry_(
6463
std::make_shared<CSSKeyframesRegistry>(viewStylesRepository_)),
6564
cssAnimationsRegistry_(std::make_shared<CSSAnimationsRegistry>()),
66-
cssTransitionsRegistry_(
67-
std::make_shared<CSSTransitionsRegistry>(
68-
staticPropsRegistry_,
69-
getAnimationTimestamp_)),
65+
cssTransitionsRegistry_(std::make_shared<CSSTransitionsRegistry>(
66+
staticPropsRegistry_,
67+
getAnimationTimestamp_)),
7068
synchronouslyUpdateUIPropsFunction_(
7169
platformDepMethodsHolder.synchronouslyUpdateUIPropsFunction),
7270
#ifdef ANDROID

‎packages/react-native-reanimated/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h‎

Lines changed: 67 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ namespace reanimated {
4343
using namespace facebook;
4444
using namespace css;
4545

46-
using UpdatesBatch = std::vector<std::pair<std::shared_ptr<const ShadowNode>, folly::dynamic>>;
46+
using UpdatesBatch =
47+
std::vector<std::pair<std::shared_ptr<const ShadowNode>, folly::dynamic>>;
4748

48-
class ReanimatedModuleProxy : public ReanimatedModuleProxySpec,
49-
public std::enable_shared_from_this<ReanimatedModuleProxy> {
49+
class ReanimatedModuleProxy
50+
: public ReanimatedModuleProxySpec,
51+
public std::enable_shared_from_this<ReanimatedModuleProxy> {
5052
public:
5153
ReanimatedModuleProxy(
5254
const std::shared_ptr<WorkletsModuleProxy> &workletsModuleProxy,
@@ -67,31 +69,46 @@ class ReanimatedModuleProxy : public ReanimatedModuleProxySpec,
6769
const jsi::Value &worklet,
6870
const jsi::Value &eventName,
6971
const jsi::Value &emitterReactTag) override;
70-
void unregisterEventHandler(jsi::Runtime &rt, const jsi::Value &registrationId) override;
72+
void unregisterEventHandler(
73+
jsi::Runtime &rt,
74+
const jsi::Value &registrationId) override;
7175

7276
jsi::Value getViewProp(
7377
jsi::Runtime &rt,
7478
const jsi::Value &shadowNodeWrapper,
7579
const jsi::Value &propName,
7680
const jsi::Value &callback) override;
7781

78-
jsi::Value getStaticFeatureFlag(jsi::Runtime &rt, const jsi::Value &name) override;
79-
jsi::Value setDynamicFeatureFlag(jsi::Runtime &rt, const jsi::Value &name, const jsi::Value &value) override;
82+
jsi::Value getStaticFeatureFlag(jsi::Runtime &rt, const jsi::Value &name)
83+
override;
84+
jsi::Value setDynamicFeatureFlag(
85+
jsi::Runtime &rt,
86+
const jsi::Value &name,
87+
const jsi::Value &value) override;
8088

81-
jsi::Value configureLayoutAnimationBatch(jsi::Runtime &rt, const jsi::Value &layoutAnimationsBatch) override;
82-
void setShouldAnimateExiting(jsi::Runtime &rt, const jsi::Value &viewTag, const jsi::Value &shouldAnimate) override;
89+
jsi::Value configureLayoutAnimationBatch(
90+
jsi::Runtime &rt,
91+
const jsi::Value &layoutAnimationsBatch) override;
92+
void setShouldAnimateExiting(
93+
jsi::Runtime &rt,
94+
const jsi::Value &viewTag,
95+
const jsi::Value &shouldAnimate) override;
8396

8497
void onRender(double timestampMs);
8598

86-
bool isAnyHandlerWaitingForEvent(const std::string &eventName, const int emitterReactTag);
99+
bool isAnyHandlerWaitingForEvent(
100+
const std::string &eventName,
101+
const int emitterReactTag);
87102

88103
void maybeRequestRender();
89104

90-
bool
91-
handleEvent(const std::string &eventName, const int emitterReactTag, const jsi::Value &payload, double currentTime);
105+
bool handleEvent(
106+
const std::string &eventName,
107+
const int emitterReactTag,
108+
const jsi::Value &payload,
109+
double currentTime);
92110

93-
inline std::shared_ptr<JSLogger> getJSLogger() const
94-
{
111+
inline std::shared_ptr<JSLogger> getJSLogger() const {
95112
return jsLogger_;
96113
}
97114

@@ -102,26 +119,43 @@ class ReanimatedModuleProxy : public ReanimatedModuleProxySpec,
102119

103120
void performOperations();
104121

105-
void setViewStyle(jsi::Runtime &rt, const jsi::Value &viewTag, const jsi::Value &viewStyle) override;
122+
void setViewStyle(
123+
jsi::Runtime &rt,
124+
const jsi::Value &viewTag,
125+
const jsi::Value &viewStyle) override;
106126

107-
void markNodeAsRemovable(jsi::Runtime &rt, const jsi::Value &shadowNodeWrapper) override;
108-
void unmarkNodeAsRemovable(jsi::Runtime &rt, const jsi::Value &viewTag) override;
127+
void markNodeAsRemovable(
128+
jsi::Runtime &rt,
129+
const jsi::Value &shadowNodeWrapper) override;
130+
void unmarkNodeAsRemovable(jsi::Runtime &rt, const jsi::Value &viewTag)
131+
override;
109132

110133
void registerCSSKeyframes(
111134
jsi::Runtime &rt,
112135
const jsi::Value &animationName,
113136
const jsi::Value &viewName,
114137
const jsi::Value &keyframesConfig) override;
115-
void unregisterCSSKeyframes(jsi::Runtime &rt, const jsi::Value &animationName, const jsi::Value &viewName) override;
138+
void unregisterCSSKeyframes(
139+
jsi::Runtime &rt,
140+
const jsi::Value &animationName,
141+
const jsi::Value &viewName) override;
116142

117-
void applyCSSAnimations(jsi::Runtime &rt, const jsi::Value &shadowNodeWrapper, const jsi::Value &animationUpdates)
118-
override;
143+
void applyCSSAnimations(
144+
jsi::Runtime &rt,
145+
const jsi::Value &shadowNodeWrapper,
146+
const jsi::Value &animationUpdates) override;
119147
void unregisterCSSAnimations(const jsi::Value &viewTag) override;
120148

121-
void registerCSSTransition(jsi::Runtime &rt, const jsi::Value &shadowNodeWrapper, const jsi::Value &transitionConfig)
149+
void registerCSSTransition(
150+
jsi::Runtime &rt,
151+
const jsi::Value &shadowNodeWrapper,
152+
const jsi::Value &transitionConfig) override;
153+
void updateCSSTransition(
154+
jsi::Runtime &rt,
155+
const jsi::Value &viewTag,
156+
const jsi::Value &configUpdates) override;
157+
void unregisterCSSTransition(jsi::Runtime &rt, const jsi::Value &viewTag)
122158
override;
123-
void updateCSSTransition(jsi::Runtime &rt, const jsi::Value &viewTag, const jsi::Value &configUpdates) override;
124-
void unregisterCSSTransition(jsi::Runtime &rt, const jsi::Value &viewTag) override;
125159

126160
void cssLoopCallback(const double /*timestampMs*/);
127161

@@ -131,7 +165,10 @@ class ReanimatedModuleProxy : public ReanimatedModuleProxySpec,
131165
const jsi::Value &commandNameValue,
132166
const jsi::Value &argsValue);
133167

134-
jsi::String obtainProp(jsi::Runtime &rt, const jsi::Value &shadowNodeWrapper, const jsi::Value &propName);
168+
jsi::String obtainProp(
169+
jsi::Runtime &rt,
170+
const jsi::Value &shadowNodeWrapper,
171+
const jsi::Value &propName);
135172

136173
jsi::Value measure(jsi::Runtime &rt, const jsi::Value &shadowNodeValue);
137174

@@ -159,20 +196,20 @@ class ReanimatedModuleProxy : public ReanimatedModuleProxySpec,
159196
const jsi::Value &keyboardEventContainer,
160197
const jsi::Value &isStatusBarTranslucent,
161198
const jsi::Value &isNavigationBarTranslucent) override;
162-
void unsubscribeFromKeyboardEvents(jsi::Runtime &rt, const jsi::Value &listenerId) override;
199+
void unsubscribeFromKeyboardEvents(
200+
jsi::Runtime &rt,
201+
const jsi::Value &listenerId) override;
163202

164-
inline LayoutAnimationsManager &layoutAnimationsManager()
165-
{
203+
inline LayoutAnimationsManager &layoutAnimationsManager() {
166204
return *layoutAnimationsManager_;
167205
}
168206

169-
[[nodiscard]] inline bool isReducedMotion() const
170-
{
207+
[[nodiscard]] inline bool isReducedMotion() const {
171208
return isReducedMotion_;
172209
}
173210

174-
[[nodiscard]] inline std::shared_ptr<WorkletsModuleProxy>getWorkletsModuleProxy() const
175-
{
211+
[[nodiscard]] inline std::shared_ptr<WorkletsModuleProxy>
212+
getWorkletsModuleProxy() const{
176213
return workletsModuleProxy_;
177214
}
178215

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /