public abstract class BaseView extends RelativeLayout implements BaseViewInterface
BannerView
and
FullScreenBanner
.Modifier and Type | Field and Description |
---|---|
protected Handler |
handler
Handler for receiving messages from ORMMA/MRAID and timers.
|
protected AdDownloaderInterface |
mAdDownloader
Interface for the ad downloader used by the loading state machine.
|
boolean |
mAttachedToWindow
Holds whether the banner recently added or exists.
|
protected int |
mBackgroundColor
Default background color.
|
protected BannerState |
mBannerStateMachine
State machine representing the state of banner display.
|
protected AbstractBannerPackage |
mCurrentPackage
The current banner beeing displayed.
|
protected float |
mDensity
Holds the current screen density.
|
protected LoadingState |
mLoadingStateMachine
State machine representing the state of the banner requests.
|
protected AbstractBannerPackage |
mNextPackage
The next banner that should be displayed on screen.
|
protected BannerStateListener |
mStateListenerReference
Banner State Listener.
|
Modifier | Constructor and Description |
---|---|
protected |
BaseView(Context context)
Creates an instance of this class.
|
protected |
BaseView(Context context,
AttributeSet attrs)
Creates an instance of this class.
|
protected |
BaseView(Context context,
AttributeSet attrs,
int defStyle)
Creates an instance of this class.
|
Modifier and Type | Method and Description |
---|---|
void |
addAdListener(AdListenerInterface adListener)
register an ad listener.
|
protected boolean |
asyncLoadBeacon()
Download beacons.
|
void |
asyncLoadNewBanner()
Load a new banner.
|
protected void |
closeInternalBrowser()
Common method to Banners to open and close the Banners in internal Browser except Interstitial
Called from handle() method of Banners for msg as Values.MESSAGE_EXPAND
|
void |
destroy() |
AdDownloaderInterface |
getAdDownloader()
return current
AdDownloaderInterface . |
AdSettings |
getAdSettings()
return the current
AdSettings . |
int |
getBackgroundColor()
return the background color code.
|
abstract Handler |
getBannerAnimatorHandler()
Get the banner animator handler.
|
BannerState |
getBannerState()
return
BannerState . |
BannerStateListener |
getBannerStateListener()
Get the banner state listener.
|
AbstractBannerPackage |
getCurrentPackage()
return The current banner
AbstractBannerPackage . |
protected LoadingState |
getLoadingState()
return
LoadingState . |
protected AbstractBannerPackage |
getNextPackage()
return next
AbstractBannerPackage . |
UserSettings |
getUserSettings()
return the current
UserSettings . |
protected void |
initBannerState(BannerState bannerState)
Set the current Banner State.
|
protected void |
initBannerView()
Initializes the BannerView object.
|
protected void |
isBannerIdle() |
boolean |
isLocationUpdateEnabled()
return true if the location update is enabled, false otherwise.
|
boolean |
isScalingEnabled()
Return
true if scaling is enabled, false otherwise. |
protected void |
onAttachedToWindow() |
protected void |
onDetachedFromWindow() |
protected void |
openInternalBrowser()
Common method to Banners to open and close the Banners in internal Browser except Interstitial
Called from handle() method of Banners for msg as Values.MESSAGE_EXPAND
|
protected void |
pauseAutoReload()
Implementation in
BannerView . |
protected void |
registerImpression() |
boolean |
removeAdListener(AdListenerInterface adListener)
remove a specified ad listener.
|
void |
setAdSettings(AdSettings adSettings)
set the request ad settings.
|
void |
setBackgroundColor(int color)
setBackgroundColor modify banner background.
|
protected void |
setBannerAnimatorHandler(Handler handler)
Set the current banner Handler.
|
void |
setBannerStateListener(BannerStateListener listener)
Set the banner state listener.
|
protected void |
setCurrentPackage(AbstractBannerPackage currentPackage)
set the current Banner Package.
|
protected void |
setLoadingStateMachine(LoadingState loadingState)
Set the current
LoadingState . |
void |
setLocationUpdateEnabled(boolean updateEnabled)
activate / deactivate the location update.
|
protected void |
setNextPackage(AbstractBannerPackage bannerPackage)
Set next banner package.
|
void |
setScalingEnabled(boolean mScaleEnabled)
(non-Javadoc).
|
void |
setSOMAEndPoint(java.lang.String somaEndPoint) |
void |
setUserSettings(UserSettings userSettings)
set the request ad settings.
|
protected void |
startMoatTracking() |
protected void |
stopMoatTracking() |
protected boolean |
switchViews()
Used to order switch views.
|
protected BannerStateListener mStateListenerReference
protected AdDownloaderInterface mAdDownloader
public boolean mAttachedToWindow
BannerView(),
protected BannerState mBannerStateMachine
protected LoadingState mLoadingStateMachine
protected AbstractBannerPackage mCurrentPackage
protected AbstractBannerPackage mNextPackage
protected Handler handler
protected float mDensity
protected int mBackgroundColor
protected BaseView(Context context, AttributeSet attrs, int defStyle)
protected BaseView(Context context, AttributeSet attrs)
protected BaseView(Context context)
public void setSOMAEndPoint(java.lang.String somaEndPoint)
protected void initBannerView()
BannerView(Context, AttributeSet, int),
BannerView(Context,AttributeSet),
BannerView(Context)
public final BannerState getBannerState()
BannerState
.public final void setBannerStateListener(BannerStateListener listener)
setBannerStateListener
in interface BaseViewInterface
listener
- the BannerStateListener
to register.public final BannerStateListener getBannerStateListener()
BannerStateListener
public final void addAdListener(AdListenerInterface adListener)
adListener
- to register.
otherwise.public final boolean removeAdListener(AdListenerInterface adListener)
adListener
- to remove.true
if the Listener was added, false
otherwise.public void asyncLoadNewBanner()
public final void setLocationUpdateEnabled(boolean updateEnabled)
updateEnabled
- true to enable, false otherwise.public final boolean isLocationUpdateEnabled()
public final AdSettings getAdSettings()
AdSettings
.public final UserSettings getUserSettings()
UserSettings
.public final void setUserSettings(UserSettings userSettings)
userSettings
- set ad setting.AdSettings
public final void setAdSettings(AdSettings adSettings)
adSettings
- set ad setting.AdSettings
protected final LoadingState getLoadingState()
LoadingState
.protected boolean switchViews()
protected void pauseAutoReload()
BannerView
.protected void registerImpression()
protected void startMoatTracking()
protected void stopMoatTracking()
protected boolean asyncLoadBeacon()
protected void setLoadingStateMachine(LoadingState loadingState)
LoadingState
.loadingState
- LoadingState
protected void openInternalBrowser()
protected void closeInternalBrowser()
public final AbstractBannerPackage getCurrentPackage()
AbstractBannerPackage
.protected final void setCurrentPackage(AbstractBannerPackage currentPackage)
currentPackage
- AbstractBannerPackage
protected final AbstractBannerPackage getNextPackage()
AbstractBannerPackage
.protected final void setNextPackage(AbstractBannerPackage bannerPackage)
bannerPackage
- AbstractBannerPackage
public final AdDownloaderInterface getAdDownloader()
AdDownloaderInterface
.protected final void initBannerState(BannerState bannerState)
bannerState
- BannerState
public final void setBackgroundColor(int color)
setBackgroundColor
in interface BaseViewInterface
color
- color code.public final int getBackgroundColor()
getBackgroundColor
in interface BaseViewInterface
public abstract Handler getBannerAnimatorHandler()
Handler
.protected void setBannerAnimatorHandler(Handler handler)
handler
- protected void isBannerIdle()
public boolean isScalingEnabled()
true
if scaling is enabled, false otherwise.isScalingEnabled
in interface BaseViewInterface
public final void setScalingEnabled(boolean mScaleEnabled)
setScalingEnabled
in interface BaseViewInterface
com.smaato.soma.StandardPublisherMethods#setScalingEnabled(boolean)
protected void onDetachedFromWindow()
protected void onAttachedToWindow()
public void destroy()