public class CBWebViewProtocol extends CBViewProtocol
| Modifier and Type | Class and Description |
|---|---|
static interface |
CBWebViewProtocol.PlayerState |
class |
CBWebViewProtocol.WebViewBase |
CBViewProtocol.CBViewBase, CBViewProtocol.ImpressionAsset| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TAG |
animationRunnables, assets, impression, orientation, supportsLandscape, supportsPortrait, uiHandler, uiManager, viewOnPaused| Constructor and Description |
|---|
CBWebViewProtocol(CBImpression impression,
FileCache fileCache,
CBNetworkService networkRequestService,
SharedPreferences sharedPreferences,
CBTrack track,
Handler uiHandler,
CBUIManager uiManager,
CBViewController viewController) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
trigger an impression close
|
protected CBViewProtocol.CBViewBase |
createViewObject(Context context)
create the actual view object
|
void |
destroy()
make the view and its data ready for GC.
|
void |
error(java.lang.String message) |
int |
forceOrientationFromString(java.lang.String name) |
java.lang.String |
forceOrientationString(int orientation) |
java.lang.String |
getCurrentPosition()
getCurrentPosition method
The getCurrentPosition method will return the current position and size of the ad view,
measured in density-independent pixels.
|
java.lang.String |
getDefaultPosition()
getDefaultPosition method
The getDefaultPosition method returns the position and size of the default ad view,
measured in density-independent pixels, regardless of what state the calling view is in.
|
java.lang.String |
getMaxSize() |
java.lang.String |
getOrientationProperties() |
java.lang.String |
getScreenSize() |
float |
getVideoDuration() |
float |
getVideoPostion() |
CBWebViewProtocol.WebViewBase |
getView()
return the view associated with this view protocol
|
void |
impressionNotifyDidCompleteAd()
Notify didCompleteInterstitial or didCompleteRewardedVideo depends on the ad type
|
void |
impressionNotifyDidCompleteRewardedOnError()
In case of an error reported by webview, grant reward to a user only if rewarded ad was
already displayed
|
boolean |
onBackPressed()
return true if we should swallow the back button event
|
void |
onPause()
corresponds to host activity's onPause()
|
void |
onResume()
corresponds to host activity's onResume()
|
void |
onRewardedVideoCompleted() |
void |
onShowImpression() |
void |
onVideoCompleted()
Notify video completed used by interstitial and rewarded
|
boolean |
prepare(JSONObject unused_response)
prepare this view to load the given server JSON response
|
void |
sendReplayTrackEvent() |
void |
sendWebViewEvents(java.lang.String message) |
void |
sendWebViewVASTTrackingEvents(java.lang.String message) |
void |
setCurrentPlayerDuration(float duration) |
void |
setOrientationProperties(JSONObject properties) |
void |
setTotalPlayerDuration(float duration) |
void |
updatePlayerState(int newState) |
void |
warning(java.lang.String message) |
click, clickExchange, destroyView, display, fadeView, fail, getAssets, getOrientation, hexToColor, isBigScreen, runDisplayTask, setReadyToDisplay, showView, tryCreatingViewOnActivity, tryCreatingViewOnHostViewpublic static final java.lang.String TAG
public CBWebViewProtocol(CBImpression impression, FileCache fileCache, CBNetworkService networkRequestService, SharedPreferences sharedPreferences, CBTrack track, Handler uiHandler, CBUIManager uiManager, CBViewController viewController)
protected CBViewProtocol.CBViewBase createViewObject(Context context)
CBViewProtocolcreateViewObject in class CBViewProtocolpublic boolean prepare(JSONObject unused_response)
CBViewProtocolprepare in class CBViewProtocolpublic void close()
CBViewProtocolclose in class CBViewProtocolpublic void sendWebViewVASTTrackingEvents(java.lang.String message)
public void sendWebViewEvents(java.lang.String message)
public void error(java.lang.String message)
public void warning(java.lang.String message)
public java.lang.String getOrientationProperties()
public java.lang.String forceOrientationString(int orientation)
public int forceOrientationFromString(java.lang.String name)
public void setOrientationProperties(JSONObject properties)
public java.lang.String getMaxSize()
public java.lang.String getScreenSize()
public java.lang.String getDefaultPosition()
public java.lang.String getCurrentPosition()
public boolean onBackPressed()
CBViewProtocolonBackPressed in class CBViewProtocolpublic void onResume()
CBViewProtocolonResume in class CBViewProtocolpublic void onPause()
CBViewProtocolonPause in class CBViewProtocolpublic void onVideoCompleted()
public void onRewardedVideoCompleted()
public void impressionNotifyDidCompleteAd()
public void impressionNotifyDidCompleteRewardedOnError()
public void destroy()
CBViewProtocolCBViewProtocol.destroyView()destroy in class CBViewProtocolpublic void sendReplayTrackEvent()
public void updatePlayerState(int newState)
public CBWebViewProtocol.WebViewBase getView()
CBViewProtocolgetView in class CBViewProtocolpublic void setCurrentPlayerDuration(float duration)
public void setTotalPlayerDuration(float duration)
public float getVideoDuration()
getVideoDuration in class CBViewProtocolpublic float getVideoPostion()
getVideoPostion in class CBViewProtocolpublic void onShowImpression()