PrimaryLayoutMargins.Companion


public static class PrimaryLayoutMargins.Companion


Summary

Public methods

static final @NonNull PrimaryLayoutMargins
customizedPrimaryLayoutMargin(
    @FloatRange(from = 0.0, to = 1.0) float start,
    @FloatRange(from = 0.0, to = 1.0) float end
)

Creates new set of margins to be used for primaryLayout customization.

static final @NonNull PrimaryLayoutMargins
customizedPrimaryLayoutMargin(
    @FloatRange(from = 0.0, to = 1.0) float start,
    @FloatRange(from = 0.0, to = 1.0) float end,
    @FloatRange(from = 0.0, to = 1.0) float bottom
)

Creates new set of margins to be used for primaryLayout customization.

Public methods

customizedPrimaryLayoutMargin

Added in 1.3.0-alpha08
public static final @NonNull PrimaryLayoutMargins customizedPrimaryLayoutMargin(
    @FloatRange(from = 0.0, to = 1.0) float start,
    @FloatRange(from = 0.0, to = 1.0) float end
)

Creates new set of margins to be used for primaryLayout customization. The passed in values represent fraction of the screen size.

Top margin is not included as it can't be customized in primaryLayout due to reserved space at the top for the system placed icon.

It is highly recommended to use predefined values instead of creating this custom one, because they are optimized for different screen sizes, content's corners and slots presences. Those predefined ones are:

Parameters
@FloatRange(from = 0.0, to = 1.0) float start

Fraction of the screen width that should be applied as margin on the start side

@FloatRange(from = 0.0, to = 1.0) float end

Fraction of the screen width that should be applied as margin on the end side

customizedPrimaryLayoutMargin

Added in 1.3.0-alpha08
public static final @NonNull PrimaryLayoutMargins customizedPrimaryLayoutMargin(
    @FloatRange(from = 0.0, to = 1.0) float start,
    @FloatRange(from = 0.0, to = 1.0) float end,
    @FloatRange(from = 0.0, to = 1.0) float bottom
)

Creates new set of margins to be used for primaryLayout customization. The passed in values represent fraction of the screen size.

Top margin is not included as it can't be customized in primaryLayout due to reserved space at the top for the system placed icon.

It is highly recommended to use predefined values instead of creating this custom one, because they are optimized for different screen sizes, content's corners and slots presences. Those predefined ones are:

Parameters
@FloatRange(from = 0.0, to = 1.0) float start

Fraction of the screen width that should be applied as margin on the start side

@FloatRange(from = 0.0, to = 1.0) float end

Fraction of the screen width that should be applied as margin on the end side

@FloatRange(from = 0.0, to = 1.0) float bottom

Fraction of the screen height that should be applied as margin on the bottom