Java 类com.facebook.react.animation.AnimationPropertyUpdater 实例源码

项目:RNLearn_Project1    文件:UIManagerModuleTest.java   
@Test
public void testAddAndRemoveAnimation() {
  UIManagerModule uiManagerModule = getUIManagerModule();
  TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManagerModule);

  AnimationPropertyUpdater mockPropertyUpdater = mock(AnimationPropertyUpdater.class);
  Animation mockAnimation = spy(new AnimationStub(1000, mockPropertyUpdater));
  Callback callbackMock = mock(Callback.class);

  int rootTag = hierarchy.rootView;
  uiManagerModule.createView(
      hierarchy.rootView,
      ReactViewManager.REACT_CLASS,
      rootTag,
      JavaOnlyMap.of("collapsable", false));

  uiManagerModule.registerAnimation(mockAnimation);
  uiManagerModule.addAnimation(hierarchy.rootView, 1000, callbackMock);
  uiManagerModule.removeAnimation(hierarchy.rootView, 1000);

  uiManagerModule.onBatchComplete();
  executePendingFrameCallbacks();

  verify(callbackMock, times(1)).invoke(false);
  verify(mockAnimation).run();
  verify(mockAnimation).cancel();
}
项目:RNLearn_Project1    文件:UIManagerModuleTest.java   
@Test
public void testAddAndRemoveAnimation() {
  UIManagerModule uiManagerModule = getUIManagerModule();
  TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManagerModule);

  AnimationPropertyUpdater mockPropertyUpdater = mock(AnimationPropertyUpdater.class);
  Animation mockAnimation = spy(new AnimationStub(1000, mockPropertyUpdater));
  Callback callbackMock = mock(Callback.class);

  int rootTag = hierarchy.rootView;
  uiManagerModule.createView(
      hierarchy.rootView,
      ReactViewManager.REACT_CLASS,
      rootTag,
      JavaOnlyMap.of("collapsable", false));

  uiManagerModule.registerAnimation(mockAnimation);
  uiManagerModule.addAnimation(hierarchy.rootView, 1000, callbackMock);
  uiManagerModule.removeAnimation(hierarchy.rootView, 1000);

  uiManagerModule.onBatchComplete();
  executePendingFrameCallbacks();

  verify(callbackMock, times(1)).invoke(false);
  verify(mockAnimation).run();
  verify(mockAnimation).cancel();
}
项目:ReactNativeSignatureExample    文件:UIManagerModuleTest.java   
@Test
public void testAddAndRemoveAnimation() {
  UIManagerModule uiManagerModule = getUIManagerModule();
  TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManagerModule);

  AnimationPropertyUpdater mockPropertyUpdater = mock(AnimationPropertyUpdater.class);
  Animation mockAnimation = spy(new AnimationStub(1000, mockPropertyUpdater));
  Callback callbackMock = mock(Callback.class);

  int rootTag = hierarchy.rootView;
  uiManagerModule.createView(
      hierarchy.rootView,
      ReactViewManager.REACT_CLASS,
      rootTag,
      JavaOnlyMap.of("collapsable", false));

  uiManagerModule.registerAnimation(mockAnimation);
  uiManagerModule.addAnimation(hierarchy.rootView, 1000, callbackMock);
  uiManagerModule.removeAnimation(hierarchy.rootView, 1000);

  uiManagerModule.onBatchComplete();
  executePendingChoreographerCallbacks();

  verify(callbackMock, times(1)).invoke(false);
  verify(mockAnimation).run();
  verify(mockAnimation).cancel();
}
项目:react-native-ibeacon-android    文件:UIManagerModuleTest.java   
@Test
public void testAddAndRemoveAnimation() {
  UIManagerModule uiManagerModule = getUIManagerModule();
  TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManagerModule);

  AnimationPropertyUpdater mockPropertyUpdater = mock(AnimationPropertyUpdater.class);
  Animation mockAnimation = spy(new AnimationStub(1000, mockPropertyUpdater));
  Callback callbackMock = mock(Callback.class);

  int rootTag = hierarchy.rootView;
  uiManagerModule.createView(
      hierarchy.rootView,
      ReactViewManager.REACT_CLASS,
      rootTag,
      JavaOnlyMap.of("collapsable", false));

  uiManagerModule.registerAnimation(mockAnimation);
  uiManagerModule.addAnimation(hierarchy.rootView, 1000, callbackMock);
  uiManagerModule.removeAnimation(hierarchy.rootView, 1000);

  uiManagerModule.onBatchComplete();
  executePendingChoreographerCallbacks();

  verify(callbackMock, times(1)).invoke(false);
  verify(mockAnimation).run();
  verify(mockAnimation).cancel();
}
项目:react-native-box-loaders    文件:UIManagerModuleTest.java   
@Test
public void testAddAndRemoveAnimation() {
  UIManagerModule uiManagerModule = getUIManagerModule();
  TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManagerModule);

  AnimationPropertyUpdater mockPropertyUpdater = mock(AnimationPropertyUpdater.class);
  Animation mockAnimation = spy(new AnimationStub(1000, mockPropertyUpdater));
  Callback callbackMock = mock(Callback.class);

  int rootTag = hierarchy.rootView;
  uiManagerModule.createView(
      hierarchy.rootView,
      ReactViewManager.REACT_CLASS,
      rootTag,
      JavaOnlyMap.of("collapsable", false));

  uiManagerModule.registerAnimation(mockAnimation);
  uiManagerModule.addAnimation(hierarchy.rootView, 1000, callbackMock);
  uiManagerModule.removeAnimation(hierarchy.rootView, 1000);

  uiManagerModule.onBatchComplete();
  executePendingChoreographerCallbacks();

  verify(callbackMock, times(1)).invoke(false);
  verify(mockAnimation).run();
  verify(mockAnimation).cancel();
}
项目:Ironman    文件:UIManagerModuleTest.java   
@Test
public void testAddAndRemoveAnimation() {
  UIManagerModule uiManagerModule = getUIManagerModule();
  TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManagerModule);

  AnimationPropertyUpdater mockPropertyUpdater = mock(AnimationPropertyUpdater.class);
  Animation mockAnimation = spy(new AnimationStub(1000, mockPropertyUpdater));
  Callback callbackMock = mock(Callback.class);

  int rootTag = hierarchy.rootView;
  uiManagerModule.createView(
      hierarchy.rootView,
      ReactViewManager.REACT_CLASS,
      rootTag,
      JavaOnlyMap.of("collapsable", false));

  uiManagerModule.registerAnimation(mockAnimation);
  uiManagerModule.addAnimation(hierarchy.rootView, 1000, callbackMock);
  uiManagerModule.removeAnimation(hierarchy.rootView, 1000);

  uiManagerModule.onBatchComplete();
  executePendingChoreographerCallbacks();

  verify(callbackMock, times(1)).invoke(false);
  verify(mockAnimation).run();
  verify(mockAnimation).cancel();
}
项目:RNLearn_Project1    文件:UIManagerModuleTest.java   
public AnimationStub(int animationID, AnimationPropertyUpdater propertyUpdater) {
  super(animationID, propertyUpdater);
}
项目:RNLearn_Project1    文件:UIManagerModuleTest.java   
public AnimationStub(int animationID, AnimationPropertyUpdater propertyUpdater) {
  super(animationID, propertyUpdater);
}
项目:ReactNativeSignatureExample    文件:UIManagerModuleTest.java   
public AnimationStub(int animationID, AnimationPropertyUpdater propertyUpdater) {
  super(animationID, propertyUpdater);
}
项目:react-native-ibeacon-android    文件:UIManagerModuleTest.java   
public AnimationStub(int animationID, AnimationPropertyUpdater propertyUpdater) {
  super(animationID, propertyUpdater);
}
项目:react-native-box-loaders    文件:UIManagerModuleTest.java   
public AnimationStub(int animationID, AnimationPropertyUpdater propertyUpdater) {
  super(animationID, propertyUpdater);
}
项目:Ironman    文件:UIManagerModuleTest.java   
public AnimationStub(int animationID, AnimationPropertyUpdater propertyUpdater) {
  super(animationID, propertyUpdater);
}