[Android] [PATCH] Remove OnRebindCallback

Geoffrey Métais geoffrey.metais at gmail.com
Fri Dec 18 19:23:20 CET 2015


---
 .../videolan/vlc/gui/helpers/AsyncImageLoader.java | 24 +---------------------
 1 file changed, 1 insertion(+), 23 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/helpers/AsyncImageLoader.java b/vlc-android/src/org/videolan/vlc/gui/helpers/AsyncImageLoader.java
index 20379d1..8be1ac8 100644
--- a/vlc-android/src/org/videolan/vlc/gui/helpers/AsyncImageLoader.java
+++ b/vlc-android/src/org/videolan/vlc/gui/helpers/AsyncImageLoader.java
@@ -24,7 +24,6 @@
 package org.videolan.vlc.gui.helpers;
 
 import android.app.Activity;
-import android.databinding.OnRebindCallback;
 import android.databinding.ViewDataBinding;
 import android.graphics.Bitmap;
 import android.graphics.drawable.BitmapDrawable;
@@ -92,37 +91,16 @@ public class AsyncImageLoader {
 
     public abstract static class CoverFetcher implements AsyncImageLoader.Callbacks {
         final protected ViewDataBinding binding;
-        private boolean bindChanged = false;
-        final OnRebindCallback<ViewDataBinding> rebindCallbacks = new OnRebindCallback<ViewDataBinding>() {
-            @Override
-            public boolean onPreBind(ViewDataBinding binding) {
-                bindChanged = true;
-                return super.onPreBind(binding);
-            }
-
-            @Override
-            public void onCanceled(ViewDataBinding binding) {
-                super.onCanceled(binding);
-            }
-
-            @Override
-            public void onBound(ViewDataBinding binding) {
-                super.onBound(binding);
-            }
-        };
 
         protected CoverFetcher(ViewDataBinding binding){
             this.binding = binding;
-            this.binding.addOnRebindCallback(rebindCallbacks);
         }
 
         public abstract void updateBindImage(final Bitmap bitmap, View target);
 
         @Override
         public final void updateImage(final Bitmap bitmap, View target) {
-            this.binding.removeOnRebindCallback(rebindCallbacks);
-            if (!bindChanged)
-                updateBindImage(bitmap, target);
+            updateBindImage(bitmap, target);
         }
     }
 }
-- 
2.5.0



More information about the Android mailing list