WalletFragmentStyle

public final class WalletFragmentStyle extends Object
implements Parcelable

Defines attributes to customize the look and feel of WalletFragment, to be used in setFragmentStyle(WalletFragmentStyle). You may also specify these attributes using custom XML tags in a style resource and either add wallet:fragmentStyle="@style/MyWalletFragmentCustomStyle" to your <fragment> tag or pass the id of the style resource in setFragmentStyle(int).

See WalletFragmentDefaultStyle for an example of the wallet fragment style.

Nested Class Summary

@interface WalletFragmentStyle.BuyButtonAppearance Options for buy button appearance. 
@interface WalletFragmentStyle.BuyButtonText Options for text displayed on the buy button. 
@interface WalletFragmentStyle.Dimension Constants for specifying dimensions in WalletFragmentStyle
@interface WalletFragmentStyle.LogoImageType Logo image types. 

Inherited Constant Summary

Field Summary

public static final Creator<WalletFragmentStyle> CREATOR

Public Constructor Summary

Public Method Summary

WalletFragmentStyle
setBuyButtonAppearance(int buyButtonAppearance)
Sets the appearance of the buy button.
WalletFragmentStyle
setBuyButtonHeight(int unit, float height)
Specifies a height for the buy button.
WalletFragmentStyle
setBuyButtonHeight(int height)
Specifies a height for the buy button.
WalletFragmentStyle
setBuyButtonText(int buyButtonText)
Sets text for the buy button.
WalletFragmentStyle
setBuyButtonWidth(int width)
Specifies a width for the buy button.
WalletFragmentStyle
setBuyButtonWidth(int unit, float width)
Specifies a width for the buy button.
WalletFragmentStyle
setMaskedWalletDetailsBackgroundColor(int color)
Sets the color for the masked wallet details view background.
WalletFragmentStyle
setMaskedWalletDetailsBackgroundResource(int resourceId)
Sets the drawable resource id for the masked wallet details view background.
WalletFragmentStyle
setMaskedWalletDetailsButtonBackgroundColor(int color)
Sets the color for the masked wallet details "Change" button background.
WalletFragmentStyle
setMaskedWalletDetailsButtonBackgroundResource(int resourceId)
Sets the drawable resource id for the masked wallet details "Change" button background.
WalletFragmentStyle
setMaskedWalletDetailsButtonTextAppearance(int resourceId)
Sets the text appearance for the masked wallet details "Change" button text.
WalletFragmentStyle
setMaskedWalletDetailsHeaderTextAppearance(int resourceId)
Sets text appearance for the headers describing masked wallet details.
WalletFragmentStyle
setMaskedWalletDetailsLogoImageType(int imageType)
Sets the type of the wallet image logo in masked wallet details view.
WalletFragmentStyle
setMaskedWalletDetailsLogoTextColor(int color)
This method was deprecated. Support for customizing this color will be removed in the future. Please, stop using this API.
WalletFragmentStyle
setMaskedWalletDetailsTextAppearance(int resourceId)
Sets text appearance for the masked wallet details.
WalletFragmentStyle
setStyleResourceId(int id)
Sets resource id of the style which will be used to customize wallet fragment UI.
void
writeToParcel(Parcel dest, int flags)

Inherited Method Summary

Fields

public static final Creator<WalletFragmentStyle> CREATOR

Public Constructors

public WalletFragmentStyle ()

Public Methods

public WalletFragmentStyle setBuyButtonAppearance (int buyButtonAppearance)

Sets the appearance of the buy button. See WalletFragmentStyle.BuyButtonAppearance for the list of possible values. Defaults to ANDROID_PAY_DARK. This will override the buy button appearance defined in any style passed in setStyleResourceId(int).

Parameters
buyButtonAppearance appearance of the buy button

public WalletFragmentStyle setBuyButtonHeight (int unit, float height)

Specifies a height for the buy button. The height includes a padding of 8dp (4dp on each side). The padding is used for a border around the button in pressed and focused states. The range of height supported is 40dp~72dp. This will override the buy button height defined in any style passed in setStyleResourceId(int).

Parameters
unit unit of the height value. See constants starting with UNIT_ in WalletFragmentStyle.Dimension for a list of supported units
height value of the height

public WalletFragmentStyle setBuyButtonHeight (int height)

Specifies a height for the buy button. The height includes a padding of 8dp (4dp on each side). The padding is used for a border around the button in pressed and focused states. The range of height supported is 40dp~72dp. This will override the buy button height defined in any style passed in setStyleResourceId(int).

Parameters
height height in pixels, or MATCH_PARENT, WRAP_CONTENT

public WalletFragmentStyle setBuyButtonText (int buyButtonText)

Sets text for the buy button. This will override the buy button text defined in any style passed in setStyleResourceId(int). See WalletFragmentStyle.BuyButtonText for the list of possible values. Defaults to BUY_WITH.

Parameters
buyButtonText text on the buy button

public WalletFragmentStyle setBuyButtonWidth (int width)

Specifies a width for the buy button. The width includes a padding of 8dp (4dp on each side). The padding is used for a border around the button in pressed and focused states. A minimum width is enforced, and is computed from the height of the button and the width of the button text. This will override the buy button width defined in any style passed in setStyleResourceId(int).

Parameters
width width in pixels, or MATCH_PARENT, WRAP_CONTENT

public WalletFragmentStyle setBuyButtonWidth (int unit, float width)

Specifies a width for the buy button. The width includes a padding of 8dp (4dp on each side). The padding is used for a border around the button in pressed and focused states. A minimum width is enforced, and is computed from the height of the button and the width of the button text. This will override the buy button width defined in any style passed in setStyleResourceId(int).

Parameters
unit unit of the width value. See constants starting with UNIT_ in WalletFragmentStyle.Dimension for a list of supported units
width value of the width

public WalletFragmentStyle setMaskedWalletDetailsBackgroundColor (int color)

Sets the color for the masked wallet details view background. This will override the color defined in any style passed in setStyleResourceId(int) and background drawable which was previously set.

Parameters
color the color as defined in android.graphics.Color

public WalletFragmentStyle setMaskedWalletDetailsBackgroundResource (int resourceId)

Sets the drawable resource id for the masked wallet details view background. This will override the drawable defined in any style passed in setStyleResourceId(int) and background color which was previously set.

Parameters
resourceId the id of the drawable resource.

public WalletFragmentStyle setMaskedWalletDetailsButtonBackgroundColor (int color)

Sets the color for the masked wallet details "Change" button background. This will override the background defined in any style passed in setStyleResourceId(int) and drawable resource id which was previously set for button background.

Parameters
color the color as defined in android.graphics.Color

public WalletFragmentStyle setMaskedWalletDetailsButtonBackgroundResource (int resourceId)

Sets the drawable resource id for the masked wallet details "Change" button background. This will override the background defined in any style passed in setStyleResourceId(int) and color previously set for the button background.

Parameters
resourceId the id of the drawable resource.

public WalletFragmentStyle setMaskedWalletDetailsButtonTextAppearance (int resourceId)

Sets the text appearance for the masked wallet details "Change" button text. This will override the text appearance defined in any style passed in setStyleResourceId(int).

Parameters
resourceId the id of a TextAppearance style

public WalletFragmentStyle setMaskedWalletDetailsHeaderTextAppearance (int resourceId)

Sets text appearance for the headers describing masked wallet details. This will override the text appearance defined in any style passed in setStyleResourceId(int).

Parameters
resourceId the id of a TextAppearance style

public WalletFragmentStyle setMaskedWalletDetailsLogoImageType (int imageType)

Sets the type of the wallet image logo in masked wallet details view. See WalletFragmentStyle.LogoImageType for the list of possible values. Defaults to ANDROID_PAY. This will override the image type defined in any style passed in setStyleResourceId(int).

Parameters
imageType the type of the logo image.

public WalletFragmentStyle setMaskedWalletDetailsLogoTextColor (int color)

This method was deprecated.
Support for customizing this color will be removed in the future. Please, stop using this API.

Sets the color for the masked wallet details logo text. This will override the text color defined in any style passed in setStyleResourceId(int).

Note: Not all WalletFragmentStyle.LogoImageTypes support this customization, so this value may be ignored depending on the logo type set using setMaskedWalletDetailsLogoImageType(int).

Parameters
color the color as defined in android.graphics.Color

public WalletFragmentStyle setMaskedWalletDetailsTextAppearance (int resourceId)

Sets text appearance for the masked wallet details. This will override the text appearance defined in any style passed in setStyleResourceId(int).

Parameters
resourceId the id of a TextAppearance style

public WalletFragmentStyle setStyleResourceId (int id)

Sets resource id of the style which will be used to customize wallet fragment UI. If not set explicitly the default style WalletFragmentDefaultStyle will be used. In most cases you will need to customize the style of the wallet fragment so that the UI of the fragment better matches the UI of the application.

Parameters
id id of a style defined in xml

public void writeToParcel (Parcel dest, int flags)