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:
Denis Koroskin
2015-12-11 22:44:38 -08:00
committed by Ahmed El-Helw
parent dfe5f9f762
commit 760422525e
14 changed files with 784 additions and 14 deletions

View File

@@ -9,6 +9,8 @@
package com.facebook.react.flat;
import javax.annotation.Nullable;
import android.view.View;
import android.view.View.MeasureSpec;
@@ -39,14 +41,23 @@ import com.facebook.react.uimanager.ViewManagerRegistry;
}
/**
* Assigns new DrawCommands to a FlatViewGroup specified by a reactTag.
* Updates DrawCommands and AttachDetachListeners of a FlatViewGroup specified by a reactTag.
*
* @param reactTag reactTag to lookup FlatViewGroup by
* @param drawCommands new draw commands to execute during the drawing.
* @param drawCommands if non-null, new draw commands to execute during the drawing.
* @param listeners if non-null, new attach-detach listeners.
*/
/* package */ void updateMountState(int reactTag, DrawCommand[] drawCommands) {
/* package */ void updateMountState(
int reactTag,
@Nullable DrawCommand[] drawCommands,
@Nullable AttachDetachListener[] listeners) {
FlatViewGroup view = (FlatViewGroup) resolveView(reactTag);
view.mountDrawCommands(drawCommands);
if (drawCommands != null) {
view.mountDrawCommands(drawCommands);
}
if (listeners != null) {
view.mountAttachDetachListeners(listeners);
}
}
/**