How to get finish callback on setImageUrl with Volley library and NetworkImageView?

前端 未结 7 1345
萌比男神i
萌比男神i 2020-12-14 01:18

I\'m trying out the Google\'s new Volley library and it\'s looking sharp and loads images quickly when I use this method setImageUrl:

holder.ima         


        
相关标签:
7条回答
  • 2020-12-14 01:53

    We used something like this:

    imageView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
        @Override
        public void onLayoutChange(View view, int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8) {
            // the layout of the logo view changes at least twice: When it is added
            // to the parent and when the image has been loaded. We are only interested
            // in the second case and to find that case, we do this if statement
    
            if (imageView.getDrawable() != null) {
              doSomethingCoolHere();
            }
    
        }
    });
    

    It's not necessarily the most beautiful piece of code but it works (tm)

    0 讨论(0)
提交回复
热议问题