mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add support for RCTImageView in FlatShadowHierarchyManager
Summary: @public This patch adds basic support for RCTImageView (only 'src', 'tintColor' and 'resizeMode' properties are supported for now), and a concept of AttachDetachListener that is required to support it to FlatUIImplementations. Reviewed By: sriramramani Differential Revision: D2564389
This commit is contained in:
committed by
Ahmed El-Helw
parent
dfe5f9f762
commit
760422525e
@@ -9,6 +9,8 @@
|
||||
|
||||
package com.facebook.react.flat;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.uimanager.UIViewOperationQueue;
|
||||
|
||||
@@ -26,16 +28,24 @@ import com.facebook.react.uimanager.UIViewOperationQueue;
|
||||
private final class UpdateMountState implements UIOperation {
|
||||
|
||||
private final int mReactTag;
|
||||
private final DrawCommand[] mDrawCommands;
|
||||
private final @Nullable DrawCommand[] mDrawCommands;
|
||||
private final @Nullable AttachDetachListener[] mAttachDetachListeners;
|
||||
|
||||
private UpdateMountState(int reactTag, DrawCommand[] drawCommands) {
|
||||
private UpdateMountState(
|
||||
int reactTag,
|
||||
@Nullable DrawCommand[] drawCommands,
|
||||
@Nullable AttachDetachListener[] listeners) {
|
||||
mReactTag = reactTag;
|
||||
mDrawCommands = drawCommands;
|
||||
mAttachDetachListeners = listeners;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
mNativeViewHierarchyManager.updateMountState(mReactTag, mDrawCommands);
|
||||
mNativeViewHierarchyManager.updateMountState(
|
||||
mReactTag,
|
||||
mDrawCommands,
|
||||
mAttachDetachListeners);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,8 +85,11 @@ import com.facebook.react.uimanager.UIViewOperationQueue;
|
||||
/**
|
||||
* Enqueues a new UIOperation that will update DrawCommands for a View defined by reactTag.
|
||||
*/
|
||||
public void enqueueUpdateMountState(int reactTag, DrawCommand[] drawCommands) {
|
||||
enqueueUIOperation(new UpdateMountState(reactTag, drawCommands));
|
||||
public void enqueueUpdateMountState(
|
||||
int reactTag,
|
||||
@Nullable DrawCommand[] drawCommands,
|
||||
@Nullable AttachDetachListener[] listeners) {
|
||||
enqueueUIOperation(new UpdateMountState(reactTag, drawCommands, listeners));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user