Fade in animation while loading image Using Picasso

前端 未结 3 1076
失恋的感觉
失恋的感觉 2021-01-07 19:26

I want to show a fade effect when image is loading on Imageview. I am using picasso to cache image and display in image view. I have searched alot for this but couldnt find

3条回答
  •  一整个雨季
    2021-01-07 19:54

    I do this:

    Picasso.get().load(url).fit().noFade().centerInside().into(imageView, new Callback() {
    
                    @Override
                    public void onSuccess() {
                        imageView.setAlpha(0f);
                        imageView.animate().setDuration(200).alpha(1f).start();
                    }
    
                    @Override
                    public void onError(Exception e) {
                    }
                });
    

提交回复
热议问题