Class UnbluDefaultModalViewHandler

All Implemented Interfaces:

public class UnbluDefaultModalViewHandler extends Object implements UnbluModalViewHandler
  • Field Details


      public static final long DEFAULT_ANIMATION_DURATION
      See Also:
  • Constructor Details

    • UnbluDefaultModalViewHandler

      public UnbluDefaultModalViewHandler()
  • Method Details

    • onPresentAsModal

      @NonNull public void onPresentAsModal(@NonNull android.view.View unbluView, @NonNull UnbluAnimationData animSourceData)
      Displays the provided view as a modal with animation and transformations.
      Specified by:
      onPresentAsModal in interface UnbluModalViewHandler
      unbluView - the view to be displayed as a modal
      animSourceData - the animation source data for the transformation
    • onDisposeModal

      @NonNull public void onDisposeModal(@NonNull android.content.Context context)
      Disposes the current modal view. We retrieve the latest unblu view drawingCache from the animSourceData and use it to animate the dismissal of the view.
      Specified by:
      onDisposeModal in interface UnbluModalViewHandler
      context - the current active activity context, which allows to call the windowManager with the correct window token.
    • getAppUsableScreenSize

      public static getAppUsableScreenSize(android.content.Context context)
      Returns the usable screen size for the application.
      context - the current application context
      a Point representing the usable screen size
    • onExpandModal

      public void onExpandModal(@NonNull android.content.Context context, @NonNull UnbluAnimationData animSourceData, Function<UnbluDefaultModalViewHandler.OnAnimationEndCallback,Void> onAnimationEnd)
      Expands the modal view using the provided animation source data.
      context - the current application context
      animSourceData - the animation source data for the transformation
      onAnimationEnd - the function to be executed after the animation ends
    • fadeIn

      public static void fadeIn(android.view.View view, long duration, UnbluDefaultModalViewHandler.OnAnimationEndCallback callback)
      Animates the fade-in effect for a given view.
      view - the view to be faded in
      duration - the duration for the fade-in animation
      callback - the callback to be executed after the animation ends