Java Code Examples for com.facebook.react.bridge.JSApplicationCausedNativeException

The following are top voted examples for showing how to use com.facebook.react.bridge.JSApplicationCausedNativeException. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: RNLearn_Project1   File: AnimationsDebugModule.java   View source code 6 votes vote down vote up
@ReactMethod
public void startRecordingFps() {
  if (mCatalystSettings == null ||
      !mCatalystSettings.isAnimationFpsDebugEnabled()) {
    return;
  }

  if (mFrameCallback != null) {
    throw new JSApplicationCausedNativeException("Already recording FPS!");
  }

  mFrameCallback = new FpsDebugFrameCallback(
                        ChoreographerCompat.getInstance(),
                        getReactApplicationContext());
  mFrameCallback.startAndRecordFpsAtEachFrame();
}
 
Example 2
Project: RNLearn_Project1   File: DivisionAnimatedNode.java   View source code 6 votes vote down vote up
@Override
public void update() {
  for (int i = 0; i < mInputNodes.length; i++) {
    AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNodes[i]);
    if (animatedNode != null && animatedNode instanceof ValueAnimatedNode) {
      double value = ((ValueAnimatedNode) animatedNode).getValue();
      if (i == 0) {
        mValue = value;
        continue;
      }
      if (value == 0) {
        throw new JSApplicationCausedNativeException("Detected a division by zero in " +
          "Animated.divide node");
      }
      mValue /= value;
    } else {
      throw new JSApplicationCausedNativeException("Illegal node ID set as an input for " +
        "Animated.divide node");
    }
  }
}
 
Example 3
Project: RNLearn_Project1   File: AnimationsDebugModule.java   View source code 6 votes vote down vote up
@ReactMethod
public void startRecordingFps() {
  if (mCatalystSettings == null ||
      !mCatalystSettings.isAnimationFpsDebugEnabled()) {
    return;
  }

  if (mFrameCallback != null) {
    throw new JSApplicationCausedNativeException("Already recording FPS!");
  }

  mFrameCallback = new FpsDebugFrameCallback(
                        ChoreographerCompat.getInstance(),
                        getReactApplicationContext());
  mFrameCallback.startAndRecordFpsAtEachFrame();
}
 
Example 4
Project: RNLearn_Project1   File: DivisionAnimatedNode.java   View source code 6 votes vote down vote up
@Override
public void update() {
  for (int i = 0; i < mInputNodes.length; i++) {
    AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNodes[i]);
    if (animatedNode != null && animatedNode instanceof ValueAnimatedNode) {
      double value = ((ValueAnimatedNode) animatedNode).getValue();
      if (i == 0) {
        mValue = value;
        continue;
      }
      if (value == 0) {
        throw new JSApplicationCausedNativeException("Detected a division by zero in " +
          "Animated.divide node");
      }
      mValue /= value;
    } else {
      throw new JSApplicationCausedNativeException("Illegal node ID set as an input for " +
        "Animated.divide node");
    }
  }
}
 
Example 5
Project: ReactNativeSignatureExample   File: AnimationsDebugModule.java   View source code 6 votes vote down vote up
@ReactMethod
public void startRecordingFps() {
  if (mCatalystSettings == null ||
      !mCatalystSettings.isAnimationFpsDebugEnabled()) {
    return;
  }

  if (mFrameCallback != null) {
    throw new JSApplicationCausedNativeException("Already recording FPS!");
  }
  checkAPILevel();

  mFrameCallback = new FpsDebugFrameCallback(
                        Choreographer.getInstance(),
                        getReactApplicationContext());
  mFrameCallback.startAndRecordFpsAtEachFrame();
}
 
Example 6
Project: react-native-ibeacon-android   File: AnimationsDebugModule.java   View source code 6 votes vote down vote up
@ReactMethod
public void startRecordingFps() {
  if (mCatalystSettings == null ||
      !mCatalystSettings.isAnimationFpsDebugEnabled()) {
    return;
  }

  if (mFrameCallback != null) {
    throw new JSApplicationCausedNativeException("Already recording FPS!");
  }
  checkAPILevel();

  mFrameCallback = new FpsDebugFrameCallback(
                        Choreographer.getInstance(),
                        getReactApplicationContext());
  mFrameCallback.startAndRecordFpsAtEachFrame();
}
 
Example 7
Project: react-native-box-loaders   File: AnimationsDebugModule.java   View source code 6 votes vote down vote up
@ReactMethod
public void startRecordingFps() {
  if (mCatalystSettings == null ||
      !mCatalystSettings.isAnimationFpsDebugEnabled()) {
    return;
  }

  if (mFrameCallback != null) {
    throw new JSApplicationCausedNativeException("Already recording FPS!");
  }
  checkAPILevel();

  mFrameCallback = new FpsDebugFrameCallback(
                        Choreographer.getInstance(),
                        getReactApplicationContext());
  mFrameCallback.startAndRecordFpsAtEachFrame();
}
 
Example 8
Project: Ironman   File: AnimationsDebugModule.java   View source code 6 votes vote down vote up
@ReactMethod
public void startRecordingFps() {
  if (mCatalystSettings == null ||
      !mCatalystSettings.isAnimationFpsDebugEnabled()) {
    return;
  }

  if (mFrameCallback != null) {
    throw new JSApplicationCausedNativeException("Already recording FPS!");
  }
  checkAPILevel();

  mFrameCallback = new FpsDebugFrameCallback(
                        Choreographer.getInstance(),
                        getReactApplicationContext());
  mFrameCallback.startAndRecordFpsAtEachFrame();
}
 
Example 9
Project: Ironman   File: DivisionAnimatedNode.java   View source code 6 votes vote down vote up
@Override
public void update() {
  for (int i = 0; i < mInputNodes.length; i++) {
    AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNodes[i]);
    if (animatedNode != null && animatedNode instanceof ValueAnimatedNode) {
      double value = ((ValueAnimatedNode) animatedNode).mValue;
      if (i == 0) {
        mValue = value;
        continue;
      }
      if (value == 0) {
        throw new JSApplicationCausedNativeException("Detected a division by zero in " +
          "Animated.divide node");
      }
      mValue /= value;
    } else {
      throw new JSApplicationCausedNativeException("Illegal node ID set as an input for " +
        "Animated.divide node");
    }
  }
}
 
Example 10
Project: RNLearn_Project1   File: DebugComponentOwnershipModule.java   View source code 5 votes vote down vote up
@ReactMethod
public synchronized void receiveOwnershipHierarchy(
    int requestId,
    int tag,
    @Nullable ReadableArray owners) {
  OwnerHierarchyCallback callback = mRequestIdToCallback.get(requestId);
  if (callback == null) {
    throw new JSApplicationCausedNativeException(
        "Got receiveOwnershipHierarchy for invalid request id: " + requestId);
  }
  mRequestIdToCallback.delete(requestId);
  callback.onOwnerHierarchyLoaded(tag, owners);
}
 
Example 11
Project: RNLearn_Project1   File: MultiplicationAnimatedNode.java   View source code 5 votes vote down vote up
@Override
public void update() {
  mValue = 1;
  for (int i = 0; i < mInputNodes.length; i++) {
    AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNodes[i]);
    if (animatedNode != null && animatedNode instanceof ValueAnimatedNode) {
      mValue *= ((ValueAnimatedNode) animatedNode).getValue();
    } else {
      throw new JSApplicationCausedNativeException("Illegal node ID set as an input for " +
        "Animated.multiply node");
    }
  }
}
 
Example 12
Project: RNLearn_Project1   File: ModulusAnimatedNode.java   View source code 5 votes vote down vote up
@Override
public void update() {
  AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNode);
  if (animatedNode != null && animatedNode instanceof ValueAnimatedNode) {
    mValue = ((ValueAnimatedNode) animatedNode).mValue % mModulus;
  } else {
    throw new JSApplicationCausedNativeException("Illegal node ID set as an input for " +
      "Animated.modulus node");
  }
}
 
Example 13
Project: RNLearn_Project1   File: AdditionAnimatedNode.java   View source code 5 votes vote down vote up
@Override
public void update() {
  mValue = 0;
  for (int i = 0; i < mInputNodes.length; i++) {
    AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNodes[i]);
    if (animatedNode != null && animatedNode instanceof ValueAnimatedNode) {
      mValue += ((ValueAnimatedNode) animatedNode).getValue();
    } else {
      throw new JSApplicationCausedNativeException("Illegal node ID set as an input for " +
        "Animated.Add node");
    }
  }
}
 
Example 14
Project: RNLearn_Project1   File: DiffClampAnimatedNode.java   View source code 5 votes vote down vote up
private double getInputNodeValue() {
  AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNodeTag);
  if (animatedNode == null || !(animatedNode instanceof ValueAnimatedNode)) {
    throw new JSApplicationCausedNativeException("Illegal node ID set as an input for " +
      "Animated.DiffClamp node");

  }

  return ((ValueAnimatedNode) animatedNode).getValue();
}
 
Example 15
Project: RNLearn_Project1   File: DebugComponentOwnershipModule.java   View source code 5 votes vote down vote up
@ReactMethod
public synchronized void receiveOwnershipHierarchy(
    int requestId,
    int tag,
    @Nullable ReadableArray owners) {
  OwnerHierarchyCallback callback = mRequestIdToCallback.get(requestId);
  if (callback == null) {
    throw new JSApplicationCausedNativeException(
        "Got receiveOwnershipHierarchy for invalid request id: " + requestId);
  }
  mRequestIdToCallback.delete(requestId);
  callback.onOwnerHierarchyLoaded(tag, owners);
}
 
Example 16
Project: RNLearn_Project1   File: MultiplicationAnimatedNode.java   View source code 5 votes vote down vote up
@Override
public void update() {
  mValue = 1;
  for (int i = 0; i < mInputNodes.length; i++) {
    AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNodes[i]);
    if (animatedNode != null && animatedNode instanceof ValueAnimatedNode) {
      mValue *= ((ValueAnimatedNode) animatedNode).getValue();
    } else {
      throw new JSApplicationCausedNativeException("Illegal node ID set as an input for " +
        "Animated.multiply node");
    }
  }
}
 
Example 17
Project: RNLearn_Project1   File: ModulusAnimatedNode.java   View source code 5 votes vote down vote up
@Override
public void update() {
  AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNode);
  if (animatedNode != null && animatedNode instanceof ValueAnimatedNode) {
    mValue = ((ValueAnimatedNode) animatedNode).mValue % mModulus;
  } else {
    throw new JSApplicationCausedNativeException("Illegal node ID set as an input for " +
      "Animated.modulus node");
  }
}
 
Example 18
Project: RNLearn_Project1   File: AdditionAnimatedNode.java   View source code 5 votes vote down vote up
@Override
public void update() {
  mValue = 0;
  for (int i = 0; i < mInputNodes.length; i++) {
    AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNodes[i]);
    if (animatedNode != null && animatedNode instanceof ValueAnimatedNode) {
      mValue += ((ValueAnimatedNode) animatedNode).getValue();
    } else {
      throw new JSApplicationCausedNativeException("Illegal node ID set as an input for " +
        "Animated.Add node");
    }
  }
}
 
Example 19
Project: RNLearn_Project1   File: DiffClampAnimatedNode.java   View source code 5 votes vote down vote up
private double getInputNodeValue() {
  AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNodeTag);
  if (animatedNode == null || !(animatedNode instanceof ValueAnimatedNode)) {
    throw new JSApplicationCausedNativeException("Illegal node ID set as an input for " +
      "Animated.DiffClamp node");

  }

  return ((ValueAnimatedNode) animatedNode).getValue();
}
 
Example 20
Project: ReactNativeSignatureExample   File: DebugComponentOwnershipModule.java   View source code 5 votes vote down vote up
@ReactMethod
public synchronized void receiveOwnershipHierarchy(
    int requestId,
    int tag,
    @Nullable ReadableArray owners) {
  OwnerHierarchyCallback callback = mRequestIdToCallback.get(requestId);
  if (callback == null) {
    throw new JSApplicationCausedNativeException(
        "Got receiveOwnershipHierarchy for invalid request id: " + requestId);
  }
  mRequestIdToCallback.delete(requestId);
  callback.onOwnerHierarchyLoaded(tag, owners);
}
 
Example 21
Project: react-native-ibeacon-android   File: DebugComponentOwnershipModule.java   View source code 5 votes vote down vote up
@ReactMethod
public synchronized void receiveOwnershipHierarchy(
    int requestId,
    int tag,
    @Nullable ReadableArray owners) {
  OwnerHierarchyCallback callback = mRequestIdToCallback.get(requestId);
  if (callback == null) {
    throw new JSApplicationCausedNativeException(
        "Got receiveOwnershipHierarchy for invalid request id: " + requestId);
  }
  mRequestIdToCallback.delete(requestId);
  callback.onOwnerHierarchyLoaded(tag, owners);
}
 
Example 22
Project: react-native-box-loaders   File: DebugComponentOwnershipModule.java   View source code 5 votes vote down vote up
@ReactMethod
public synchronized void receiveOwnershipHierarchy(
    int requestId,
    int tag,
    @Nullable ReadableArray owners) {
  OwnerHierarchyCallback callback = mRequestIdToCallback.get(requestId);
  if (callback == null) {
    throw new JSApplicationCausedNativeException(
        "Got receiveOwnershipHierarchy for invalid request id: " + requestId);
  }
  mRequestIdToCallback.delete(requestId);
  callback.onOwnerHierarchyLoaded(tag, owners);
}
 
Example 23
Project: react-native-box-loaders   File: MultiplicationAnimatedNode.java   View source code 5 votes vote down vote up
@Override
public void update() {
  mValue = 1;
  for (int i = 0; i < mInputNodes.length; i++) {
    AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNodes[i]);
    if (animatedNode != null && animatedNode instanceof ValueAnimatedNode) {
      mValue *= ((ValueAnimatedNode) animatedNode).mValue;
    } else {
      throw new JSApplicationCausedNativeException("Illegal node ID set as an input for " +
        "Animated.multiply node");
    }
  }
}
 
Example 24
Project: react-native-box-loaders   File: AnimatedAddition.java   View source code 5 votes vote down vote up
@Override
public void update() {
  mValue = 0;
  for (int i = 0; i < mInputNodes.length; i++) {
    AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNodes[i]);
    if (animatedNode != null && animatedNode instanceof ValueAnimatedNode) {
      mValue += ((ValueAnimatedNode) animatedNode).mValue;
    } else {
      throw new JSApplicationCausedNativeException("Illegal node ID set as an input for " +
        "Animated.Add node");
    }
  }
}
 
Example 25
Project: Ironman   File: DebugComponentOwnershipModule.java   View source code 5 votes vote down vote up
@ReactMethod
public synchronized void receiveOwnershipHierarchy(
    int requestId,
    int tag,
    @Nullable ReadableArray owners) {
  OwnerHierarchyCallback callback = mRequestIdToCallback.get(requestId);
  if (callback == null) {
    throw new JSApplicationCausedNativeException(
        "Got receiveOwnershipHierarchy for invalid request id: " + requestId);
  }
  mRequestIdToCallback.delete(requestId);
  callback.onOwnerHierarchyLoaded(tag, owners);
}
 
Example 26
Project: Ironman   File: MultiplicationAnimatedNode.java   View source code 5 votes vote down vote up
@Override
public void update() {
  mValue = 1;
  for (int i = 0; i < mInputNodes.length; i++) {
    AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNodes[i]);
    if (animatedNode != null && animatedNode instanceof ValueAnimatedNode) {
      mValue *= ((ValueAnimatedNode) animatedNode).mValue;
    } else {
      throw new JSApplicationCausedNativeException("Illegal node ID set as an input for " +
        "Animated.multiply node");
    }
  }
}
 
Example 27
Project: Ironman   File: AdditionAnimatedNode.java   View source code 5 votes vote down vote up
@Override
public void update() {
  mValue = 0;
  for (int i = 0; i < mInputNodes.length; i++) {
    AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNodes[i]);
    if (animatedNode != null && animatedNode instanceof ValueAnimatedNode) {
      mValue += ((ValueAnimatedNode) animatedNode).mValue;
    } else {
      throw new JSApplicationCausedNativeException("Illegal node ID set as an input for " +
        "Animated.Add node");
    }
  }
}
 
Example 28
Project: Ironman   File: DiffClampAnimatedNode.java   View source code 5 votes vote down vote up
private double getInputNodeValue() {
  AnimatedNode animatedNode = mNativeAnimatedNodesManager.getNodeById(mInputNodeTag);
  if (animatedNode == null || !(animatedNode instanceof ValueAnimatedNode)) {
    throw new JSApplicationCausedNativeException("Illegal node ID set as an input for " +
      "Animated.DiffClamp node");

  }

  return ((ValueAnimatedNode) animatedNode).mValue;
}
 
Example 29
Project: ReactNativeSignatureExample   File: AnimationsDebugModule.java   View source code 4 votes vote down vote up
private static void checkAPILevel() {
  if (Build.VERSION.SDK_INT < 16) {
    throw new JSApplicationCausedNativeException(
        "Animation debugging is not supported in API <16");
  }
}
 
Example 30
Project: react-native-ibeacon-android   File: AnimationsDebugModule.java   View source code 4 votes vote down vote up
private static void checkAPILevel() {
  if (Build.VERSION.SDK_INT < 16) {
    throw new JSApplicationCausedNativeException(
        "Animation debugging is not supported in API <16");
  }
}
 
Example 31
Project: react-native-box-loaders   File: AnimationsDebugModule.java   View source code 4 votes vote down vote up
private static void checkAPILevel() {
  if (Build.VERSION.SDK_INT < 16) {
    throw new JSApplicationCausedNativeException(
        "Animation debugging is not supported in API <16");
  }
}
 
Example 32
Project: Ironman   File: AnimationsDebugModule.java   View source code 4 votes vote down vote up
private static void checkAPILevel() {
  if (Build.VERSION.SDK_INT < 16) {
    throw new JSApplicationCausedNativeException(
        "Animation debugging is not supported in API <16");
  }
}