Added in API level 30

WalletCard

class WalletCard : Parcelable
kotlin.Any
   ↳ android.service.quickaccesswallet.WalletCard

A WalletCard can represent anything that a user might carry in their wallet -- a credit card, library card, transit pass, etc. Cards are identified by a String identifier and contain a card type, card image, card image content description, and a PendingIntent to be used if the user clicks on the card. Cards may be displayed with an icon and label, though these are optional. Non-payment cards will also have a second image that will be displayed when the card is tapped.

Summary

Nested classes

Builder for WalletCard objects.

Constants
static Int

Non-payment cards refer to any cards that are not used for cash-equivalent payment, including event tickets, flights, offers, loyalty cards, gift cards and transit tickets.

static Int

Payment cards refer to credit cards, debit cards or any other cards in the wallet used to make cash-equivalent payments.

static Int

Unknown cards refer to cards whose types are unspecified.

Inherited constants
Public methods
Int

Icon?

An icon may be shown alongside the card image to convey information about how the card can be used, or if some other action must be taken before using the card.

String

The card id must be unique within the list of cards returned.

Icon

The visual representation of the card.

CharSequence?

A card label may be shown alongside the card image to convey information about how the card can be used, or if some other action must be taken before using the card.

MutableList<Location!>

List of locations that this card might be useful at.

Int

Returns the card type.

CharSequence

The content description of the card image.

Icon?

Visual representation of the card when it is tapped.

PendingIntent

If the user performs a click on the card, this PendingIntent will be sent.

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<WalletCard!>

Constants

CARD_TYPE_NON_PAYMENT

Added in API level 34
static val CARD_TYPE_NON_PAYMENT: Int

Non-payment cards refer to any cards that are not used for cash-equivalent payment, including event tickets, flights, offers, loyalty cards, gift cards and transit tickets.

Value: 2

CARD_TYPE_PAYMENT

Added in API level 34
static val CARD_TYPE_PAYMENT: Int

Payment cards refer to credit cards, debit cards or any other cards in the wallet used to make cash-equivalent payments.

Value: 1

CARD_TYPE_UNKNOWN

Added in API level 34
static val CARD_TYPE_UNKNOWN: Int

Unknown cards refer to cards whose types are unspecified.

Value: 0

Public methods

describeContents

Added in API level 30
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

getCardIcon

Added in API level 30
fun getCardIcon(): Icon?

An icon may be shown alongside the card image to convey information about how the card can be used, or if some other action must be taken before using the card. For example, an NFC logo could indicate that the card is NFC-enabled and will be provided to an NFC terminal if the phone is held in close proximity to the NFC reader.

If the supplied Icon is backed by a bitmap, it should have width and height GetWalletCardsRequest#getIconSizePx().

Return
Icon? This value may be null.

getCardId

Added in API level 30
fun getCardId(): String

The card id must be unique within the list of cards returned.

Return
String This value cannot be null.

getCardImage

Added in API level 30
fun getCardImage(): Icon

The visual representation of the card. If the card image Icon is a bitmap, it should have a width of GetWalletCardsRequest#getCardWidthPx() and a height of android.service.quickaccesswallet.GetWalletCardsRequest#getCardHeightPx().

Return
Icon This value cannot be null.

getCardLabel

Added in API level 30
fun getCardLabel(): CharSequence?

A card label may be shown alongside the card image to convey information about how the card can be used, or if some other action must be taken before using the card. For example, an NFC-enabled card could be labeled "Hold near reader" to inform the user of how to use NFC cards when interacting with an NFC reader.

If the provided label is too long to fit on one line, it may be truncated and ellipsized.

Return
CharSequence? This value may be null.

getCardLocations

Added in API level 34
fun getCardLocations(): MutableList<Location!>

List of locations that this card might be useful at.

Return
MutableList<Location!> This value cannot be null.

getContentDescription

Added in API level 30
fun getContentDescription(): CharSequence

The content description of the card image.

Return
CharSequence This value cannot be null.

getNonPaymentCardSecondaryImage

Added in API level 34
fun getNonPaymentCardSecondaryImage(): Icon?

Visual representation of the card when it is tapped. May include additional information unique to the card, such as a barcode or number. Only valid for CARD_TYPE_NON_PAYMENT.

Return
Icon? This value may be null.

getPendingIntent

Added in API level 30
fun getPendingIntent(): PendingIntent

If the user performs a click on the card, this PendingIntent will be sent. If the device is locked, the wallet will first request device unlock before sending the pending intent.

Return
PendingIntent This value cannot be null.

writeToParcel

Added in API level 30
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 30
static val CREATOR: Parcelable.Creator<WalletCard!>