/** 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);
}
java类com.squareup.picasso.Picasso.Priority的实例源码
Request.java 文件源码
项目:GitHub
阅读 30
收藏 0
点赞 0
评论 0
Request.java 文件源码
项目:picasso
阅读 22
收藏 0
点赞 0
评论 0
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;
}
Request.java 文件源码
项目:picasso
阅读 31
收藏 0
点赞 0
评论 0
/** 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);
}
Request.java 文件源码
项目:GitHub
阅读 23
收藏 0
点赞 0
评论 0
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;
}
Action.java 文件源码
项目:picasso
阅读 24
收藏 0
点赞 0
评论 0
Priority getPriority() {
return request.priority;
}