Package com.stripe.android.ui.core.elements

Types

Link copied to clipboard
@ExperimentalCoroutinesApi
class AddressController(fieldsFlowable: Flow<List<SectionFieldElement>>) : SectionFieldErrorController

This is the controller for a section with a changing number and set of fields. This is in contrast to the SectionController which is a section in which the fields in it do not change.

Link copied to clipboard
@ExperimentalCoroutinesApi
class AddressElement(_identifier: IdentifierSpec, addressFieldRepository: AddressFieldElementRepository, rawValuesMap: Map<IdentifierSpec, String?>, countryCodes: Set<String>, countryDropdownFieldController: DropdownFieldController) : SectionMultiFieldElement
Link copied to clipboard
data class AffirmHeaderElement(identifier: IdentifierSpec, controller: Controller?) : FormElement
Link copied to clipboard
data class AfterpayClearpayHeaderElement(identifier: IdentifierSpec, amount: Amount, controller: Controller?) : FormElement
Link copied to clipboard

A text field configuration for an AU bank account number

Link copied to clipboard
data class AuBecsDebitMandateTextElement(identifier: IdentifierSpec, color: Int?, merchantName: String?, fontSizeSp: Int, letterSpacingSp: Double, controller: InputController?) : FormElement

This is an element that has static text because it takes no user input, it is not outputted from the list of form field values. If the stringResId contains a %s, the first one will be populated in the form with the merchantName parameter.

Link copied to clipboard
data class BankRepository @Inject constructor(resources: Resources?)
Link copied to clipboard
class BsbConfig(Banks: List<BecsDebitBanks.Bank>) : TextFieldConfig

A text field configuration for a BSB number, or Bank State Branch Number, a six-digit number used to identify the individual branch of an Australian financial institution

Link copied to clipboard
interface Controller

This is a generic controller

Link copied to clipboard
class CountryConfig(onlyShowCountryCodes: Set<String>, locale: Locale) : DropdownConfig

This is the configuration for a country dropdown.

Link copied to clipboard
data class CountryElement(identifier: IdentifierSpec, controller: DropdownFieldController) : SectionSingleFieldElement
Link copied to clipboard
data class CountrySpec(onlyShowCountryCodes: Set<String>) : SectionFieldSpec

This is the specification for a country field.

Link copied to clipboard
interface DropdownConfig
Link copied to clipboard

This class controls the dropdown view and implements the InputController interface. Because it can never be in error the errorMessage is always null. It is also designed to always have a value selected, so isComplete is always true.

Link copied to clipboard
data class DropdownItemSpec(value: String?, text: String)
Link copied to clipboard
class EmailConfig : TextFieldConfig
Link copied to clipboard
data class EmailElement(identifier: IdentifierSpec, controller: TextFieldController) : SectionSingleFieldElement
Link copied to clipboard
object EmailSpec : SectionFieldSpec
Link copied to clipboard
class FieldError(@StringRes errorMessage: Int, formatArgs: Array<out Any>?)

Encapsulates an error message including the string resource and the variable arguments

Link copied to clipboard
sealed class FormElement

This is used to define each section in the visual form layout. Each item in the layout has an identifier and a controller associated with it.

Link copied to clipboard
sealed class FormItemSpec : Parcelable

This is used to define each section in the visual form layout specification

Link copied to clipboard
class IbanConfig : TextFieldConfig

A text field configuration for an IBAN, or International Bank Account Number, as defined in ISO 13616-1.

Link copied to clipboard
sealed class IdentifierSpec : Parcelable

This uniquely identifies a element in the form. The objects here are for identifier specs that need to be found when pre-populating fields, or when extracting data.

Link copied to clipboard

This class provides the logic behind the fields.

Link copied to clipboard
object KlarnaHelper
Link copied to clipboard
data class LayoutFormDescriptor(layoutSpec: LayoutSpec?, showCheckbox: Boolean, showCheckboxControlledFields: Boolean)
Link copied to clipboard
data class LayoutSpec : Parcelable

This is a data representation of the layout of UI fields on the screen.

Link copied to clipboard
class NameConfig : TextFieldConfig
Link copied to clipboard
interface RequiredItemSpec : Parcelable

Identifies a field that can be made hidden.

Link copied to clipboard
Link copied to clipboard
class RowElement(_identifier: IdentifierSpec, fields: List<SectionSingleFieldElement>, controller: RowController) : SectionMultiFieldElement
Link copied to clipboard
class SaveForFutureUseController(identifiersRequiredForFutureUse: List<IdentifierSpec>, saveForFutureUseInitialValue: Boolean) : InputController
Link copied to clipboard
data class SaveForFutureUseElement(identifier: IdentifierSpec, controller: SaveForFutureUseController, merchantName: String?) : FormElement

This is an element that will make elements (as specified by identifier) hidden when "save for future" use is unchecked

Link copied to clipboard
data class SaveForFutureUseSpec(identifierRequiredForFutureUse: List<RequiredItemSpec>) : FormItemSpec, RequiredItemSpec

This is an element that will make elements (as specified by identifier) hidden when save for future use is unchecked

Link copied to clipboard
class SectionController(@StringRes label: Int?, sectionFieldErrorControllers: List<SectionFieldErrorController>) : Controller

This is the controller for a section with a static number of fields.

Link copied to clipboard
data class SectionElement(identifier: IdentifierSpec, fields: List<SectionFieldElement>, controller: SectionController) : FormElement
Link copied to clipboard
interface SectionFieldElement
Link copied to clipboard
interface SectionFieldErrorController : Controller

Any element in a section must have a controller that provides an error and have a type. This is used for a single field in a section or a section field that has other fields in it.

Link copied to clipboard
sealed class SectionFieldSpec : Parcelable

This represents a field in a section.

Link copied to clipboard
sealed class SectionMultiFieldElement : SectionFieldElement
Link copied to clipboard
sealed class SectionSingleFieldElement : SectionFieldElement

This is an element that is in a section and accepts user input.

Link copied to clipboard
data class SectionSpec(identifier: IdentifierSpec, fields: List<SectionFieldSpec>, @StringRes title: Int?) : FormItemSpec, RequiredItemSpec, Parcelable

This represents a section in a form that contains other elements

Link copied to clipboard
class SimpleDropdownConfig(@StringRes label: Int, items: List<DropdownItemSpec>) : DropdownConfig
Link copied to clipboard
data class SimpleDropdownElement(identifier: IdentifierSpec, controller: DropdownFieldController) : SectionSingleFieldElement
Link copied to clipboard
data class SimpleTextElement(identifier: IdentifierSpec, controller: TextFieldController) : SectionSingleFieldElement
Link copied to clipboard
class SimpleTextFieldConfig(@StringRes label: Int, capitalization: KeyboardCapitalization, keyboard: KeyboardType) : TextFieldConfig
Link copied to clipboard
data class SimpleTextSpec(identifier: IdentifierSpec, @StringRes label: Int, capitalization: KeyboardCapitalization, keyboardType: KeyboardType, showOptionalLabel: Boolean) : SectionFieldSpec
Link copied to clipboard
data class StaticTextElement(identifier: IdentifierSpec, stringResId: Int, color: Int?, merchantName: String?, fontSizeSp: Int, letterSpacingSp: Double, controller: InputController?) : FormElement

This is an element that has static text because it takes no user input, it is not outputted from the list of form field values. If the stringResId contains a %s, the first one will be populated in the form with the merchantName parameter.

Link copied to clipboard
Link copied to clipboard
interface TextFieldConfig
Link copied to clipboard
class TextFieldController(textFieldConfig: TextFieldConfig, showOptionalLabel: Boolean, initialValue: String?) : InputController, SectionFieldErrorController

This class will provide the onValueChanged and onFocusChanged functionality to the field's composable. These functions will update the observables as needed. It is responsible for exposing immutable observers for its data

Link copied to clipboard
interface TextFieldState

This represents the different states a field can be in, in each of these cases there might be a reason to show the error in a different way. This interface separates how the state is implemented from what information is required by clients of the interface. This will allow the implementation to change without impacting the clients.

Functions

Link copied to clipboard
fun AffirmElementUI()
Link copied to clipboard
fun AfterpayClearpayElementUI(enabled: Boolean, element: AfterpayClearpayHeaderElement)
Link copied to clipboard
fun AuBecsDebitMandateElementUI(element: AuBecsDebitMandateTextElement)
Link copied to clipboard
fun SaveForFutureUseElementUI(enabled: Boolean, element: SaveForFutureUseElement)
Link copied to clipboard
fun SectionCard(content: @Composable () -> Unit)

This is the layout for the section card.

Link copied to clipboard
fun SectionElementUI(enabled: Boolean, element: SectionElement, hiddenIdentifiers: List<IdentifierSpec>)
Link copied to clipboard
fun StaticElementUI(element: StaticTextElement)