public FillableLoader build() { Resources res = parent.getContext().getResources(); strokeColor = strokeColor == -1 ? res.getColor(R.color.strokeColor) : strokeColor; fillColor = fillColor == -1 ? res.getColor(R.color.fillColor) : fillColor; strokeWidth = strokeWidth < 0 ? res.getDimensionPixelSize(R.dimen.strokeWidth) : strokeWidth; strokeDrawingDuration = strokeDrawingDuration < 0 ? res.getInteger(R.integer.strokeDrawingDuration) : strokeDrawingDuration; fillDuration = fillDuration < 0 ? res.getInteger(R.integer.fillDuration) : fillDuration; clippingTransform = clippingTransform == null ? new PlainClippingTransform() : clippingTransform; if (params == null) { throwArgumentException("layout params"); } if (svgPath == null) { throwArgumentException("an svg path"); } return new FillableLoader(parent, params, strokeColor, fillColor, strokeWidth, originalWidth, originalHeight, strokeDrawingDuration, fillDuration, clippingTransform, svgPath, percentageEnabled, percentage); }