/** Create the immutable {@link Request} object. */ public Request build() { if (centerInside && centerCrop) { throw new IllegalStateException("Center crop and center inside can not be used together."); } if (centerCrop && (targetWidth == 0 && targetHeight == 0)) { throw new IllegalStateException( "Center crop requires calling resize with positive width and height."); } if (centerInside && (targetWidth == 0 && targetHeight == 0)) { throw new IllegalStateException( "Center inside requires calling resize with positive width and height."); } if (priority == null) { priority = Priority.NORMAL; } return new Request(uri, resourceId, stableKey, transformations, targetWidth, targetHeight, centerCrop, centerInside, centerCropGravity, onlyScaleDown, rotationDegrees, rotationPivotX, rotationPivotY, hasRotationPivot, purgeable, config, priority); }
private Request(Uri uri, int resourceId, List<Transformation> transformations, int targetWidth, int targetHeight, boolean centerCrop, boolean centerInside, float rotationDegrees, float rotationPivotX, float rotationPivotY, boolean hasRotationPivot, Bitmap.Config config, Priority priority) { this.uri = uri; this.resourceId = resourceId; if (transformations == null) { this.transformations = null; } else { this.transformations = unmodifiableList(transformations); } this.targetWidth = targetWidth; this.targetHeight = targetHeight; this.centerCrop = centerCrop; this.centerInside = centerInside; this.rotationDegrees = rotationDegrees; this.rotationPivotX = rotationPivotX; this.rotationPivotY = rotationPivotY; this.hasRotationPivot = hasRotationPivot; this.config = config; this.priority = priority; }
/** Create the immutable {@link Request} object. */ public Request build() { if (centerInside && centerCrop) { throw new IllegalStateException("Center crop and center inside can not be used together."); } if (centerCrop && targetWidth == 0) { throw new IllegalStateException("Center crop requires calling resize."); } if (centerInside && targetWidth == 0) { throw new IllegalStateException("Center inside requires calling resize."); } if (priority == null) { priority = Priority.NORMAL; } return new Request(uri, resourceId, transformations, targetWidth, targetHeight, centerCrop, centerInside, rotationDegrees, rotationPivotX, rotationPivotY, hasRotationPivot, config, priority); }
private Request(Uri uri, int resourceId, String stableKey, List<Transformation> transformations, int targetWidth, int targetHeight, boolean centerCrop, boolean centerInside, int centerCropGravity, boolean onlyScaleDown, float rotationDegrees, float rotationPivotX, float rotationPivotY, boolean hasRotationPivot, boolean purgeable, Bitmap.Config config, Priority priority) { this.uri = uri; this.resourceId = resourceId; this.stableKey = stableKey; if (transformations == null) { this.transformations = null; } else { this.transformations = unmodifiableList(transformations); } this.targetWidth = targetWidth; this.targetHeight = targetHeight; this.centerCrop = centerCrop; this.centerInside = centerInside; this.centerCropGravity = centerCropGravity; this.onlyScaleDown = onlyScaleDown; this.rotationDegrees = rotationDegrees; this.rotationPivotX = rotationPivotX; this.rotationPivotY = rotationPivotY; this.hasRotationPivot = hasRotationPivot; this.purgeable = purgeable; this.config = config; this.priority = priority; }
Priority getPriority() { return request.priority; }