Java 类com.facebook.react.views.image.ReactImageView 实例源码

项目:native-navigation    文件:SharedElementViewManager.java   
@Override
public void addView(ReactViewGroup parent, View child, int index) {
  String transitionName = (String) parent.getTag(R.id.react_shared_element_transition_name);
  String instanceId = (String) parent.getTag(R.id.react_shared_element_screen_instance_id);
  ReactInterface component = coordinator.componentFromId(instanceId);

  if (child instanceof ReactImageView) {
    ReactImageView iv = (ReactImageView) child;
    // TODO(lmr): do something to wait for image to load
  }

  ViewCompat.setTransitionName(child, transitionName);
  parent.addView(child, index);

  if (component != null) {
    component.notifySharedElementAddition();
  }
}
项目:react-native-navigation    文件:SharedElementTransition.java   
@Override
public void onViewAdded(final View child) {
    if (child instanceof ReactImageView && this.child == null) {
        ReactViewHacks.disableReactImageViewRemoteImageFadeInAnimation((ReactImageView) child);
    }
    this.child = child;
    if (child instanceof TextView) {
        saveTextViewSpannedText((TextView) child);
    }
    super.onViewAdded(child);
}
项目:react-native-navigation    文件:AnimatorValuesResolver.java   
private ScalingUtils.ScaleType getScaleType(SharedElementTransition view) {
    if (view.getSharedView() instanceof ReactImageView) {
        return ((DraweeView<GenericDraweeHierarchy>) view.getSharedView()).getHierarchy().getActualImageScaleType();
    }
    return null;
}
项目:react-native-navigation    文件:AnimatorValuesResolver.java   
private Rect calculateBounds(SharedElementTransition view) {
    if (view.getSharedView() instanceof ReactImageView) {
        return new Rect(0, 0, view.getSharedView().getWidth(), view.getSharedView().getHeight());
    }
    return null;
}
项目:react-native-navigation    文件:ReactViewHacks.java   
public static void disableReactImageViewRemoteImageFadeInAnimation(ReactImageView reactImageView) {
    reactImageView.setFadeDuration(0);
    ReflectionUtils.setField(reactImageView, "mIsDirty", true);
    reactImageView.maybeUpdateView();
}