Hide

Card

Added in API level XE12
public class

Card

This class was deprecated in API level XE21.
Use CardBuilder to build Glass-styled card layouts. This class will be removed in a future release.

Nested Classes
enum Card.ImageLayout This enum was deprecated in API level XE21. Use CardBuilder.Layout to specify how the card's content should be laid out.  
Public Constructors
Card(Context context)
This constructor was deprecated in API level XE21. Use CardBuilder(Context, Layout) to specify how the card's content should be laid out.
Public Methods
Card
addImage(Bitmap imageBitmap)
Card
addImage(Drawable imageDrawable)
Card
addImage(int imageId)
CharSequence
getFootnote()
This method was deprecated in API level XE21. The Card class (and its replacement, CardBuilder) are intended to act as a View builder, not a data model object. The get* methods for these attributes will no longer be available after the Card class is removed.
Drawable
getImage(int n)
This method was deprecated in API level XE21. The Card class (and its replacement, CardBuilder) are intended to act as a View builder, not a data model object. The get* methods for these attributes will no longer be available after the Card class is removed.
int
getImageCount()
This method was deprecated in API level XE21. The Card class (and its replacement, CardBuilder) are intended to act as a View builder, not a data model object. The get* methods for these attributes will no longer be available after the Card class is removed.
Card.ImageLayout
getImageLayout()
This method was deprecated in API level XE21. Use CardBuilder.Layout to specify how the card's content should be laid out.
CharSequence
getText()
This method was deprecated in API level XE21. The Card class (and its replacement, CardBuilder) are intended to act as a View builder, not a data model object. The get* methods for these attributes will no longer be available after the Card class is removed.
CharSequence
getTimestamp()
This method was deprecated in API level XE21. The Card class (and its replacement, CardBuilder) are intended to act as a View builder, not a data model object. The get* methods for these attributes will no longer be available after the Card class is removed.
Card
Card
setFootnote(int footnoteId)
Card
setImageLayout(Card.ImageLayout imageLayout)
This method was deprecated in API level XE21. Use CardBuilder.Layout to specify how the card's content should be laid out.
Card
setText(int textId)
Card
Card
setTimestamp(int timestampId)
Card
Inherited Methods

Public Constructors

Added in API level XE12

public Card (Context context)

This constructor was deprecated in API level XE21.
Use CardBuilder(Context, Layout) to specify how the card's content should be laid out.

Public Methods

Added in API level XE16

public Card addImage (Bitmap imageBitmap)

Adds an image, specified as a Bitmap, to the card.

Parameters
imageBitmap the Bitmap image to add
Returns
  • this object for call chaining
Added in API level XE16

public Card addImage (Drawable imageDrawable)

Adds an image, specified as a Drawable, to the card.

This method only applies to cards that are converted into views using getView(). RemoteViews built by CardBuilder only support Bitmap and resource-based images. Drawable images on RemoteViews are not supported.

Parameters
imageDrawable the Drawable image to add
Returns
  • this object for call chaining
Added in API level XE12

public Card addImage (int imageId)

Adds an image, specified as a drawable resource, to the card.

Parameters
imageId the resource ID of the image to add
Returns
  • this object for call chaining
Added in API level XE12

public CharSequence getFootnote ()

This method was deprecated in API level XE21.
The Card class (and its replacement, CardBuilder) are intended to act as a View builder, not a data model object. The get* methods for these attributes will no longer be available after the Card class is removed.

Returns the footnote text for the card.

Added in API level XE12

public Drawable getImage (int n)

This method was deprecated in API level XE21.
The Card class (and its replacement, CardBuilder) are intended to act as a View builder, not a data model object. The get* methods for these attributes will no longer be available after the Card class is removed.

Returns the n-th image associated with the card, where 0 <= n < getImageCount().

Returns
  • the Drawable representation of the n-th image
Added in API level XE12

public int getImageCount ()

This method was deprecated in API level XE21.
The Card class (and its replacement, CardBuilder) are intended to act as a View builder, not a data model object. The get* methods for these attributes will no longer be available after the Card class is removed.

Returns the number of images associated with the card.

Added in API level XE12

public Card.ImageLayout getImageLayout ()

This method was deprecated in API level XE21.
Use CardBuilder.Layout to specify how the card's content should be laid out.

Returns the image layout for card.

Added in API level XE12

public CharSequence getText ()

This method was deprecated in API level XE21.
The Card class (and its replacement, CardBuilder) are intended to act as a View builder, not a data model object. The get* methods for these attributes will no longer be available after the Card class is removed.

Returns the main text for the card.

Added in API level XE16

public CharSequence getTimestamp ()

This method was deprecated in API level XE21.
The Card class (and its replacement, CardBuilder) are intended to act as a View builder, not a data model object. The get* methods for these attributes will no longer be available after the Card class is removed.

Returns the timestamp text for the card.

Added in API level XE16

public Card setFootnote (CharSequence footnote)

Sets the footnote text for the card.

Parameters
footnote the footnote text for this card
Returns
  • this object for call chaining
Added in API level XE12

public Card setFootnote (int footnoteId)

Sets the footnote text for the card using a string resource.

Parameters
footnoteId the footnote text resource ID for this card
Returns
  • this object for call chaining
Added in API level XE12

public Card setImageLayout (Card.ImageLayout imageLayout)

This method was deprecated in API level XE21.
Use CardBuilder.Layout to specify how the card's content should be laid out.

Sets the image layout for the card.

Parameters
imageLayout defines desired image layout
Returns
  • this object for call chaining
Added in API level XE12

public Card setText (int textId)

Sets the main text for the card using a string resource.

Parameters
textId main text resource ID for this card
Returns
  • this object for call chaining
Added in API level XE16

public Card setText (CharSequence text)

Sets the main text for the card.

Parameters
text main text for this card
Returns
  • this object for call chaining
Added in API level XE16

public Card setTimestamp (int timestampId)

Sets the timestamp text for the card using a string resource.

Parameters
timestampId the timestamp text resource ID for this card
Returns
  • this object for call chaining
Added in API level XE16

public Card setTimestamp (CharSequence timestamp)

Sets the timestamp text for the card.

Parameters
timestamp the timestamp text for this card
Returns
  • this object for call chaining