stop shimmer is not working Facebook shimmer

1.1k Views Asked by At

For old version I am able to stop the shimmer, new version am not able to stop the shimmer,

Old Version Details

implementation 'com.facebook.shimmer:shimmer:0.1.0@aar'//using aar 
implementation 'com.facebook.shimmer:shimmer:0.1.0' //using jar
startshimmeranimation(),
stopShimmerAnimation()

New Version Details

implementation 'com.facebook.shimmer:shimmer:0.5.0@aar'
implementation 'com.facebook.shimmer:shimmer:0.5.0'
startShimmer()
stopShimmer() 

Note:latest version startshimmeranimation/stopshimmeranimation not there,
please help me get out this issue.

Thanks......
2

There are 2 best solutions below

0
On

Use shimmer.setVisibility(View.GONE); instead of stopShimmer() when finished.

Again, before starting shimmer call shimmer.setVisibility(View.VISIBLE); so that the shimmer is visible.

0
On
runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    shimmer.stopShimmer();
                    shimmer.hideShimmer();
                }
            });