MCPcopy Create free account
hub / github.com/OneBitCodeBlog/onebitlife / initHybrid

Method initHybrid

android/app/src/main/jni/MainComponentsRegistry.cpp:29–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29jni::local_ref<MainComponentsRegistry::jhybriddata>
30MainComponentsRegistry::initHybrid(
31 jni::alias_ref<jclass>,
32 ComponentFactory *delegate) {
33 auto instance = makeCxxInstance(delegate);
34
35 auto buildRegistryFunction =
36 [](EventDispatcher::Weak const &eventDispatcher,
37 ContextContainer::Shared const &contextContainer)
38 -> ComponentDescriptorRegistry::Shared {
39 auto registry = MainComponentsRegistry::sharedProviderRegistry()
40 ->createComponentDescriptorRegistry(
41 {eventDispatcher, contextContainer});
42
43 auto mutableRegistry =
44 std::const_pointer_cast<ComponentDescriptorRegistry>(registry);
45
46 mutableRegistry->setFallbackComponentDescriptor(
47 std::make_shared<UnimplementedNativeViewComponentDescriptor>(
48 ComponentDescriptorParameters{
49 eventDispatcher, contextContainer, nullptr}));
50
51 return registry;
52 };
53
54 delegate->buildRegistryFunction = buildRegistryFunction;
55 return instance;
56}
57
58void MainComponentsRegistry::registerNatives() {
59 registerHybrid({

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected