Skip to content

Commit

Permalink
Merge branch 'develop-uri' of github.com:panpf/sketch into develop-uri
Browse files Browse the repository at this point in the history
  • Loading branch information
Flyge committed Sep 3, 2017
2 parents 6db5422 + dd35c36 commit ef075f0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public abstract class DecodeHelper {
abstract boolean match(@NonNull LoadRequest request, @NonNull DataSource dataSource,
@NonNull ImageType imageType, @NonNull BitmapFactory.Options boundOptions);

@NonNull
abstract DecodeResult decode(@NonNull LoadRequest request, @NonNull DataSource dataSource, @NonNull ImageType imageType,
@NonNull BitmapFactory.Options boundOptions, @NonNull BitmapFactory.Options decodeOptions, int exifOrientation) throws DecodeException;

Expand Down
36 changes: 18 additions & 18 deletions sketch/src/main/java/me/xiaopan/sketch/request/DisplayOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,24 +243,24 @@ public StateImage getLoadingImage() {
/**
* 设置加载中时显示的占位图片
*
* @param drawableResId 资源图片ID
* @param loadingImage 加载中时显示的占位图片
* @return DisplayOptions
*/
@NonNull
public DisplayOptions setLoadingImage(@DrawableRes int drawableResId) {
setLoadingImage(new DrawableStateImage(drawableResId));
public DisplayOptions setLoadingImage(@Nullable StateImage loadingImage) {
this.loadingImage = loadingImage;
return this;
}

/**
* 设置加载中时显示的占位图片
*
* @param loadingImage 加载中时显示的占位图片
* @param drawableResId 资源图片ID
* @return DisplayOptions
*/
@NonNull
public DisplayOptions setLoadingImage(@Nullable StateImage loadingImage) {
this.loadingImage = loadingImage;
public DisplayOptions setLoadingImage(@DrawableRes int drawableResId) {
setLoadingImage(new DrawableStateImage(drawableResId));
return this;
}

Expand All @@ -277,24 +277,24 @@ public StateImage getErrorImage() {
/**
* 设置加载失败时显示的图片
*
* @param drawableResId 资源图片ID
* @param errorImage 加载失败时显示的图片
* @return DisplayOptions
*/
@NonNull
public DisplayOptions setErrorImage(@DrawableRes int drawableResId) {
setErrorImage(new DrawableStateImage(drawableResId));
public DisplayOptions setErrorImage(@Nullable StateImage errorImage) {
this.errorImage = errorImage;
return this;
}

/**
* 设置加载失败时显示的图片
*
* @param errorImage 加载失败时显示的图片
* @param drawableResId 资源图片ID
* @return DisplayOptions
*/
@NonNull
public DisplayOptions setErrorImage(@Nullable StateImage errorImage) {
this.errorImage = errorImage;
public DisplayOptions setErrorImage(@DrawableRes int drawableResId) {
setErrorImage(new DrawableStateImage(drawableResId));
return this;
}

Expand All @@ -311,24 +311,24 @@ public StateImage getPauseDownloadImage() {
/**
* 设置暂停下载时显示的图片
*
* @param drawableResId 资源图片ID
* @param pauseDownloadImage 暂停下载时显示的图片
* @return DisplayOptions
*/
@NonNull
public DisplayOptions setPauseDownloadImage(@DrawableRes int drawableResId) {
setPauseDownloadImage(new DrawableStateImage(drawableResId));
public DisplayOptions setPauseDownloadImage(@Nullable StateImage pauseDownloadImage) {
this.pauseDownloadImage = pauseDownloadImage;
return this;
}

/**
* 设置暂停下载时显示的图片
*
* @param pauseDownloadImage 暂停下载时显示的图片
* @param drawableResId 资源图片ID
* @return DisplayOptions
*/
@NonNull
public DisplayOptions setPauseDownloadImage(@Nullable StateImage pauseDownloadImage) {
this.pauseDownloadImage = pauseDownloadImage;
public DisplayOptions setPauseDownloadImage(@DrawableRes int drawableResId) {
setPauseDownloadImage(new DrawableStateImage(drawableResId));
return this;
}

Expand Down

0 comments on commit ef075f0

Please sign in to comment.