facebookarchive / shimmer-android

An easy, flexible way to add a shimmering effect to any view in an Android app.
http://facebook.github.io/shimmer-android/
Other
5.32k stars 697 forks source link

Shimmering does not stop after calling .stopShimmer() #51

Closed ArcherEmiya05 closed 6 years ago

ArcherEmiya05 commented 6 years ago

Hello I would like to ask why is shimmering still exist even after calling .stopShimmer() method in RecyclerView. Here's an example I am using 0.2.0 v.

        //Set the user's profile picture
        this.shimmerSUDP.startShimmer();
        GlideApp.with(context)
                .load(thumbnail)
                .placeholder(R.color.icon_not_selected)
                .diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
                .listener(new RequestListener<Drawable>() {
                    @Override
                    public boolean onLoadFailed(@Nullable GlideException e, Object model, 
                            Target<Drawable> target, boolean isFirstResource) {
                        return false;
                    }

                    @Override
                    public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> 
                      target, DataSource dataSource, boolean isFirstResource) {
                        shimmerSUDP.stopShimmer();
                        return false;
                    }
                })
                .into(mSuDP);
xiphirx commented 6 years ago

stopShimmer seems to be working as expected when trying it out in the sample app. Are you sure the view holder wasn't re-instantiated and dont have autoStart specified?

ArcherEmiya05 commented 6 years ago

Wow! So autostart is the culprit here. I also notice that thanks anyway.

On 23 May 2018 1:00 a.m., "Hilal Alsibai" notifications@github.com wrote:

stopShimmer seems to be working as expected when trying it out in the sample app. Are you sure the view holder wasn't re-instantiated and dont have autoStart specified?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/facebook/shimmer-android/issues/51#issuecomment-391065582, or mute the thread https://github.com/notifications/unsubscribe-auth/AkP4RBHOLoeOqODwUYWXLVaO2A7oPpIUks5t1EQYgaJpZM4TvYkC .