目录

SplashView

Class Info

public class SplashView

Splash ad view, which is used to load a splash ad. After an ad is loaded, the SDK automatically processes the ad and displays it based on the configuration.

Nested Class Summary

Qualifier and Type

Interface Name and Description

static class

SplashView.SplashAdLoadListener

Listener for splash ad loading.

Public Constructor Summary

Constructor Name

SplashView(Context context)

Constructs a SplashView object.

SplashView(Context context, AttributeSet attrs)

Constructs a SplashView object.

SplashView(Context context, AttributeSet attrs, int defStyleAttr)

Constructs a SplashView object.

Public Method Summary

Qualifier and Type

Method Name and Description

void

destroyView()

Destroys a view.

boolean

isLoaded()

Checks whether a splash ad has been loaded.

boolean

isLoading()

Checks whether an ad is being loaded.

void

load(String adId, int orientation, AdParam adParam, SplashAdLoadListener listener)

Loads and displays a splash ad. This method must be called in the UI thread.

void

pauseView()

Pauses a view.

void

resumeView()

Resumes a view.

void

setAdDisplayListener(SplashAdDisplayListener adDisplayListener)

Sets a listener for the splash ad display or click event.

void

setAudioFocusType(int audioFocusType)

Sets the audio focus type for a splash video ad.

void

setLogo(View logo)

Sets the logo area of the slogan. By default, the logo area is hidden.

void

setLogo(View logo, int defaultVisibility)

Sets the logo area of the slogan and specifies the visibility for the logo area.

void

setLogoResId(int logoResId)

Sets an app logo resource ID.

void

setMediaNameResId(int mediaNameResId)

Sets an app text resource ID.

void

setSloganResId(int resId)

Sets a default app launch image in portrait mode, which is displayed before a splash ad.

void

setWideSloganResId(int resId)

Sets a default app launch image in landscape mode, which is displayed before a splash ad.

BiddingInfo

@Deprecated

getBiddingInfo()

Obtains the real-time bidding data returned to the app.

CAUTION:

This method has been deprecated.

Public Constructors

[h2]SplashView(Context context)

Constructor

public SplashView(Context context)

Constructs a SplashView object.

Parameters

Name

Description

context

Context.

[h2]SplashView(Context context, AttributeSet attrs)

Constructor

public SplashView(Context context, AttributeSet attrs)

Constructs a SplashView object.

Parameters

Name

Description

context

Context.

attrs

View attribute set.

[h2]SplashView(Context context, AttributeSet attrs, int defStyleAttr)

Constructor

public SplashView(Context context, AttributeSet attrs, int defStyleAttr)

Constructs a SplashView object.

Parameters

Name

Description

context

Context.

attrs

View attribute set.

defStyleAttr

Default style.

Public Methods

[h2]destroyView

Method

public void destroyView()

Destroys a view.

[h2]isLoaded

Method

public boolean isLoaded()

Checks whether a splash ad has been loaded.

Returns

Type

Description

boolean

Whether an ad has been loaded.

  • true: yes
  • false: no

[h2]isLoading

Method

public boolean isLoading()

Checks whether an ad is being loaded.

Returns

Type

Description

boolean

Whether an ad is being loaded.

  • true: yes
  • false: no

[h2]load

Method

public void load(String adId, int orientation, AdParam adParam, SplashAdLoadListener listener)

Loads and displays a splash ad. This method must be called in the UI thread.

Parameters

Name

Description

adId

Ad unit ID.

orientation

Screen orientation.

adParam

Ad request parameter.

listener

Ad loading listener.

[h2]pauseView

Method

public void pauseView()

Pauses a view.

[h2]resumeView

Method

public void resumeView()

Resumes a view.

[h2]setAdDisplayListener

Method

public void setAdDisplayListener(SplashAdDisplayListener adDisplayListener)

Sets a listener for the splash ad display or click event.

Parameters

Name

Description

adDisplayListener

Listener for splash ad display.

[h2]setAudioFocusType

Method

public void setAudioFocusType(int audioFocusType)

Sets the audio focus type for a splash video ad.

Parameters

Name

Description

audioFocusType

Audio focus type. For details, please refer to AudioFocusType.

[h2]setLogo

Method

public void setLogo(View logo)

Sets the logo area of the slogan. By default, the logo area is hidden.

Parameters

Name

Description

logo

View instance of an app logo area.

[h2]setLogo(View logo, int defaultVisibility)

Method

public void setLogo(View logo, int defaultVisibility)

Sets the logo area of the slogan and specifies the visibility for the logo area.

Parameters

Name

Description

logo

View instance of an app logo area.

defaultVisibility

Visibility of the logo area.

  • View.VISIBLE: The logo area is visible.
  • View.INVISIBLE: The logo area is hidden, but retained.
  • View.GONE: The logo area is hidden and removed.

[h2]setLogoResId

Method

public void setLogoResId(int logoResId)

Sets an app logo resource ID.

Parameters

Name

Description

logoResId

App logo resource ID.

[h2]setMediaNameResId

Method

public void setMediaNameResId(int mediaNameResId)

Sets an app text resource ID.

Parameters

Name

Description

mediaNameResId

App text resource ID.

[h2]setSloganResId

Method

public void setSloganResId(int resId)

Sets a default app launch image in portrait mode, which is displayed before a splash ad.

Parameters

Name

Description

resId

Resource ID of a default app launch image.

[h2]setWideSloganResId

Method

public void setWideSloganResId(int resId)

Sets a default app launch image in landscape mode, which is displayed before a splash ad.

Parameters

Name

Description

resId

Resource ID of a default app launch image.

[h2]getBiddingInfo

Method

@Deprecated

public BiddingInfo getBiddingInfo()

Obtains the real-time bidding data returned to the app.

Returns

Type

Description

BiddingInfo

Real-time bidding information returned by the ADX.