mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-11 11:29:03 +08: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 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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user