-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose scheduler through FabricUIManager
Summary: Allows to access `react::renderer::Scheduler` given `FabricUIManager` from Java side. Changelog: [Added] Added `FabricUIManager` binding with FBJNI Reviewed By: javache Differential Revision: D35313399 fbshipit-source-id: 54e7adcceae40368c2735ddfc8a083f87b08dc5e
- Loading branch information
1 parent
e51e19e
commit 1730949
Showing
3 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
ReactAndroid/src/main/java/com/facebook/react/fabric/jni/JFabricUIManager.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#include "JFabricUIManager.h" | ||
|
||
namespace facebook::react { | ||
|
||
Binding *JFabricUIManager::getBinding() { | ||
static const auto bindingField = | ||
javaClassStatic()->getField<Binding::javaobject>("mBinding"); | ||
|
||
return getFieldValue(bindingField)->cthis(); | ||
} | ||
} // namespace facebook::react |
25 changes: 25 additions & 0 deletions
25
ReactAndroid/src/main/java/com/facebook/react/fabric/jni/JFabricUIManager.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and 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 <fbjni/fbjni.h> | ||
#include "Binding.h" | ||
|
||
using namespace facebook::jni; | ||
|
||
namespace facebook::react { | ||
|
||
class JFabricUIManager : public JavaClass<JFabricUIManager> { | ||
public: | ||
static constexpr auto kJavaDescriptor = | ||
"Lcom/facebook/react/fabric/FabricUIManager;"; | ||
|
||
Binding *getBinding(); | ||
}; | ||
|
||
} // namespace facebook::react |