Example usage for com.facebook.react.bridge WritableArray size

List of usage examples for com.facebook.react.bridge WritableArray size

Introduction

In this page you can find the example usage for com.facebook.react.bridge WritableArray size.

Prototype

int size();

Source Link

Usage

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

License:Open Source License

public void mergeProperties(RenderableShadowNode target) {
    WritableArray targetAttributeList = target.getAttributeList();

    if (targetAttributeList == null || targetAttributeList.size() == 0) {
        return;/*from ww  w.  ja v  a  2s.  c  o  m*/
    }

    mOriginProperties = new ArrayList<>();
    mAttributeList = clonePropList();

    for (int i = 0, size = targetAttributeList.size(); i < size; i++) {
        try {
            String fieldName = targetAttributeList.getString(i);
            Field field = getClass().getField(fieldName);
            Object value = field.get(target);
            mOriginProperties.add(field.get(this));

            if (!hasOwnProperty(fieldName)) {
                mAttributeList.pushString(fieldName);
                field.set(this, value);
            }
        } catch (Exception e) {
            throw new IllegalStateException(e);
        }
    }

    mLastMergedList = targetAttributeList;
}