public final class

WalletFragmentStyle

extends Object
implements Parcelable
java.lang.Object
   ↳ com.google.android.gms.wallet.fragment.WalletFragmentStyle

Class Overview

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.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<WalletFragmentStyle> CREATOR
Public Constructors
WalletFragmentStyle()
Public Methods
int describeContents()
WalletFragmentStyle setBuyButtonAppearance(int buyButtonAppearance)
Sets the appearance of the buy button.
WalletFragmentStyle setBuyButtonHeight(int height)
Specifies a height for the buy button.
WalletFragmentStyle setBuyButtonHeight(int unit, float 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)
Sets the color for the masked wallet details logo text.
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)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<WalletFragmentStyle> CREATOR

Public Constructors

public WalletFragmentStyle ()

Public Methods

public int describeContents ()

public WalletFragmentStyle setBuyButtonAppearance (int buyButtonAppearance)

Sets the appearance of the buy button. See BuyButtonAppearance for the list of possible values. Defaults to CLASSIC. 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 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 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 Dimension for a list of supported units
height value of the height

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 BuyButtonText for the list of possible values. Defaults to BUY_WITH_GOOGLE.

Parameters
buyButtonText text on the buy button
See Also

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 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 WalletLogoImageType for the list of possible values. Defaults to CLASSIC. 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)

Sets the color for the masked wallet details logo text. This will override the text color defined in any style passed in setStyleResourceId(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)