Java 类com.facebook.react.bridge.LifecycleEventListener 实例源码

项目:RNLearn_Project1    文件:ReactIntegrationTestCase.java   
protected static void initializeJavaModule(final BaseJavaModule javaModule) {
  final Semaphore semaphore = new Semaphore(0);
  UiThreadUtil.runOnUiThread(
      new Runnable() {
        @Override
        public void run() {
          javaModule.initialize();
          if (javaModule instanceof LifecycleEventListener) {
            ((LifecycleEventListener) javaModule).onHostResume();
          }
          semaphore.release();
        }
      });
  try {
    SoftAssertions.assertCondition(
        semaphore.tryAcquire(5000, TimeUnit.MILLISECONDS),
        "Timed out initializing timing module");
  } catch (InterruptedException e) {
    throw new RuntimeException(e);
  }
}
项目:RNLearn_Project1    文件:ReactIntegrationTestCase.java   
protected static void initializeJavaModule(final BaseJavaModule javaModule) {
  final Semaphore semaphore = new Semaphore(0);
  UiThreadUtil.runOnUiThread(
      new Runnable() {
        @Override
        public void run() {
          javaModule.initialize();
          if (javaModule instanceof LifecycleEventListener) {
            ((LifecycleEventListener) javaModule).onHostResume();
          }
          semaphore.release();
        }
      });
  try {
    SoftAssertions.assertCondition(
        semaphore.tryAcquire(5000, TimeUnit.MILLISECONDS),
        "Timed out initializing timing module");
  } catch (InterruptedException e) {
    throw new RuntimeException(e);
  }
}
项目:ReactNativeSignatureExample    文件:ReactIntegrationTestCase.java   
protected static void initializeJavaModule(final BaseJavaModule javaModule) {
  final Semaphore semaphore = new Semaphore(0);
  UiThreadUtil.runOnUiThread(
      new Runnable() {
        @Override
        public void run() {
          javaModule.initialize();
          if (javaModule instanceof LifecycleEventListener) {
            ((LifecycleEventListener) javaModule).onHostResume();
          }
          semaphore.release();
        }
      });
  try {
    SoftAssertions.assertCondition(
        semaphore.tryAcquire(5000, TimeUnit.MILLISECONDS),
        "Timed out initializing timing module");
  } catch (InterruptedException e) {
    throw new RuntimeException(e);
  }
}
项目:react-native-ibeacon-android    文件:ReactIntegrationTestCase.java   
protected static void initializeJavaModule(final BaseJavaModule javaModule) {
  final Semaphore semaphore = new Semaphore(0);
  UiThreadUtil.runOnUiThread(
      new Runnable() {
        @Override
        public void run() {
          javaModule.initialize();
          if (javaModule instanceof LifecycleEventListener) {
            ((LifecycleEventListener) javaModule).onHostResume();
          }
          semaphore.release();
        }
      });
  try {
    SoftAssertions.assertCondition(
        semaphore.tryAcquire(5000, TimeUnit.MILLISECONDS),
        "Timed out initializing timing module");
  } catch (InterruptedException e) {
    throw new RuntimeException(e);
  }
}
项目:react-native-box-loaders    文件:ReactIntegrationTestCase.java   
protected static void initializeJavaModule(final BaseJavaModule javaModule) {
  final Semaphore semaphore = new Semaphore(0);
  UiThreadUtil.runOnUiThread(
      new Runnable() {
        @Override
        public void run() {
          javaModule.initialize();
          if (javaModule instanceof LifecycleEventListener) {
            ((LifecycleEventListener) javaModule).onHostResume();
          }
          semaphore.release();
        }
      });
  try {
    SoftAssertions.assertCondition(
        semaphore.tryAcquire(5000, TimeUnit.MILLISECONDS),
        "Timed out initializing timing module");
  } catch (InterruptedException e) {
    throw new RuntimeException(e);
  }
}
项目:Ironman    文件:ReactIntegrationTestCase.java   
protected static void initializeJavaModule(final BaseJavaModule javaModule) {
  final Semaphore semaphore = new Semaphore(0);
  UiThreadUtil.runOnUiThread(
      new Runnable() {
        @Override
        public void run() {
          javaModule.initialize();
          if (javaModule instanceof LifecycleEventListener) {
            ((LifecycleEventListener) javaModule).onHostResume();
          }
          semaphore.release();
        }
      });
  try {
    SoftAssertions.assertCondition(
        semaphore.tryAcquire(5000, TimeUnit.MILLISECONDS),
        "Timed out initializing timing module");
  } catch (InterruptedException e) {
    throw new RuntimeException(e);
  }
}
项目:react-native-notifications    文件:ReactAppLifecycleFacade.java   
public void init(ReactContext reactContext) {
    mReactContext = reactContext;
    reactContext.addLifecycleEventListener(new LifecycleEventListener() {
        @Override
        public void onHostResume() {
            Log.d(LOGTAG, "onHostResume");
            switchToVisible();
        }

        @Override
        public void onHostPause() {
            Log.d(LOGTAG, "onHostPause");
            switchToInvisible();
        }

        @Override
        public void onHostDestroy() {
            Log.d(LOGTAG, "onHostDestroy");
            switchToInvisible();
        }
    });
}
项目:RNLearn_Project1    文件:ThemedReactContext.java   
@Override
public void addLifecycleEventListener(LifecycleEventListener listener) {
  mReactApplicationContext.addLifecycleEventListener(listener);
}
项目:RNLearn_Project1    文件:ThemedReactContext.java   
@Override
public void removeLifecycleEventListener(LifecycleEventListener listener) {
  mReactApplicationContext.removeLifecycleEventListener(listener);
}
项目:RNLearn_Project1    文件:ThemedReactContext.java   
@Override
public void addLifecycleEventListener(LifecycleEventListener listener) {
  mReactApplicationContext.addLifecycleEventListener(listener);
}
项目:RNLearn_Project1    文件:ThemedReactContext.java   
@Override
public void removeLifecycleEventListener(LifecycleEventListener listener) {
  mReactApplicationContext.removeLifecycleEventListener(listener);
}
项目:ReactNativeSignatureExample    文件:ThemedReactContext.java   
@Override
public void addLifecycleEventListener(LifecycleEventListener listener) {
  mReactApplicationContext.addLifecycleEventListener(listener);
}
项目:ReactNativeSignatureExample    文件:ThemedReactContext.java   
@Override
public void removeLifecycleEventListener(LifecycleEventListener listener) {
  mReactApplicationContext.removeLifecycleEventListener(listener);
}
项目:react-native-ibeacon-android    文件:ThemedReactContext.java   
@Override
public void addLifecycleEventListener(LifecycleEventListener listener) {
  mReactApplicationContext.addLifecycleEventListener(listener);
}
项目:react-native-ibeacon-android    文件:ThemedReactContext.java   
@Override
public void removeLifecycleEventListener(LifecycleEventListener listener) {
  mReactApplicationContext.removeLifecycleEventListener(listener);
}
项目:react-native-box-loaders    文件:ThemedReactContext.java   
@Override
public void addLifecycleEventListener(LifecycleEventListener listener) {
  mReactApplicationContext.addLifecycleEventListener(listener);
}
项目:react-native-box-loaders    文件:ThemedReactContext.java   
@Override
public void removeLifecycleEventListener(LifecycleEventListener listener) {
  mReactApplicationContext.removeLifecycleEventListener(listener);
}
项目:Ironman    文件:ThemedReactContext.java   
@Override
public void addLifecycleEventListener(LifecycleEventListener listener) {
  mReactApplicationContext.addLifecycleEventListener(listener);
}
项目:Ironman    文件:ThemedReactContext.java   
@Override
public void removeLifecycleEventListener(LifecycleEventListener listener) {
  mReactApplicationContext.removeLifecycleEventListener(listener);
}