AnimationUtils

public class AnimationUtils

This is a utility class to show the loading overlay for activities that require network requests to display their data.

Methods

animateLoadingOverlay

public static void animateLoadingOverlay(View view, int toVisibility, float toAlpha, int duration)

Shows or hides loading overlay with smooth alpha transition. Sourced from https://stackoverflow.com/questions/18021148/display-a-loading-overlay-on-android-screen

Parameters:
  • view – View to animate
  • toVisibility – Visibility at the end of animation
  • toAlpha – Alpha at the end of animation
  • duration – Animation duration in ms