Skip to content

Commit

Permalink
Remove unused UIManager lookup in NativeAnimatedNodesManager (#46565)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #46565

UIManager is initialized elsewhere in NativeAnimatedNodesManager so this is no longer required

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D62958646

fbshipit-source-id: af77ddbbc65124ed29d301340ad339d2a916f58c
  • Loading branch information
javache authored and facebook-github-bot committed Sep 18, 2024
1 parent 68e5528 commit 7f55dc0
Showing 1 changed file with 15 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.uimanager.UIManagerHelper;
import com.facebook.react.uimanager.common.UIManagerType;
import com.facebook.react.uimanager.common.ViewUtil;
import com.facebook.react.uimanager.events.Event;
import com.facebook.react.uimanager.events.EventDispatcher;
import com.facebook.react.uimanager.events.EventDispatcherListener;
Expand Down Expand Up @@ -591,36 +590,24 @@ public void run() {

@UiThread
private void handleEvent(Event event) {
if (!mEventDrivers.isEmpty()) {
// If the event has a different name in native convert it to it's JS name.
// TODO T64216139 Remove dependency of UIManagerModule when the Constants are not in Native
// anymore
if (mReactApplicationContext == null) {
return;
}
UIManager uiManager =
UIManagerHelper.getUIManager(
mReactApplicationContext,
ViewUtil.getUIManagerType(event.getViewTag(), event.getSurfaceId()));
if (uiManager == null) {
return;
}
if (mEventDrivers.isEmpty()) {
return;
}

boolean foundAtLeastOneDriver = false;
Event.EventAnimationDriverMatchSpec matchSpec = event.getEventAnimationDriverMatchSpec();
for (EventAnimationDriver driver : mEventDrivers) {
if (matchSpec.match(driver.viewTag, driver.eventName)) {
foundAtLeastOneDriver = true;
stopAnimationsForNode(driver.valueNode);
event.dispatchModern(driver);
mRunUpdateNodeList.add(driver.valueNode);
}
boolean foundAtLeastOneDriver = false;
Event.EventAnimationDriverMatchSpec matchSpec = event.getEventAnimationDriverMatchSpec();
for (EventAnimationDriver driver : mEventDrivers) {
if (matchSpec.match(driver.viewTag, driver.eventName)) {
foundAtLeastOneDriver = true;
stopAnimationsForNode(driver.valueNode);
event.dispatchModern(driver);
mRunUpdateNodeList.add(driver.valueNode);
}
}

if (foundAtLeastOneDriver) {
updateNodes(mRunUpdateNodeList);
mRunUpdateNodeList.clear();
}
if (foundAtLeastOneDriver) {
updateNodes(mRunUpdateNodeList);
mRunUpdateNodeList.clear();
}
}

Expand Down

0 comments on commit 7f55dc0

Please sign in to comment.