Skip to content

Commit

Permalink
version 0.1.9.8
Browse files Browse the repository at this point in the history
prerelease
  • Loading branch information
gonojuarez committed Sep 27, 2021
1 parent 396e1dd commit 7019943
Showing 1 changed file with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public GlideAttatcher UseCornerRadius(boolean useCornerRadious) {
@Override
public Object loadDrawable(@Nullable Bitmap bitmap, ImageView imageView) {
if (isValidContextFromGlide(mContext)) {
glideScaleItem(cornerRadious(useDecodeFormat(useDiskCacheStrategic(getGlide().getRequestManagerRetriever().get(mContext).load(bitmap))))).dontTransform().into(imageView);
glideScaleItem(overrideMethod(cornerRadious(useDecodeFormat(useDiskCacheStrategic(getGlide().getRequestManagerRetriever().get(mContext).load(bitmap)))))).into(imageView);
clearMemory();
}else{
Glide.with(mContext).pauseRequests();
Expand All @@ -132,7 +132,7 @@ public Object loadDrawable(@Nullable Bitmap bitmap, ImageView imageView) {
@Override
public Object loadDrawable(@Nullable Drawable drawable, ImageView imageView) {
if (isValidContextFromGlide(mContext)) {
glideScaleItem(cornerRadious(useDecodeFormat(useDiskCacheStrategic(getGlide().getRequestManagerRetriever().get(mContext).load(drawable))))).dontTransform().into(imageView);
glideScaleItem(overrideMethod(cornerRadious(useDecodeFormat(useDiskCacheStrategic(getGlide().getRequestManagerRetriever().get(mContext).load(drawable)))))).into(imageView);
}else{
Glide.with(mContext).pauseRequests();
}
Expand All @@ -143,7 +143,7 @@ public Object loadDrawable(@Nullable Drawable drawable, ImageView imageView) {
@Override
public Object loadDrawable(@Nullable String string, ImageView imageView) {
if (isValidContextFromGlide(mContext)) {
glideScaleItem(cornerRadious(useDecodeFormat(useDiskCacheStrategic(getGlide().getRequestManagerRetriever().get(mContext).load(string))))).into(imageView);
glideScaleItem(overrideMethod(cornerRadious(useDecodeFormat(useDiskCacheStrategic(getGlide().getRequestManagerRetriever().get(mContext).load(string)))))).into(imageView);
clearMemory();
}else{
Glide.with(mContext).pauseRequests();
Expand All @@ -155,7 +155,7 @@ public Object loadDrawable(@Nullable String string, ImageView imageView) {
@Override
public Object loadDrawable(@Nullable Uri uri, ImageView imageView) {
if (isValidContextFromGlide(mContext)) {
glideScaleItem(cornerRadious(useDecodeFormat(useDiskCacheStrategic(getGlide().getRequestManagerRetriever().get(mContext).load(uri).fallback(R.drawable.ic_baseline_cloud_download_24))))).into(imageView);
glideScaleItem(overrideMethod(cornerRadious(useDecodeFormat(useDiskCacheStrategic(getGlide().getRequestManagerRetriever().get(mContext).load(uri).fallback(R.drawable.ic_baseline_cloud_download_24)))))).into(imageView);
clearMemory();
}else{
Glide.with(mContext).pauseRequests();
Expand All @@ -167,7 +167,7 @@ public Object loadDrawable(@Nullable Uri uri, ImageView imageView) {
@Override
public Object loadDrawable(@Nullable File file, ImageView imageView) {
if (isValidContextFromGlide(mContext)) {
glideScaleItem(cornerRadious(useDecodeFormat(useDiskCacheStrategic(getGlide().getRequestManagerRetriever().get(mContext).load(file))))).into(imageView);
glideScaleItem(overrideMethod(cornerRadious(useDecodeFormat(useDiskCacheStrategic(getGlide().getRequestManagerRetriever().get(mContext).load(file)))))).into(imageView);
clearMemory();
}else{
Glide.with(mContext).pauseRequests();
Expand All @@ -179,7 +179,7 @@ public Object loadDrawable(@Nullable File file, ImageView imageView) {
@Override
public Object loadDrawable(@Nullable Integer resourceId, ImageView imageView) {
if (isValidContextFromGlide(mContext)) {
glideScaleItem(cornerRadious(useDecodeFormat(useDiskCacheStrategic(getGlide().getRequestManagerRetriever().get(mContext).load(resourceId))))).into(imageView);
glideScaleItem(overrideMethod(cornerRadious(useDecodeFormat(useDiskCacheStrategic(getGlide().getRequestManagerRetriever().get(mContext).load(resourceId)))))).into(imageView);
clearMemory();
}else{
Glide.with(mContext).pauseRequests();
Expand All @@ -190,7 +190,7 @@ public Object loadDrawable(@Nullable Integer resourceId, ImageView imageView) {
@Override
public Object loadDrawable(@Nullable URL url, ImageView imageView) {
if (isValidContextFromGlide(mContext)){
glideScaleItem(cornerRadious(useDecodeFormat(useDiskCacheStrategic(getGlide().getRequestManagerRetriever().get(mContext).load(url).signature(new ObjectKey(url)).error(R.drawable.ic_baseline_cloud_download_24))))).into(imageView);
glideScaleItem(overrideMethod(cornerRadious(useDecodeFormat(useDiskCacheStrategic(getGlide().getRequestManagerRetriever().get(mContext).load(url).signature(new ObjectKey(url)).error(R.drawable.ic_baseline_cloud_download_24)))))).into(imageView);
clearMemory();
}else{
Glide.with(mContext).pauseRequests();
Expand All @@ -202,7 +202,7 @@ public Object loadDrawable(@Nullable URL url, ImageView imageView) {
@Override
public Object loadDrawable(@Nullable byte[] model, ImageView imageView) {
if (isValidContextFromGlide(mContext)) {
glideScaleItem(cornerRadious(useDecodeFormat(useDiskCacheStrategic(getGlide().getRequestManagerRetriever().get(mContext).load(model))))).into(imageView);
glideScaleItem(overrideMethod(cornerRadious(useDecodeFormat(useDiskCacheStrategic(getGlide().getRequestManagerRetriever().get(mContext).load(model)))))).into(imageView);
clearMemory();
}else{
Glide.with(mContext).pauseRequests();
Expand All @@ -214,7 +214,7 @@ public Object loadDrawable(@Nullable byte[] model, ImageView imageView) {
@Override
public Object loadDrawable(@Nullable Object model, ImageView imageView) {
if (isValidContextFromGlide(mContext)) {
glideScaleItem(cornerRadious(useDecodeFormat(useDiskCacheStrategic(getGlide().getRequestManagerRetriever().get(mContext).load(model))))).into(imageView);
glideScaleItem(overrideMethod(cornerRadious(useDecodeFormat(useDiskCacheStrategic(getGlide().getRequestManagerRetriever().get(mContext).load(model)))))).into(imageView);
clearMemory();
}else{
Glide.with(mContext).pauseRequests();
Expand Down Expand Up @@ -257,6 +257,10 @@ public RequestBuilder<Drawable> glideScaleItem(RequestBuilder<Drawable> drawable
}
}

public RequestBuilder<Drawable> overrideMethod(RequestBuilder<Drawable> drawableRequestBuilder){
return drawableRequestBuilder.override(width,height);
}

public RequestBuilder<Drawable> cornerRadious(RequestBuilder<Drawable> drawableRequestBuilder) {
if (useCornerRadious)
return drawableRequestBuilder.transform(new RoundedCorners(radius));
Expand Down

0 comments on commit 7019943

Please sign in to comment.