MediaView

public class MediaView extends FrameLayout

This class is deprecated.
Use MediaView.

View for displaying native app install ad media content. Add this view to the layout hierarchy, and register it using UnifiedNativeAdView.setMediaView(MediaView).

  1. If the returned ad contains a video element, the video will be automatically rendered on this MediaView. In the absence of MediaView, a fallback image will be returned in UnifiedNativeAd.getImages(). Therefore, to render a video, MediaView must be present in the layout hierarchy, and must be registered.
  2. If the returned ad does not contain a video element and contains images, MediaView will be used to automatically render the image.

Inherited Constant Summary

Inherited Field Summary

Public Constructor Summary

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

Public Method Summary

void
setImageScaleType(ImageView.ScaleType scaleType)
Sets the ImageView.ScaleType when image is rendered in MediaView.
void
setMediaContent(MediaContent mediaContent)
Sets the media content to be displayed in the media view.

Inherited Method Summary

Public Constructors

public MediaView (Context context)

public MediaView (Context context, AttributeSet attrs)

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

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

Public Methods

public void setImageScaleType (ImageView.ScaleType scaleType)

Sets the ImageView.ScaleType when image is rendered in MediaView. By default SDK uses ImageView.ScaleType.CENTER_INSIDE scaling type to images rendered in MediaView.

public void setMediaContent (MediaContent mediaContent)

Sets the media content to be displayed in the media view.