mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-01 22:35:29 +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
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
package com.facebook.react.flat;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.facebook.drawee.drawable.ScalingUtils.ScaleType;
|
||||
import com.facebook.imagepipeline.request.ImageRequest;
|
||||
|
||||
/**
|
||||
* Common interface for DrawImageWithPipeline and DrawImageWithDrawee.
|
||||
*/
|
||||
/* package */ interface DrawImage extends DrawCommand, AttachDetachListener {
|
||||
/**
|
||||
* Returns true if an image source was assigned to the DrawImage.
|
||||
* A DrawImage with no source will not draw anything.
|
||||
*/
|
||||
public boolean hasImageRequest();
|
||||
|
||||
/**
|
||||
* Assigns a new image request to the DrawImage, or null to clear the image request.
|
||||
*/
|
||||
public void setImageRequest(@Nullable ImageRequest imageRequest);
|
||||
|
||||
/**
|
||||
* Assigns a tint color to apply to the image drawn.
|
||||
*/
|
||||
public void setTintColor(int tintColor);
|
||||
|
||||
/**
|
||||
* Assigns a scale type to draw to the image with.
|
||||
*/
|
||||
public void setScaleType(ScaleType scaleType);
|
||||
|
||||
/**
|
||||
* Returns a scale type to draw to the image with.
|
||||
*/
|
||||
public ScaleType getScaleType();
|
||||
}
|
||||
Reference in New Issue
Block a user