Class BaseJSInterface
- java.lang.Object
-
- org.prebid.mobile.rendering.views.webview.mraid.BaseJSInterface
-
- All Implemented Interfaces:
JSInterface
- Direct Known Subclasses:
BannerJSInterface,InterstitialJSInterface
public class BaseJSInterface extends java.lang.Object implements JSInterface
-
-
Field Summary
Fields Modifier and Type Field Description protected WebViewBaseadBaseViewprotected android.content.Contextcontextprotected PrebidWebViewBasedefaultAdContainer-
Fields inherited from interface org.prebid.mobile.rendering.views.webview.mraid.JSInterface
ACTION_CLOSE, ACTION_CREATE_CALENDAR_EVENT, ACTION_EXPAND, ACTION_GET_CURRENT_POSITION, ACTION_GET_DEFAULT_POSITION, ACTION_GET_MAX_SIZE, ACTION_GET_PLACEMENT_TYPE, ACTION_GET_SCREEN_SIZE, ACTION_OPEN, ACTION_ORIENTATION_CHANGE, ACTION_PLAY_VIDEO, ACTION_RESIZE, ACTION_STORE_PICTURE, ACTION_UNLOAD, DEVICE_ORIENTATION, DEVICE_ORIENTATION_LOCKED, JSON_HEIGHT, JSON_IS_MODAL, JSON_METHOD, JSON_VALUE, JSON_WIDTH, JSON_X, JSON_Y, LOCATION_ACCURACY, LOCATION_ERROR, LOCATION_LASTFIX, LOCATION_LAT, LOCATION_LON, LOCATION_TYPE, STATE_DEFAULT, STATE_EXPANDED, STATE_HIDDEN, STATE_LOADING, STATE_RESIZED
-
-
Constructor Summary
Constructors Constructor Description BaseJSInterface(android.content.Context context, WebViewBase adBaseView, JsExecutor jsExecutor)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()voidcreateCalendarEvent(java.lang.String parameters)voiddestroy()voidexpand()voidexpand(java.lang.String url)voidfollowToOriginalUrl(java.lang.String url, RedirectUrlListener listener)java.lang.StringgetCurrentAppOrientation()java.lang.StringgetCurrentPosition()PrebidWebViewBasegetDefaultAdContainer()android.view.ViewGroup.LayoutParamsgetDefaultLayoutParams()java.lang.StringgetDefaultPosition()JsExecutorgetJsExecutor()java.lang.StringgetLocation()java.lang.StringgetMaxSize()MraidVariableContainergetMraidVariableContainer()java.lang.StringgetPlacementType()android.view.ViewGroupgetRootView()MraidScreenMetricsgetScreenMetrics()java.lang.StringgetScreenSize()voidhandleScreenViewabilityChange(boolean isViewable)voidjavaScriptCallback(java.lang.String handlerHash, java.lang.String method, java.lang.String value)voidloading()protected voidnotifyScreenMetricsChanged()voidonError(java.lang.String message, java.lang.String action)voidonOrientationPropertiesChanged(java.lang.String properties)voidonReadyExpanded()voidonStateChange(java.lang.String state)voidopen(java.lang.String url)voidplayVideo(java.lang.String url)voidprepareAndSendReady()voidresize()voidsetDefaultLayoutParams(android.view.ViewGroup.LayoutParams originalParentLayoutParams)voidshouldUseCustomClose(java.lang.String useCustomClose)Deprecated.voidstorePicture(java.lang.String url)booleansupports(java.lang.String feature)voidunload()voidupdateScreenMetricsAsync(java.lang.Runnable successRunnable)Updates screen metrics, calling the successRunnable once they are available.
-
-
-
Field Detail
-
context
protected android.content.Context context
-
adBaseView
protected WebViewBase adBaseView
-
defaultAdContainer
protected PrebidWebViewBase defaultAdContainer
-
-
Constructor Detail
-
BaseJSInterface
public BaseJSInterface(android.content.Context context, WebViewBase adBaseView, JsExecutor jsExecutor)
-
-
Method Detail
-
getMaxSize
public java.lang.String getMaxSize()
- Specified by:
getMaxSizein interfaceJSInterface
-
getScreenSize
public java.lang.String getScreenSize()
- Specified by:
getScreenSizein interfaceJSInterface
-
getDefaultPosition
public java.lang.String getDefaultPosition()
- Specified by:
getDefaultPositionin interfaceJSInterface
-
getCurrentPosition
public java.lang.String getCurrentPosition()
- Specified by:
getCurrentPositionin interfaceJSInterface
-
onOrientationPropertiesChanged
public void onOrientationPropertiesChanged(java.lang.String properties)
- Specified by:
onOrientationPropertiesChangedin interfaceJSInterface
-
getPlacementType
public java.lang.String getPlacementType()
- Specified by:
getPlacementTypein interfaceJSInterface
-
close
public void close()
- Specified by:
closein interfaceJSInterface
-
resize
public void resize()
- Specified by:
resizein interfaceJSInterface
-
expand
public void expand()
- Specified by:
expandin interfaceJSInterface
-
expand
public void expand(java.lang.String url)
- Specified by:
expandin interfaceJSInterface
-
open
public void open(java.lang.String url)
- Specified by:
openin interfaceJSInterface
-
javaScriptCallback
public void javaScriptCallback(java.lang.String handlerHash, java.lang.String method, java.lang.String value)- Specified by:
javaScriptCallbackin interfaceJSInterface
-
createCalendarEvent
public void createCalendarEvent(java.lang.String parameters)
- Specified by:
createCalendarEventin interfaceJSInterface
-
storePicture
public void storePicture(java.lang.String url)
- Specified by:
storePicturein interfaceJSInterface
-
supports
public boolean supports(java.lang.String feature)
- Specified by:
supportsin interfaceJSInterface
-
playVideo
public void playVideo(java.lang.String url)
- Specified by:
playVideoin interfaceJSInterface
-
shouldUseCustomClose
@Deprecated public void shouldUseCustomClose(java.lang.String useCustomClose)
Deprecated.- Specified by:
shouldUseCustomClosein interfaceJSInterface
-
getLocation
public java.lang.String getLocation()
- Specified by:
getLocationin interfaceJSInterface
-
getCurrentAppOrientation
public java.lang.String getCurrentAppOrientation()
- Specified by:
getCurrentAppOrientationin interfaceJSInterface
-
unload
public void unload()
- Specified by:
unloadin interfaceJSInterface
-
onStateChange
public void onStateChange(java.lang.String state)
-
handleScreenViewabilityChange
public void handleScreenViewabilityChange(boolean isViewable)
-
getMraidVariableContainer
public MraidVariableContainer getMraidVariableContainer()
-
getScreenMetrics
public MraidScreenMetrics getScreenMetrics()
-
getDefaultAdContainer
public PrebidWebViewBase getDefaultAdContainer()
-
onError
public void onError(java.lang.String message, java.lang.String action)
-
followToOriginalUrl
public void followToOriginalUrl(java.lang.String url, RedirectUrlListener listener)
-
setDefaultLayoutParams
public void setDefaultLayoutParams(android.view.ViewGroup.LayoutParams originalParentLayoutParams)
-
getDefaultLayoutParams
public android.view.ViewGroup.LayoutParams getDefaultLayoutParams()
-
getRootView
public android.view.ViewGroup getRootView()
-
getJsExecutor
public JsExecutor getJsExecutor()
-
loading
public void loading()
-
onReadyExpanded
public void onReadyExpanded()
-
prepareAndSendReady
public void prepareAndSendReady()
-
updateScreenMetricsAsync
public void updateScreenMetricsAsync(java.lang.Runnable successRunnable)
Updates screen metrics, calling the successRunnable once they are available. The successRunnable will always be called asynchronously, ie on the next main thread loop.
-
destroy
public void destroy()
-
notifyScreenMetricsChanged
protected void notifyScreenMetricsChanged()
-
-