ArcLayout.LayoutParams

Added in 1.2.0

public class ArcLayout.LayoutParams extends ViewGroup.MarginLayoutParams


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 int

Align to the center of the parent ArcLayout.

static final int

Align to the inner edge of the parent ArcLayout.

static final int

Align to the outer edge of the parent ArcLayout.

Public constructors

Copy constructor

Creates a new set of layout parameters.

LayoutParams(int width, int height)

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

Public methods

int

Gets how the widget is positioned vertically in the ArcLayout.

float

Returns the weight used for computing expansion.

boolean

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

void
setRotated(boolean rotated)

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

void
setVerticalAlignment(int verticalAlignment)

Sets how the widget is positioned vertically in the ArcLayout.

void
setWeight(float weight)

Indicates how much of the extra space in the ArcLayout will be allocated to the view associated with these LayoutParams up to the limit specified by setMaxAngleDegrees.

Inherited Constants

From android.view.ViewGroup.LayoutParams
static final int

This field is deprecated.

static final int
static final int

Inherited methods

From android.view.ViewGroup.LayoutParams
void
setBaseAttributes(TypedArray a, int widthAttr, int heightAttr)
From android.view.ViewGroup.MarginLayoutParams
int
int
int
boolean
void
resolveLayoutDirection(int layoutDirection)
void
setLayoutDirection(int layoutDirection)
void
setMarginEnd(int end)
void
setMarginStart(int start)
void
setMargins(int left, int top, int right, int bottom)

Constants

VERTICAL_ALIGN_CENTER

Added in 1.2.0
public static final int VERTICAL_ALIGN_CENTER = 1

Align to the center of the parent ArcLayout.

VERTICAL_ALIGN_INNER

Added in 1.2.0
public static final int VERTICAL_ALIGN_INNER = 2

Align to the inner edge of the parent ArcLayout.

VERTICAL_ALIGN_OUTER

Added in 1.2.0
public static final int VERTICAL_ALIGN_OUTER = 0

Align to the outer edge of the parent ArcLayout.

Public constructors

LayoutParams

Added in 1.2.0
public LayoutParams(@NonNull ViewGroup.LayoutParams source)

Copy constructor

LayoutParams

Added in 1.2.0
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

Added in 1.2.0
public LayoutParams(int width, int height)

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

Parameters
int width

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

int height

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

Public methods

getVerticalAlignment

Added in 1.2.0
public int getVerticalAlignment()

Gets how the widget is positioned vertically in the ArcLayout.

getWeight

Added in 1.3.0
public float getWeight()

Returns the weight used for computing expansion.

isRotated

Added in 1.2.0
public boolean isRotated()

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

setRotated

Added in 1.2.0
public void setRotated(boolean rotated)

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

setVerticalAlignment

Added in 1.2.0
public void setVerticalAlignment(int verticalAlignment)

Sets how the widget is positioned vertically in the ArcLayout.

Parameters
int verticalAlignment

align the widget to outer, inner edges or center.

setWeight

Added in 1.3.0
public void setWeight(float weight)

Indicates how much of the extra space in the ArcLayout will be allocated to the view associated with these LayoutParams up to the limit specified by setMaxAngleDegrees. Specify 0 if the view should not be stretched. Otherwise the extra pixels will be pro-rated among all views whose weight is greater than 0. Note non zero weights are only supported for Views that implement .Widget.