// copied from https://github.com/software-mansion/react-native-reanimated/blob/master/android/src/main/cpp/headers/AndroidScheduler.h #pragma once #include #include #include #include #include #include "Scheduler.h" namespace reanimated { using namespace facebook; class AndroidScheduler : public jni::HybridClass { public: static auto constexpr kJavaDescriptor = "Lcom/swmansion/reanimated/Scheduler;"; static jni::local_ref initHybrid(jni::alias_ref jThis); static void registerNatives(); std::shared_ptr getScheduler() { return scheduler_; } void scheduleOnUI(); private: friend HybridBase; void triggerUI(); jni::global_ref javaPart_; std::shared_ptr scheduler_; explicit AndroidScheduler(jni::alias_ref jThis); }; }