0

I am trying to add a loading placeholder (just a linear layout) until I get a response from the API. I want to add a Shimmer like effect to the placeholder without using an external library.

I tried using a GradientDrawable with a ValueAnimator from here but it is not working. I also tried adding the second View with a specific color and animate this view over the placeholder view.

I want to know how to do it without using an external library, or adding a second view.

Davi
  • 1,031
  • 12
  • 21

1 Answers1

1

you can check "facebook shimmer" library sources, it's pretty simple, there are only 3 class in that library (custom view + custom drawable).
https://github.com/facebook/shimmer-android/tree/master/shimmer/src/main/java/com/facebook/shimmer

ashakirov
  • 12,112
  • 6
  • 40
  • 40