目录

NativeView

Class Info

public class NativeView extends PPSNativeView implements INativeView

Native ad view.

Public Constructor Summary

Constructor Name

NativeView(Context context)

Constructs a NativeView object.

NativeView(Context context, AttributeSet attrs)

Constructs a NativeView object.

NativeView(Context context, AttributeSet attrs, int defStyleAttr)

Constructs a NativeView object.

NativeView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Constructs a NativeView object.

Public Method Summary

Qualifier and Type

Method Name and Description

void

destroy()

Destroys a NativeView object. After this method is called, no other methods can be called.

View

getAdSourceView()

Obtains an ad source view.

View

getCallToActionView()

Obtains a button view.

View

getDescriptionView()

Obtains an ad description view.

View

getIconView()

Obtains a view containing small icons.

View

getImageView()

Obtains an ad image view.

MediaView

getMediaView()

Obtains a multimedia content view.

View

getTitleView()

Obtains a title view.

void

gotoWhyThisAdPage()

Goes to the page explaining why an ad is displayed.

boolean

register(AppDownloadButton appDownloadButton)

Registers the app download button with NativeView to implement download and installation.

void

setAdSourceView(View adSourceView)

Sets an ad source view.

void

setCallToActionView(View view)

Sets a button view.

void

setDescriptionView(View descriptionView)

Sets an ad description view.

void

setIconView(View view)

Sets a view containing small icons.

void

setImageView(View view)

Sets an ad image view.

void

setMediaView(MediaView view)

Sets a multimedia content view.

void

setNativeAd(NativeAd nativeAd)

Sets a native ad.

void

setTitleView(View view)

Sets a title view.

void

unregister(AppDownloadButton appDownloadButton)

Unregisters the app download button from NativeView.

void

showAdvertiserInfoDialog(View anchorView, boolean showWhyThisAd)

Displays the advertiser information dialog box.

void

hideAdvertiserInfoDialog()

Hides the advertiser information dialog box.

void

setAdFeedbackListener(AdFeedbackListener listener)

Sets a negative feedback listener.

void

setAdCloseBtnClickListener(AdCloseBtnClickListener listener)

Sets a listener for ad closing.

Public Constructors

[h2]NativeView(Context context)

Constructor

public NativeView(Context context)

Constructs a NativeView object.

Parameters

Name

Description

context

Context.

[h2]NativeView(Context context, AttributeSet attrs)

Method

public NativeView(Context context, AttributeSet attrs)

Constructs a NativeView object.

Parameters

Name

Description

context

Context.

attrs

Attributes in an XML tag of an extended view.

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

Method

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

Constructs a NativeView object.

Parameters

Name

Description

context

Context.

attrs

Attributes in an XML tag of an extended view.

defStyleAttr

Default style.

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

Method

public NativeView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Constructs a NativeView object.

Parameters

Name

Description

context

Context.

attrs

Attributes in an XML tag of an extended view.

defStyleAttr

Default style.

defStyleRes

Resource ID.

Public Methods

[h2]destroy

Method

public void destroy()

Destroys a NativeView object. After this method is called, no other methods can be called.

[h2]getAdSourceView

Method

public View getAdSourceView()

Obtains an ad source view.

Returns

Type

Description

View

Ad source view.

[h2]getCallToActionView

Method

public View getCallToActionView()

Obtains a button view.

Returns

Type

Description

View

Button view.

[h2]getDescriptionView

Method

public View getDescriptionView()

Obtains an ad description view.

Returns

Type

Description

View

Ad description view.

[h2]getIconView

Method

public View getIconView()

Obtains a view containing small icons.

Returns

Type

Description

View

View containing small icons.

[h2]getImageView

Method

public View getImageView()

Obtains an ad image view.

Returns

Type

Description

View

Ad image view.

[h2]getMediaView

Method

public MediaView getMediaView()

Obtains a multimedia content view.

Returns

Type

Description

MediaView

Multimedia content view.

[h2]getTitleView

Method

public View getTitleView()

Obtains a title view.

Returns

Type

Description

View

Title view.

[h2]gotoWhyThisAdPage

Method

public void gotoWhyThisAdPage()

Goes to the page explaining why an ad is displayed.

[h2]register

Method

public boolean register(AppDownloadButton appDownloadButton)

Registers the app download button with NativeView to implement download and installation.

Parameters

Name

Description

appDownloadButton

App download button.

Returns

Type

Description

boolean

Whether the registration is successful.

  • true: yes
  • false: no

[h2]setAdSourceView

Method

public void setAdSourceView(View adSourceView)

Sets an ad source view.

Parameters

Name

Description

adSourceView

Ad source view.

[h2]setCallToActionView

Method

public void setCallToActionView(View view)

Sets a button view.

Parameters

Name

Description

view

Button view.

[h2]setDescriptionView

Method

public void setDescriptionView(View descriptionView)

Sets an ad description view.

Parameters

Name

Description

descriptionView

Ad description view.

[h2]setIconView

Method

public void setIconView(View view)

Sets a view containing small icons.

Parameters

Name

Description

view

View containing small icons.

[h2]setImageView

Method

public void setImageView(View view)

Sets an ad image view.

Parameters

Name

Description

view

Ad image view.

[h2]setMediaView

Method

public void setMediaView(MediaView view)

Sets a multimedia content view.

Parameters

Name

Description

view

Multimedia content view.

[h2]setNativeAd

Method

public void setNativeAd(NativeAd nativeAd)

Sets a native ad.

Parameters

Name

Description

nativeAd

Native ad object that has been obtained.

[h2]setTitleView

Method

public void setTitleView(View view)

Sets a title view.

Parameters

Name

Description

view

Title view.

[h2]unregister

Method

public void unregister(AppDownloadButton appDownloadButton)

Unregisters the app download button from NativeView.

Parameters

Name

Description

appDownloadButton

App download button.

[h2]showAdvertiserInfoDialog

Method

public void showAdvertiserInfoDialog(View anchorView, boolean showWhyThisAd)

Displays the advertiser information dialog box.

Parameters

Name

Description

anchorView

Anchor view. The dialog box is displayed based on the anchor view position.

showWhyThisAd

Indicates whether the advertiser information dialog box displays the reason why the advertiser sees the ad.

[h2]hideAdvertiserInfoDialog

Method

public void hideAdvertiserInfoDialog()

Hides the advertiser information dialog box.

[h2]setAdFeedbackListener

Method

public void setAdFeedbackListener (AdFeedbackListener listener)

Sets a negative feedback listener.

Parameters

Name

Description

listener

Negative feedback listener.

[h2]setAdCloseBtnClickListener

Method

public void setAdCloseBtnClickListener (AdCloseBtnClickListener listener)

Sets a listener for ad closing.

Parameters

Name

Description

listener

Listener for ad closing.