ArcLayout.LayoutParams

public class ArcLayout.LayoutParams


Layout parameters for a widget added to an arc. This allows each element to specify whether or not it should be rotated(around the center of the child) when drawn inside the arc. For example, when the child is put at the center-bottom of the arc, whether the parent layout is responsible to rotate it 180 degree to draw it upside down.

Note that the rotate parameter is ignored when drawing "Fullscreen" elements.

Summary

Constants

static final @NonNull int

Align to the center of the parent ArcLayout.

static final @NonNull int

Align to the inner edge of the parent ArcLayout.

static final @NonNull int

Align to the outer edge of the parent ArcLayout.

Public constructors

Copy constructor

Creates a new set of layout parameters.

LayoutParams(@NonNull int width, @NonNull int height)

Creates a new set of layout parameters with specified width and height

Public methods

@ArcLayout.LayoutParams.VerticalAlignment @NonNull int

Gets how the widget is positioned vertically in the ArcLayout.

@NonNull boolean

Gets whether the widget shall be rotated by the ArcLayout container corresponding to its layout position angle

@NonNull void
setRotated(@NonNull boolean rotated)

Sets whether the widget shall be rotated by the ArcLayout container corresponding to its layout position angle

@NonNull void

Sets how the widget is positioned vertically in the ArcLayout.

Inherited methods

From class ViewGroup.MarginLayoutParams
@NonNull int
@NonNull int
@NonNull int
@NonNull boolean
@NonNull void
resolveLayoutDirection(@NonNull int layoutDirection)
@NonNull void
setLayoutDirection(@NonNull int layoutDirection)
@NonNull void
@NonNull void
setMarginStart(@NonNull int start)
@NonNull void
setMargins(
    @NonNull int left,
    @NonNull int top,
    @NonNull int right,
    @NonNull int bottom
)

Constants

VERTICAL_ALIGN_CENTER

@NonNull
public static final @NonNull int VERTICAL_ALIGN_CENTER

Align to the center of the parent ArcLayout.

VERTICAL_ALIGN_INNER

@NonNull
public static final @NonNull int VERTICAL_ALIGN_INNER

Align to the inner edge of the parent ArcLayout.

VERTICAL_ALIGN_OUTER

@NonNull
public static final @NonNull int VERTICAL_ALIGN_OUTER

Align to the outer edge of the parent ArcLayout.

Public constructors

LayoutParams

public LayoutParams(@NonNull ViewGroup.LayoutParams source)

Copy constructor

LayoutParams

public LayoutParams(@NonNull Context context, @Nullable AttributeSet attrs)

Creates a new set of layout parameters. The values are extracted from the supplied attributes set and context.

Parameters
@NonNull Context context

The Context the ArcLayout is running in, through which it can access the current theme, resources, etc.

@Nullable AttributeSet attrs

The set of attributes from which to extract the layout parameters' values

LayoutParams

public LayoutParams(@NonNull int width, @NonNull int height)

Creates a new set of layout parameters with specified width and height

Parameters
@NonNull int width

The width, either WRAP_CONTENT, MATCH_PARENT or a fixed size in pixels

@NonNull int height

The height, either WRAP_CONTENT, MATCH_PARENT or a fixed size in pixels

Public methods

getVerticalAlignment

@ArcLayout.LayoutParams.VerticalAlignment
@NonNull
public @ArcLayout.LayoutParams.VerticalAlignment int getVerticalAlignment()

Gets how the widget is positioned vertically in the ArcLayout.

isRotated

@NonNull
public boolean isRotated()

Gets whether the widget shall be rotated by the ArcLayout container corresponding to its layout position angle

setRotated

@NonNull
public void setRotated(@NonNull boolean rotated)

Sets whether the widget shall be rotated by the ArcLayout container corresponding to its layout position angle

setVerticalAlignment

@NonNull
public void setVerticalAlignment(
    @ArcLayout.LayoutParams.Ver