diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-06-15 21:49:03 -0500 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-06-15 21:49:03 -0500 |
commit | 2c73703d7d59bdd9a3e4b10c41e5099b8f92db1c (patch) | |
tree | d43a6d3fde9af33d1a00b8ca436cd79f4d53e6cd /android/app/src/main/java/xyz/blueskyweb/pubsq/newarchitecture/components | |
parent | 07b92a2180ca6600f09e03a85c8ca7a06d24cbfc (diff) | |
download | voidsky-2c73703d7d59bdd9a3e4b10c41e5099b8f92db1c.tar.zst |
Rename bundle-id to xyz.blueskyweb.pubsq in android
Diffstat (limited to 'android/app/src/main/java/xyz/blueskyweb/pubsq/newarchitecture/components')
-rw-r--r-- | android/app/src/main/java/xyz/blueskyweb/pubsq/newarchitecture/components/MainComponentsRegistry.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/android/app/src/main/java/xyz/blueskyweb/pubsq/newarchitecture/components/MainComponentsRegistry.java b/android/app/src/main/java/xyz/blueskyweb/pubsq/newarchitecture/components/MainComponentsRegistry.java new file mode 100644 index 000000000..a219dd5e3 --- /dev/null +++ b/android/app/src/main/java/xyz/blueskyweb/pubsq/newarchitecture/components/MainComponentsRegistry.java @@ -0,0 +1,36 @@ +package xyz.blueskyweb.pubsq.newarchitecture.components; + +import com.facebook.jni.HybridData; +import com.facebook.proguard.annotations.DoNotStrip; +import com.facebook.react.fabric.ComponentFactory; +import com.facebook.soloader.SoLoader; + +/** + * Class responsible to load the custom Fabric Components. This class has native methods and needs a + * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ + * folder for you). + * + * <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the + * `newArchEnabled` property). Is ignored otherwise. + */ +@DoNotStrip +public class MainComponentsRegistry { + static { + SoLoader.loadLibrary("fabricjni"); + } + + @DoNotStrip private final HybridData mHybridData; + + @DoNotStrip + private native HybridData initHybrid(ComponentFactory componentFactory); + + @DoNotStrip + private MainComponentsRegistry(ComponentFactory componentFactory) { + mHybridData = initHybrid(componentFactory); + } + + @DoNotStrip + public static MainComponentsRegistry register(ComponentFactory componentFactory) { + return new MainComponentsRegistry(componentFactory); + } +} |