GetWalletCardsRequest
public
final
class
GetWalletCardsRequest
extends Object
implements
Parcelable
java.lang.Object | |
↳ | android.service.quickaccesswallet.GetWalletCardsRequest |
Represents a request to a QuickAccessWalletService
for walletCards
.
Wallet cards may represent anything that a user might carry in their wallet -- a credit card,
library card, a transit pass, etc. This request contains the desired size of the card images and
icons as well as the maximum number of cards that may be returned in the GetWalletCardsResponse
.
Cards may be displayed with an optional icon and label. The icon and label should communicate the same idea. For example, if a card can be used at an NFC terminal, the icon could be an NFC icon and the label could inform the user how to interact with the NFC terminal.
The maximum number of cards that may be displayed in the wallet is provided in getMaxCards()
. The QuickAccessWalletService
may provide up to this many cards in the
GetWalletCardsResponse.getWalletCards()
. If the list of cards provided exceeds this
number, some of the cards may not be shown to the user.
Summary
Inherited constants |
---|
Fields | |
---|---|
public
static
final
Creator<GetWalletCardsRequest> |
CREATOR
|
Public constructors | |
---|---|
GetWalletCardsRequest(int cardWidthPx, int cardHeightPx, int iconSizePx, int maxCards)
Creates a new GetWalletCardsRequest. |
Public methods | |
---|---|
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
int
|
getCardHeightPx()
The desired height of the |
int
|
getCardWidthPx()
The desired width of the |
int
|
getIconSizePx()
Wallet cards may be displayed next to an icon. |
int
|
getMaxCards()
The maximum size of the |
void
|
writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |
---|---|
Fields
Public constructors
GetWalletCardsRequest
public GetWalletCardsRequest (int cardWidthPx, int cardHeightPx, int iconSizePx, int maxCards)
Creates a new GetWalletCardsRequest.
Parameters | |
---|---|
cardWidthPx |
int : The width of the card image in pixels. |
cardHeightPx |
int : The height of the card image in pixels. |
iconSizePx |
int : The width and height of the optional card icon in pixels. |
maxCards |
int : The maximum number of cards that may be provided in the response. |
Public methods
describeContents
public int describeContents ()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of writeToParcel(android.os.Parcel, int)
,
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR
bit.
Returns | |
---|---|
int |
a bitmask indicating the set of special object types marshaled
by this Parcelable object instance.
Value is either 0 or CONTENTS_FILE_DESCRIPTOR |
getCardHeightPx
public int getCardHeightPx ()
The desired height of the WalletCard.getCardImage()
, in pixels. The dimensions of the
card image are requested so that it may be rendered without scaling.
Returns | |
---|---|
int |
getCardWidthPx
public int getCardWidthPx ()
The desired width of the WalletCard.getCardImage()
, in pixels. The dimensions of the
card image are requested so that it may be rendered without scaling.
The cardWidthPx
and cardHeightPx
should be applied to the size of the WalletCard.getCardImage()
. The size of the card image is specified so that it may be
rendered accurately and without distortion caused by scaling.
Returns | |
---|---|
int |
getIconSizePx
public int getIconSizePx ()
Wallet cards may be displayed next to an icon. The icon can help to convey additional information about the state of the card. If the provided icon is a bitmap, its width and height should equal iconSizePx so that it is rendered without distortion caused by scaling.
Returns | |
---|---|
int |
getMaxCards
public int getMaxCards ()
The maximum size of the GetWalletCardsResponse.getWalletCards()
. If the list of cards
exceeds this number, not all cards may be displayed.
Returns | |
---|---|
int |
writeToParcel
public void writeToParcel (Parcel dest, int flags)
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.PARCELABLE_WRITE_RETURN_VALUE .
Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |