Example usage for com.facebook.react.views.imagehelper ResourceDrawableIdHelper getInstance

List of usage examples for com.facebook.react.views.imagehelper ResourceDrawableIdHelper getInstance

Introduction

In this page you can find the example usage for com.facebook.react.views.imagehelper ResourceDrawableIdHelper getInstance.

Prototype

public static ResourceDrawableIdHelper getInstance() 

Source Link

Usage

From source file:com.horcrux.svg.ImageView.java

License:Open Source License

@ReactProp(name = "src")
public void setSrc(@Nullable ReadableMap src) {
    if (src != null) {
        uriString = src.getString("uri");

        if (uriString == null || uriString.isEmpty()) {
            //TODO: give warning about this
            return;
        }/*from w  ww .jav  a 2s.co m*/

        if (src.hasKey("width") && src.hasKey("height")) {
            mImageWidth = src.getInt("width");
            mImageHeight = src.getInt("height");
        } else {
            mImageWidth = 0;
            mImageHeight = 0;
        }
        Uri mUri = Uri.parse(uriString);
        if (mUri.getScheme() == null) {
            ResourceDrawableIdHelper.getInstance().getResourceDrawableUri(mContext, uriString);
        }
    }
}