Android APIs
public class

ImageCardView

extends BaseCardView
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ android.support.v17.leanback.widget.BaseCardView
           ↳ android.support.v17.leanback.widget.ImageCardView

Class Overview

A card view with an ImageView as its main region.

Summary

[Expand]
Inherited XML Attributes
From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Constants
From class android.support.v17.leanback.widget.BaseCardView
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
ImageCardView(Context context)
ImageCardView(Context context, AttributeSet attrs)
ImageCardView(Context context, AttributeSet attrs, int defStyle)
Public Methods
Drawable getBadgeImage()
CharSequence getContentText()
Drawable getInfoAreaBackground()
Drawable getMainImage()
final ImageView getMainImageView()
CharSequence getTitleText()
boolean hasOverlappingRendering()
Returns whether this View has content which overlaps.
void setBadgeImage(Drawable drawable)
void setContentText(CharSequence text)
void setInfoAreaBackground(Drawable drawable)
void setInfoAreaBackgroundColor(int color)
void setMainImage(Drawable drawable, boolean fade)
Set drawable with optional fade-in animation.
void setMainImage(Drawable drawable)
Set drawable with fade-in animation.
void setMainImageAdjustViewBounds(boolean adjustViewBounds)
void setMainImageDimensions(int width, int height)
void setMainImageScaleType(ImageView.ScaleType scaleType)
void setTitleText(CharSequence text)
Protected Methods
void onAttachedToWindow()
This is called when the view is attached to a window.
void onDetachedFromWindow()
This is called when the view is detached from a window.
[Expand]
Inherited Methods
From class android.support.v17.leanback.widget.BaseCardView
From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.view.ViewParent
From interface android.view.ViewManager
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource

Public Constructors

public ImageCardView (Context context)

public ImageCardView (Context context, AttributeSet attrs)

public ImageCardView (Context context, AttributeSet attrs, int defStyle)

Public Methods

public Drawable getBadgeImage ()

public CharSequence getContentText ()

public Drawable getInfoAreaBackground ()

public Drawable getMainImage ()

public final ImageView getMainImageView ()

public CharSequence getTitleText ()

public boolean hasOverlappingRendering ()

Returns whether this View has content which overlaps.

This function, intended to be overridden by specific View types, is an optimization when alpha is set on a view. If rendering overlaps in a view with alpha < 1, that view is drawn to an offscreen buffer and then composited into place, which can be expensive. If the view has no overlapping rendering, the view can draw each primitive with the appropriate alpha value directly. An example of overlapping rendering is a TextView with a background image, such as a Button. An example of non-overlapping rendering is a TextView with no background, or an ImageView with only the foreground image. The default implementation returns true; subclasses should override if they have cases which can be optimized.

The current implementation of the saveLayer and saveLayerAlpha methods in Canvas necessitates that a View return true if it uses the methods internally without passing the CLIP_TO_LAYER_SAVE_FLAG.

Returns
  • true if the content in this view might overlap, false otherwise.

public void setBadgeImage (Drawable drawable)

public void setContentText (CharSequence text)

public void setInfoAreaBackground (Drawable drawable)

public void setInfoAreaBackgroundColor (int color)

public void setMainImage (Drawable drawable, boolean fade)

Set drawable with optional fade-in animation.

public void setMainImage (Drawable drawable)

Set drawable with fade-in animation.

public void setMainImageAdjustViewBounds (boolean adjustViewBounds)

public void setMainImageDimensions (int width, int height)

public void setMainImageScaleType (ImageView.ScaleType scaleType)

public void setTitleText (CharSequence text)

Protected Methods

protected void onAttachedToWindow ()

This is called when the view is attached to a window. At this point it has a Surface and will start drawing. Note that this function is guaranteed to be called before onDraw(android.graphics.Canvas), however it may be called any time before the first onDraw -- including before or after onMeasure(int, int).

protected void onDetachedFromWindow ()

This is called when the view is detached from a window. At this point it no longer has a surface for drawing.