-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: android files incorrect app name, bumped some packages * chore: turned off newArch on android, change reanimated version * chore: android new arch files formatting fixed
- Loading branch information
Showing
12 changed files
with
77 additions
and
54 deletions.
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
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
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
45 changes: 11 additions & 34 deletions
45
example/android/app/src/main/jni/MainApplicationModuleProvider.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 |
---|---|---|
@@ -1,38 +1,15 @@ | ||
#include "MainApplicationTurboModuleManagerDelegate.h" | ||
#include "MainApplicationModuleProvider.h" | ||
#pragma once | ||
|
||
#include <memory> | ||
#include <string> | ||
#include <ReactCommon/JavaTurboModule.h> | ||
|
||
namespace facebook { | ||
namespace react { | ||
jni::local_ref<MainApplicationTurboModuleManagerDelegate::jhybriddata> | ||
MainApplicationTurboModuleManagerDelegate::initHybrid( | ||
jni::alias_ref<jhybridobject>) { | ||
return makeCxxInstance(); | ||
} | ||
void MainApplicationTurboModuleManagerDelegate::registerNatives() { | ||
registerHybrid({ | ||
makeNativeMethod( | ||
"initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid), | ||
makeNativeMethod( | ||
"canCreateTurboModule", | ||
MainApplicationTurboModuleManagerDelegate::canCreateTurboModule), | ||
}); | ||
} | ||
std::shared_ptr<TurboModule> | ||
MainApplicationTurboModuleManagerDelegate::getTurboModule( | ||
const std::string name, | ||
const std::shared_ptr<CallInvoker> jsInvoker) { | ||
// Not implemented yet: provide pure-C++ NativeModules here. | ||
return nullptr; | ||
} | ||
std::shared_ptr<TurboModule> | ||
MainApplicationTurboModuleManagerDelegate::getTurboModule( | ||
const std::string name, | ||
const JavaTurboModule::InitParams ¶ms) { | ||
return MainApplicationModuleProvider(name, params); | ||
} | ||
bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule( | ||
std::string name) { | ||
return getTurboModule(name, nullptr) != nullptr || | ||
getTurboModule(name, {.moduleName = name}) != nullptr; | ||
} | ||
|
||
std::shared_ptr<TurboModule> MainApplicationModuleProvider( | ||
const std::string moduleName, | ||
const JavaTurboModule::InitParams ¶ms); | ||
|
||
} // namespace react | ||
} // namespace facebook |
41 changes: 41 additions & 0 deletions
41
example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.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,41 @@ | ||
#include "MainApplicationTurboModuleManagerDelegate.h" | ||
#include "MainApplicationModuleProvider.h" | ||
|
||
namespace facebook { | ||
namespace react { | ||
|
||
jni::local_ref<MainApplicationTurboModuleManagerDelegate::jhybriddata> | ||
MainApplicationTurboModuleManagerDelegate::initHybrid( | ||
jni::alias_ref<jhybridobject>) { | ||
return makeCxxInstance(); | ||
} | ||
void MainApplicationTurboModuleManagerDelegate::registerNatives() { | ||
registerHybrid({ | ||
makeNativeMethod( | ||
"initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid), | ||
makeNativeMethod( | ||
"canCreateTurboModule", | ||
MainApplicationTurboModuleManagerDelegate::canCreateTurboModule), | ||
}); | ||
} | ||
std::shared_ptr<TurboModule> | ||
MainApplicationTurboModuleManagerDelegate::getTurboModule( | ||
const std::string name, | ||
const std::shared_ptr<CallInvoker> jsInvoker) { | ||
// Not implemented yet: provide pure-C++ NativeModules here. | ||
return nullptr; | ||
} | ||
std::shared_ptr<TurboModule> | ||
MainApplicationTurboModuleManagerDelegate::getTurboModule( | ||
const std::string name, | ||
const JavaTurboModule::InitParams ¶ms) { | ||
return MainApplicationModuleProvider(name, params); | ||
} | ||
bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule( | ||
std::string name) { | ||
return getTurboModule(name, nullptr) != nullptr || | ||
getTurboModule(name, {.moduleName = name}) != nullptr; | ||
} | ||
|
||
} // namespace react | ||
} // namespace facebook |
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
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
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
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
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
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
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