Package com.unblu.sdk.core.ui
Class UnbluDefaultModalViewHandler
java.lang.Object
com.unblu.sdk.core.ui.UnbluDefaultModalViewHandler
- All Implemented Interfaces:
UnbluModalViewHandler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Callback interface for indicating the end of an animation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
fadeIn
(android.view.View view, long duration, UnbluDefaultModalViewHandler.OnAnimationEndCallback callback) Animates the fade-in effect for a given view.static android.graphics.Point
getAppUsableScreenSize
(android.content.Context context) Returns the usable screen size for the application.void
onDisposeModal
(android.content.Context context) Disposes the current modal view.void
onExpandModal
(android.content.Context context, UnbluAnimationData animSourceData, Function<UnbluDefaultModalViewHandler.OnAnimationEndCallback, Void> onAnimationEnd) Expands the modal view using the provided animation source data.void
onPresentAsModal
(android.view.View unbluView, UnbluAnimationData animSourceData) Displays the provided view as a modal with animation and transformations.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.unblu.sdk.core.ui.UnbluModalViewHandler
shouldPresentAsModal
-
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 interfaceUnbluModalViewHandler
- Parameters:
unbluView
- the view to be displayed as a modalanimSourceData
- 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 interfaceUnbluModalViewHandler
- 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 contextanimSourceData
- the animation source data for the transformationonAnimationEnd
- 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 induration
- the duration for the fade-in animationcallback
- the callback to be executed after the animation ends
-