Class LceAnimator


  • public class LceAnimator
    extends java.lang.Object
    Little helper class for animating content, error and loading view
    Since:
    1.0.0
    • Constructor Summary

      Constructors 
      Constructor Description
      LceAnimator()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int dpToPx​(android.content.Context context, float dp)
      Converts a dp value to a px value
      static void showContent​(android.view.View loadingView, android.view.View contentView, android.view.View errorView)
      Display the content instead of the loadingView
      static void showErrorView​(android.view.View loadingView, android.view.View contentView, android.view.View errorView)
      Shows the error view instead of the loading view
      static void showLoading​(android.view.View loadingView, android.view.View contentView, android.view.View errorView)
      Show the loading view.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LceAnimator

        public LceAnimator()
    • Method Detail

      • showLoading

        public static void showLoading​(@NonNull
                                       android.view.View loadingView,
                                       @NonNull
                                       android.view.View contentView,
                                       @NonNull
                                       android.view.View errorView)
        Show the loading view. No animations, because sometimes loading things is pretty fast (i.e. retrieve data from memory cache).
        Parameters:
        loadingView - view for loading
        contentView - view for content
        errorView - view for error
      • showErrorView

        public static void showErrorView​(@NonNull
                                         android.view.View loadingView,
                                         @NonNull
                                         android.view.View contentView,
                                         android.view.View errorView)
        Shows the error view instead of the loading view
        Parameters:
        loadingView - view for loading
        contentView - view for content
        errorView - view for error
      • showContent

        public static void showContent​(@NonNull
                                       android.view.View loadingView,
                                       @NonNull
                                       android.view.View contentView,
                                       @NonNull
                                       android.view.View errorView)
        Display the content instead of the loadingView
        Parameters:
        loadingView - view for loading
        contentView - view for content
        errorView - view for error
      • dpToPx

        public static int dpToPx​(android.content.Context context,
                                 float dp)
        Converts a dp value to a px value
        Parameters:
        context - used to get resources
        dp - the dp value
        Returns:
        converted value of dp to px