From f3bac4a775e02c6ae983dbc738b99d159e97cda7 Mon Sep 17 00:00:00 2001 From: Alex Isaienko Date: Wed, 28 Sep 2016 00:15:25 +0300 Subject: [PATCH] Added a target view into the ConfigProvider method declaration. --- .../s0nerik/glide_bindingadapter/GlideBindingAdapter.java | 4 ++-- .../s0nerik/glide_bindingadapter/GlideBindingConfig.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/s0nerik/glide_bindingadapter/GlideBindingAdapter.java b/src/main/java/com/github/s0nerik/glide_bindingadapter/GlideBindingAdapter.java index 9c97187..e83cead 100644 --- a/src/main/java/com/github/s0nerik/glide_bindingadapter/GlideBindingAdapter.java +++ b/src/main/java/com/github/s0nerik/glide_bindingadapter/GlideBindingAdapter.java @@ -28,9 +28,9 @@ private static void loadImage( GlideBindingConfig.Provider configProvider; DrawableRequestBuilder requestBuilder; if ((configProvider = GlideBindingConfig.getProvider(configProviderKey)) != null) { - requestBuilder = configProvider.provide(drawableRequest); + requestBuilder = configProvider.provide(iv, drawableRequest); } else if ((configProvider = GlideBindingConfig.getDefaultProvider()) != null) { - requestBuilder = configProvider.provide(drawableRequest); + requestBuilder = configProvider.provide(iv, drawableRequest); } else { requestBuilder = drawableRequest; } diff --git a/src/main/java/com/github/s0nerik/glide_bindingadapter/GlideBindingConfig.java b/src/main/java/com/github/s0nerik/glide_bindingadapter/GlideBindingConfig.java index ccfb691..d39ea6a 100644 --- a/src/main/java/com/github/s0nerik/glide_bindingadapter/GlideBindingConfig.java +++ b/src/main/java/com/github/s0nerik/glide_bindingadapter/GlideBindingConfig.java @@ -1,6 +1,7 @@ package com.github.s0nerik.glide_bindingadapter; import android.support.annotation.NonNull; +import android.widget.ImageView; import com.bumptech.glide.DrawableRequestBuilder; import com.bumptech.glide.DrawableTypeRequest; @@ -11,7 +12,7 @@ public class GlideBindingConfig { public interface Provider { @NonNull - DrawableRequestBuilder provide(DrawableTypeRequest request); + DrawableRequestBuilder provide(ImageView target, DrawableTypeRequest request); } private static Map providers = new HashMap<>();