本文整理匯總了Java中com.facebook.react.bridge.NativeModule類的典型用法代碼示例。如果您正苦於以下問題:Java NativeModule類的具體用法?Java NativeModule怎麽用?Java NativeModule使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
NativeModule類屬於com.facebook.react.bridge包,在下文中一共展示了NativeModule類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: create
import com.facebook.react.bridge.NativeModule; //導入依賴的package包/類
private NativeModule create() {
SoftAssertions.assertCondition(mModule == null, "Creating an already created module.");
ReactMarker.logMarker(CREATE_MODULE_START, mName);
SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "createModule")
.arg("name", mName)
.flush();
NativeModule module = assertNotNull(mProvider).get();
mProvider = null;
if (mInitializeNeeded) {
doInitialize(module);
mInitializeNeeded = false;
}
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
ReactMarker.logMarker(CREATE_MODULE_END);
return module;
}
示例2: createNativeModules
import com.facebook.react.bridge.NativeModule; //導入依賴的package包/類
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext catalystApplicationContext) {
return Arrays.<NativeModule>asList(
// Core list
new AndroidInfoModule(),
new ExceptionsManagerModule(reactInstanceManager.getDevSupportManager()),
new AppStateModule(catalystApplicationContext),
new Timing(catalystApplicationContext, reactInstanceManager.getDevSupportManager()),
new UIManagerStubModule(catalystApplicationContext),
new SourceCodeModule(catalystApplicationContext),
new JSCHeapCapture(catalystApplicationContext),
// Main list
new AsyncStorageModule(catalystApplicationContext),
new IntentModule(catalystApplicationContext),
new LocationModule(catalystApplicationContext),
new NetworkingModule(catalystApplicationContext),
new NetInfoModule(catalystApplicationContext),
new VibrationModule(catalystApplicationContext),
new WebSocketModule(catalystApplicationContext),
new ThreadSelfModule(catalystApplicationContext)
);
}
示例3: createNativeModules
import com.facebook.react.bridge.NativeModule; //導入依賴的package包/類
/**
* {@inheritDoc}
*/
@Override
public List<NativeModule> createNativeModules(
ReactApplicationContext reactContext,
ReactInstanceManager reactInstanceManager) {
final Map<String, NativeModule> moduleMap = new HashMap<>();
for (ReactPackage reactPackage: mChildReactPackages) {
List<NativeModule> nativeModules;
if (reactPackage instanceof ReactInstancePackage) {
ReactInstancePackage reactInstancePackage = (ReactInstancePackage) reactPackage;
nativeModules = reactInstancePackage.createNativeModules(
reactContext,
reactInstanceManager);
} else {
nativeModules = reactPackage.createNativeModules(reactContext);
}
for (NativeModule nativeModule: nativeModules) {
moduleMap.put(nativeModule.getName(), nativeModule);
}
}
return new ArrayList(moduleMap.values());
}
示例4: createNativeModules
import com.facebook.react.bridge.NativeModule; //導入依賴的package包/類
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new RNSweetAlertModule(reactContext));
return modules;
}
示例5: createNativeModules
import com.facebook.react.bridge.NativeModule; //導入依賴的package包/類
@Override
public List<NativeModule> createNativeModules(
ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new MusicPlayerModule(reactContext));
return modules;
}
示例6: createNativeModules
import com.facebook.react.bridge.NativeModule; //導入依賴的package包/類
@Override
public List<NativeModule> createNativeModules(
ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new WebRTCModule(reactContext));
return modules;
}
示例7: createNativeModules
import com.facebook.react.bridge.NativeModule; //導入依賴的package包/類
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactApplicationContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new RNSpeechToText(reactApplicationContext));
return modules;
}
示例8: createNativeModules
import com.facebook.react.bridge.NativeModule; //導入依賴的package包/類
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new DownloadFileManager(reactContext));
return modules;
}
示例9: ModuleHolder
import com.facebook.react.bridge.NativeModule; //導入依賴的package包/類
public ModuleHolder(NativeModule nativeModule) {
mName = nativeModule.getName();
mCanOverrideExistingModule = nativeModule.canOverrideExistingModule();
mSupportsWebWorkers = nativeModule.supportsWebWorkers();
mHasConstants = true;
mModule = nativeModule;
}
示例10: createNativeModules
import com.facebook.react.bridge.NativeModule; //導入依賴的package包/類
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactApplicationContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new NfcManager(reactApplicationContext));
return modules;
}
示例11: createNativeModules
import com.facebook.react.bridge.NativeModule; //導入依賴的package包/類
/**
* @param reactContext react application context that can be used to create modules
* @return list of native modules to register with the newly created catalyst instance
*/
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new NfcReactNativeSimpleModule(reactContext));
return modules;
}
示例12: createNativeModules
import com.facebook.react.bridge.NativeModule; //導入依賴的package包/類
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new SystemSetting(reactContext));
return modules;
}
示例13: createNativeModules
import com.facebook.react.bridge.NativeModule; //導入依賴的package包/類
@Override
public List<NativeModule> createNativeModules(
ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new BackgroundTaskModule(reactContext));
return modules;
}
示例14: createNativeModules
import com.facebook.react.bridge.NativeModule; //導入依賴的package包/類
@Override
public List<NativeModule> createNativeModules(
ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new SomeExampleModule(reactContext));
return modules;
}
示例15: getJavaModules
import com.facebook.react.bridge.NativeModule; //導入依賴的package包/類
Collection<JavaModuleWrapper> getJavaModules(
JSInstance jsInstance) {
ArrayList<JavaModuleWrapper> javaModules = new ArrayList<>();
for (Map.Entry<Class<? extends NativeModule>, ModuleHolder> entry : mModules.entrySet()) {
Class<?> type = entry.getKey();
if (!CxxModuleWrapper.class.isAssignableFrom(type)) {
javaModules.add(new JavaModuleWrapper(jsInstance, entry.getValue()));
}
}
return javaModules;
}