public class

ArcLayout.LayoutParams

extends ViewGroup.MarginLayoutParams

 java.lang.Object

↳ViewGroup.MarginLayoutParams

↳androidx.wear.widget.ArcLayout.LayoutParams

Overview

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

Fields
public static final intVERTICAL_ALIGN_CENTER

Align to the center of the parent ArcLayout.

public static final intVERTICAL_ALIGN_INNER

Align to the inner edge of the parent ArcLayout.

public static final intVERTICAL_ALIGN_OUTER

Align to the outer edge of the parent ArcLayout.

Constructors
publicLayoutParams(Context context, AttributeSet attrs)

Creates a new set of layout parameters.

publicLayoutParams(ViewGroup.LayoutParams source)

Copy constructor

Methods
public intgetVerticalAlignment()

Gets how the widget is positioned vertically in the ArcLayout.

public booleanisRotated()

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

public voidsetRotated(boolean rotated)

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

public voidsetVerticalAlignment(int verticalAlignment)

Sets how the widget is positioned vertically in the ArcLayout.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public static final int VERTICAL_ALIGN_OUTER

Align to the outer edge of the parent ArcLayout.

public static final int VERTICAL_ALIGN_CENTER

Align to the center of the parent ArcLayout.

public static final int VERTICAL_ALIGN_INNER

Align to the inner edge of the parent ArcLayout.

Constructors

public LayoutParams(Context context, AttributeSet attrs)

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

Parameters:

context: The Context the ArcLayout is running in, through which it can access the current theme, resources, etc.
attrs: The set of attributes from which to extract the layout parameters' values

public LayoutParams(ViewGroup.LayoutParams source)

Copy constructor

Methods

public boolean isRotated()

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

public void setRotated(boolean rotated)

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

public int getVerticalAlignment()

Gets how the widget is positioned vertically in the ArcLayout.

public void setVerticalAlignment(int verticalAlignment)

Sets how the widget is positioned vertically in the ArcLayout.

Parameters:

verticalAlignment: align the widget to outer, inner edges or center.