DefaultInAppMessageViewWrapper

open class DefaultInAppMessageViewWrapper @JvmOverloads constructor(val inAppMessageView: View, val inAppMessage: IInAppMessage, val inAppMessageViewLifecycleListener: IInAppMessageViewLifecycleListener, val configurationProvider: BrazeConfigurationProvider, val openingAnimation: Animation?, val closingAnimation: Animation?, var clickableInAppMessageView: View?, var buttonViews: List<View>? = null, var closeButton: View? = null) : IInAppMessageViewWrapper

Constructor for base and slideup view wrappers. Adds click listeners to the in-app message view and adds swipe functionality to slideup in-app messages.

Parameters

inAppMessageView

In-app message top level view.

inAppMessage

In-app message model.

inAppMessageViewLifecycleListener

In-app message lifecycle listener.

configurationProvider

Configuration provider.

clickableInAppMessageView

View for which click actions apply.

buttonViews

List of views corresponding to MessageButton objects stored in the in-app message model object. These views should map one to one with the MessageButton objects.

closeButton

The View responsible for closing the in-app message.

Constructors

Link copied to clipboard
fun DefaultInAppMessageViewWrapper(inAppMessageView: View, inAppMessage: IInAppMessage, inAppMessageViewLifecycleListener: IInAppMessageViewLifecycleListener, configurationProvider: BrazeConfigurationProvider, openingAnimation: Animation?, closingAnimation: Animation?, clickableInAppMessageView: View?, buttonViews: List<View>? = null, closeButton: View? = null)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
Link copied to clipboard
open fun addInAppMessageViewToViewGroup(parentViewGroup: ViewGroup, inAppMessage: IInAppMessage, inAppMessageView: View, inAppMessageViewLifecycleListener: IInAppMessageViewLifecycleListener)
Link copied to clipboard
open fun announceForAccessibilityIfNecessary(fallbackAccessibilityMessage: String? = "In app message displayed.")

Calls View.announceForAccessibility with the IInAppMessage.getMessage if the IInAppMessageView is IInAppMessageImmersiveView or the fallback message IInAppMessageView is a InAppMessageHtmlBaseView.

Link copied to clipboard
open override fun close()

Closes an IInAppMessage. As a result of this call, it is expected that an IInAppMessage is no longer visible and not interactable by the user.

Link copied to clipboard

Closes the in-app message view. In this order, the following actions are performed:

Link copied to clipboard
open fun finalizeViewBeforeDisplay(inAppMessage: IInAppMessage, inAppMessageView: View, inAppMessageViewLifecycleListener: IInAppMessageViewLifecycleListener)

Performs any last actions before calling IInAppMessageViewLifecycleListener.beforeOpened.

Link copied to clipboard
Link copied to clipboard

Gets the ViewGroup which will display the in-app message. Note that if this implementation is overridden, then DefaultInAppMessageViewWrapper.getLayoutParams should also most likely be overridden to match the ViewGroup subclass returned here.

Link copied to clipboard
open override fun open(activity: Activity)

Opens an IInAppMessage on the Activity. As a result of this call, it is expected that an IInAppMessage is visible and interactable by the user.

Link copied to clipboard
open fun setAndStartAnimation(opening: Boolean)

Instantiates and executes the correct animation for the current in-app message. Slideup-type messages slide in from the top or bottom of the view. Other in-app messages fade in and out of view.

Properties

Link copied to clipboard
open var buttonViews: List<View>? = null
Link copied to clipboard
Link copied to clipboard
open var closeButton: View? = null
Link copied to clipboard
Link copied to clipboard

The ViewGroup parent of the in-app message.

Link copied to clipboard
open var dismissRunnable: Runnable? = null
Link copied to clipboard
open override val inAppMessage: IInAppMessage
Link copied to clipboard
Link copied to clipboard
open override val inAppMessageView: View
Link copied to clipboard
open override var isAnimatingClose: Boolean = false
Link copied to clipboard
Link copied to clipboard
open var previouslyFocusedView: View? = null

The View that previously held focus before a message is displayed as given via Activity.getCurrentFocus.

Link copied to clipboard

A mapping of the view accessibility flags of views before overriding them. Used in conjunction with com.braze.configuration.BrazeConfig.Builder.setIsInAppMessageAccessibilityExclusiveModeEnabled