MultiButtonLayout.Builder


public final class MultiButtonLayout.Builder


Builder class for MultiButtonLayout.

Summary

Public constructors

Creates a builder for the MultiButtonLayout.

Public methods

@NonNull MultiButtonLayout.Builder

Add one new button to the layout.

@NonNull MultiButtonLayout

Constructs and returns MultiButtonLayout with the provided content and look.

@NonNull MultiButtonLayout.Builder
setFiveButtonDistribution(int fiveButtonDistribution)

Sets the button distribution for this layout.

Public constructors

Builder

Added in 1.0.0
public Builder()

Creates a builder for the MultiButtonLayout. Content inside of it can later be added with addButtonContent.

Public methods

addButtonContent

Added in 1.0.0
public @NonNull MultiButtonLayout.Builder addButtonContent(
    @NonNull LayoutElementBuilders.LayoutElement buttonContent
)

Add one new button to the layout. Note that it is accepted to pass in any , but it is strongly recommended to add a Button as the layout is optimized for it. Any button added after MAX_BUTTONS is reached will be discarded.

build

Added in 1.0.0
public @NonNull MultiButtonLayout build()

Constructs and returns MultiButtonLayout with the provided content and look.

Throws
java.lang.IllegalArgumentException

if no buttons are added or the number of buttons added is larger than MAX_BUTTONS.

setFiveButtonDistribution

Added in 1.0.0
public @NonNull MultiButtonLayout.Builder setFiveButtonDistribution(int fiveButtonDistribution)

Sets the button distribution for this layout. Button distribution is used in case when there is 5 buttons in the layout to determine whether the 3 buttons row is at the top or bottom.