SASAdView

abstract class SASAdView : FrameLayout, SCSViewabilityManagerListener, SCSCustomerFeedbackController.SCSCustomerFeedbackControllerListener

This abstract class is an Android View in charge of loading and displaying ads.

Inheritors

Constructors

Link copied to clipboard
constructor(@NonNull context: Context)
Creates a SASAdView instance
constructor(@NonNull context: Context, @Nullable attributeSet: AttributeSet)
Constructor for creation in the XML layout file

Types

Link copied to clipboard
interface MessageHandler
Interface definition for classes handling multi-purpose messages sent by SASAdView instances
Link copied to clipboard
Listener that is notified when the video is prepared and completed.
Link copied to clipboard
interface OnCrashListener
Interface for Objects handling fatal crashes that occurred on underlying WebViews of the passed SASAdView and caught by appropriate WebViewClient
Link copied to clipboard
open class StateChangeEvent
Event fired by the SASAdView when its states changes.
Link copied to clipboard
interface VideoEvents
Interface defining video events

Properties

Link copied to clipboard
open val closeButton: SASCloseButton
Link copied to clipboard
Bitmask constant specifying that this view should remain horizontally centered the expand method is called.
Link copied to clipboard
Bitmask constant specifying that this view should remain aligned to its left border when the expand method is called.
Link copied to clipboard
Bitmask constant specifying that the view should remain aligned to its right border when the expand method is called.
Link copied to clipboard
Bitmask constant specifying that this view should expand upwards when the expand method is called.
Link copied to clipboard
Bitmask constant specifying that this view should expand downwards when the expand method is called.
Link copied to clipboard
Link copied to clipboard
Application set OnCrashListener to be notified when any of the internal webviews has crashed.

Functions

Link copied to clipboard
open fun close()
Closes this ad view (according to MRAID specifications)
Link copied to clipboard
open fun collapse()
Collapses this ad view, if was expanded,according to MRAID specifications.
Link copied to clipboard
open fun dismissStickyMode(animate: Boolean)
deactivate sticky mode and disable it until this SASADView load a new ad
Link copied to clipboard
Utility method to execute a runnable on the Android main thread (UI thread).
Link copied to clipboard
open fun expand(width: Int, height: Int, lockOrientation: Boolean)
Expands this SASAdView to the specified size and locks activity orientation if specified
open fun expand(@Nullable url: String, width: Int, height: Int)
Expands this SASAdView to the specified size and opens url (if not null) in the internal browser
open fun expand(@Nullable url: String, width: Int, height: Int, lockOrientation: Boolean)
open fun expand(@Nullable url: String, width: Int, height: Int, lockOrientation: Boolean, @Nullable forceOrientation: String)
open fun expand(@Nullable url: String, width: Int, height: Int, offsetX: Int, offsetY: Int, useExpandPolicy: Boolean, allowOffscreen: Boolean, lockOrientation: Boolean, @Nullable forceOrientation: String, isModal: Boolean)
Expands this SASAdView to the specified size and opens url (if not null) in the internal browser, and locks activity orientation if specified
Link copied to clipboard
Returns the custom Bitmap used for the close button in all SASAdView instances
Link copied to clipboard
Returns the custom Drawable used for the close button in all SASAdView instances
Link copied to clipboard
Returns the current SASAdElement being displayed by this SASAdView
Link copied to clipboard
Returns the current SASAdPlacement being displayed by this SASAdView
Link copied to clipboard
Returns the current bounds of this SASAdView with respect to its top container
Link copied to clipboard
Returns the default bounds of this SASAdView (when it is not expanded or resized) with respect to its top container
Link copied to clipboard
Returns the FrameLayout parent container in which this SASAdView will place itself when switching to StateChangeEvent#VIEW_EXPANDED state.
Link copied to clipboard
open fun getExpandPolicy(): Int
Returns the current anchor position when expanding this view (non full screen)
Link copied to clipboard
Returns the SASFormatType expected by this SASAdView
Link copied to clipboard
Returns the View that is displayed on top of this ad view while the ad is being fetched
Link copied to clipboard
Gets the MessageHandler instance on this SASAdView
Link copied to clipboard
open fun getOptimalHeight(): Int
Given the current width of this SASAdView and the current creative loaded (if any), returns the recommended height (in pixels) for this SASAdView to respect the creative's ratio (portrait as well as landscape if different)
open fun getOptimalHeight(width: Int): Int
Given specified width in parameter and the current creative loaded (if any), returns the recommended height (in pixels) for this SASAdView to respect the creative's ratio (portrait as well as landscape if different)
Link copied to clipboard
open fun getRatio(): Double
Returns the optimal ratio for this SASAdView to respect the creative ratio in the current screen orientation You can leverage this value to adapt the size of the SASAdView instance to fit the displayed creative
Link copied to clipboard
open fun handleKeyUpEvent(keyCode: Int, @NonNull event: KeyEvent)
Handle hardware keys keyUp events.
Link copied to clipboard
abstract fun installLoaderView(@NonNull loaderView: View)
Installs the specified loader view in the application.
Link copied to clipboard
Returns whether an expanded ad should be closed when the ad is clicked.
Link copied to clipboard
open fun isExpanded(): Boolean
Returns whether this SASAdView is in expanded state
Link copied to clipboard
Link copied to clipboard
open fun isResized(): Boolean
Returns whether this SASAdView is in resized state
Link copied to clipboard
Returns whether the Unity compatibility mode is enabled.
Link copied to clipboard
Wether the SDK activate or not zOrderOnTop value for internal VideoView
Link copied to clipboard
open fun loadAd(@NonNull biddingAdResponse: SASBiddingAdResponse)
Loads the ad contained in the adElementWrapper of the given SASBiddingAdResponse.
open fun loadAd(@NonNull adPlacement: SASAdPlacement)
open fun loadAd(@NonNull adPlacement: SASAdPlacement, @Nullable securedTransactionToken: String)
Loads an ad in this SASAdView.
open fun loadAd(@NonNull adPlacement: SASAdPlacement, @Nullable bidderAdapter: SASBidderAdapter)
open fun loadAd(@NonNull adPlacement: SASAdPlacement, @Nullable bidderAdapter: SASBidderAdapter, @Nullable securedTransactionToken: String)
Loads an ad in this SASAdView using a bidder adapter.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun onDestroy()
This method must be called when the activity (that this view is attached to) is destroyed (typically in the onDestroy() method of the activity).
Link copied to clipboard
open fun onKeyPreIme(keyCode: Int, @NonNull event: KeyEvent): Boolean
Link copied to clipboard
open fun open(@Nullable url: String)
Opens the specified URL in an internal WebView browser within the application
Link copied to clipboard
open fun raiseError(@NonNull errorMessage: String, @NonNull javascriptEvent: String)
Raise an error which is forwarded to the mraid javascript bridge.
Link copied to clipboard
abstract fun removeLoaderView(@NonNull loaderView: View)
Removes the specified loader view from the application.
Link copied to clipboard
open fun removeStateChangeListener(@NonNull stateListener: SASAdView.OnStateChangeListener): Boolean
Removes a specified OnStateChangeListener from this view
Link copied to clipboard
open fun reset()
Collapses this view and prepares it for a fresh loadAd call.
Link copied to clipboard
open fun sendJavascriptEvent(@NonNull eventName: String, @Nullable parameters: ArrayList<String>)
Send javascript event to the bridge.
Link copied to clipboard
open fun sendMessageToWebView(@NonNull message: String)
Sends a message to the WebView.
Link copied to clipboard
Allow or disallow the SASAdView to intercept Android back button action to close/collapse in full screen expand cases (instead of letting the host activity to decide) Default is true.
Link copied to clipboard
open fun setCloseButtonBitmap(@Nullable closeButtonBitmap: Bitmap)
Sets a custom Bitmap for the close button used in all SASAdView instances.
Link copied to clipboard
open fun setCloseButtonDrawable(@Nullable closeButtonDrawable: Drawable)
Sets a custom Drawable for the close button used in all SASAdView instances.
Link copied to clipboard
open fun setCloseOnclick(closeOnclick: Boolean)
Sets whether an expanded ad should be closed when the ad is clicked
Link copied to clipboard
open fun setExpandParentContainer(@Nullable expandParentContainer: FrameLayout)
Sets the FrameLayout parent container in which this SASAdView will place itself when switching to StateChangeEvent#VIEW_EXPANDED state.
Link copied to clipboard
open fun setExpandPolicy(expandPolicy: Int)
Sets the layout policy to apply when expanding this view (not used when expanding full screen)
Link copied to clipboard
Link copied to clipboard
open fun setLoaderView(@Nullable loaderView: View)
Sets the View that is displayed on top of this ad view while the ad is being fetched
Link copied to clipboard
Sets the MessageHandler instance on this SASAdView
Link copied to clipboard
open fun setStickyModeAnchorView(@Nullable stickyModeAnchorView: ViewGroup)
Sets the ViewGroup acting as boundaries for sticky mode.
Link copied to clipboard
open fun setUnityModeEnabled(unityModeEnabled: Boolean)
Enable or disable the Unity compatibility mode.