Class UnbluDefaultModalViewHandler

java.lang.Object
com.unblu.sdk.core.ui.UnbluDefaultModalViewHandler
All Implemented Interfaces:
UnbluModalViewHandler

public class UnbluDefaultModalViewHandler extends Object implements UnbluModalViewHandler
  • Field Details

    • DEFAULT_ANIMATION_DURATION

      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
      Parameters:
      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
      Parameters:
      context - the current active activity context, which allows to call the windowManager with the correct window token.
    • getAppUsableScreenSize

      public static android.graphics.Point getAppUsableScreenSize(android.content.Context context)
      Returns the usable screen size for the application.
      Parameters:
      context - the current application context
      Returns:
      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.
      Parameters:
      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.
      Parameters:
      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