目录

CLASS info
public class SplashView
Splash ad view, which is used to load an ad. After an ad is loaded, the HUAWEI Ads SDK automatically processes and displays the ad based on the configuration.

Nested Class Summary

TypeNameDesc
ClassSplashView.SplashAdLoadListenerSplash ad loading listener.

Public Constructor Summary

Constructor name
SplashView(Context context)
Splash ad view constructor.
SplashView(Context context, AttributeSet attrs)
Splash ad view constructor.
SplashView(Context context, AttributeSet attrs, int defStyleAttr)
Splash ad view constructor.

Public Method Summary

Return typeMethod name
voidload(String adId, int orientation, AdParam adParam, SplashAdLoadListener listener)
Loads and displays a splash ad. This method must be called in the UI thread.
voidsetLogo(View logo)
Sets the logo area to be hidden.
voidsetLogo(View logo, int defaultVisibility)

Sets the logo area to be operated, and sets the visibility of the app logo.

voidsetLogoResId(int logoResId)
Sets an app logo resource ID.
voidsetMediaNameResId(int mediaNameResId)
Sets an app text resource ID.
voidsetSloganResId(int resId)
Sets a default app launch image in portrait mode, which is displayed before a splash ad is displayed.
voidsetWideSloganResId(int resId)
Sets a default app launch image in landscape mode, which is displayed before a splash ad is displayed.
booleanisLoading()
Checks whether a splash ad is being loaded.
booleanisLoaded()
Checks whether a splash ad has been loaded.
voidsetAdDisplayListener(SplashAdDisplayListener adDisplayListener)
Sets a listener for the splash ad display or click event.
voidsetAudioFocusType(int audioFocusType)
Sets the audio focus preemption policy for a video splash ad.
voidresumeView()
Resumes a view.
voidpauseView()
Suspends a view.
voiddestroyView()
Destroys a view.

Public Constructors

Constructor
public SplashView(Context context)
Splash ad view constructor.

Parameters

Parameter nameParameter desc
contextContext.
Constructor
public SplashView(Context context, AttributeSet attrs)
Splash ad view constructor.

Parameters

Parameter nameParameter desc
contextContext.
attrsView attribute set.
Constructor
public SplashView(Context context, AttributeSet attrs, int defStyleAttr)
Splash ad view constructor.

Parameters

Parameter nameParameter desc
contextContext.
attrsView attribute set.
defStyleAttrDefault style attribute.

Public Methods

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

Parameter nameParameter desc
adIdAd slot ID.
orientationScreen orientation.
adParamAd request parameter.
listenerSplash ad loading listener.
Method
public void setLogo(View logo)
Sets the logo area to be hidden.


Parameters

Parameter nameParameter desc
logoView instance of an app logo area.
Method
public void setLogo(View logo, int defaultVisibility)
Sets the logo area to be operated, and sets the visibility of the app logo.


Parameters

Parameter nameParameter desc
logoView 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.

Method
public void setLogoResId(int logoResId)
Sets an app logo resource ID.


Parameters

Parameter nameParameter desc
logoResIdApp logo resource ID.
Method
public void setMediaNameResId(int mediaNameResId)
Sets an app text resource ID.


Parameters

Parameter nameParameter desc
mediaNameResIdApp text resource ID.
Method
public void setSloganResId(int resId)
Sets a default app launch image in portrait mode, which is displayed before a splash ad is displayed.


Parameters

Parameter nameParameter desc
resIdResource ID of a default app launch image.
Method
public void setWideSloganResId(int resId)
Sets a default app launch image in landscape mode, which is displayed before a splash ad is displayed.


Parameters

Parameter nameParameter desc
resIdResource ID of a default app launch image.
Method
public boolean isLoading()
Checks whether a splash ad is being loaded.


Return

Parameter nameParameter desc
booleanIf the ad is being loaded, true is returned. Otherwise, false is returned.
Method
public boolean isLoaded()
Checks whether a splash ad has been loaded.


Return

Parameter nameParameter desc
booleanIf the ad has been loaded, true is returned. Otherwise, false is returned.
Method
public void setAdDisplayListener(SplashAdDisplayListener adDisplayListener)
Sets a listener for the splash ad display or click event.


Parameters

Parameter nameParameter desc
adDisplayListenerSplash ad display listener.
Method
public void setAudioFocusType(int audioFocusType)
Sets the audio focus preemption policy for a video splash ad.


Parameters

Parameter nameParameter desc
audioFocusTypeAudio focus preemption policy.
Method
public void resumeView()
Resumes a view.
Method
public void pauseView()
Suspends a view.
Method
public void destroyView()
Destroys a view.