ArcLayout.LayoutParams

Added in 1.2.0

class ArcLayout.LayoutParams : 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

const Int

Align to the center of the parent ArcLayout.

const Int

Align to the inner edge of the parent ArcLayout.

const Int

Align to the outer edge of the parent ArcLayout.

Public constructors

Copy constructor

LayoutParams(context: Context, attrs: AttributeSet?)

Creates a new set of layout parameters.

LayoutParams(width: Int, height: Int)

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

Public functions

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

Unit
setRotated(rotated: Boolean)

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

Unit
setVerticalAlignment(verticalAlignment: Int)

Sets how the widget is positioned vertically in the ArcLayout.

Unit
setWeight(weight: Float)

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
const Int

This property is deprecated.

const Int
const Int

Constants

VERTICAL_ALIGN_CENTER

Added in 1.2.0
const val VERTICAL_ALIGN_CENTER = 1: Int

Align to the center of the parent ArcLayout.

VERTICAL_ALIGN_INNER

Added in 1.2.0
const val VERTICAL_ALIGN_INNER = 2: Int

Align to the inner edge of the parent ArcLayout.

VERTICAL_ALIGN_OUTER

Added in 1.2.0
const val VERTICAL_ALIGN_OUTER = 0: Int

Align to the outer edge of the parent ArcLayout.

Public constructors

LayoutParams

Added in 1.2.0
LayoutParams(source: ViewGroup.LayoutParams)

Copy constructor

LayoutParams

Added in 1.2.0
LayoutParams(context: Context, attrs: AttributeSet?)

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

Parameters
context: Context

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

attrs: AttributeSet?

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

LayoutParams

Added in 1.2.0
LayoutParams(width: Int, height: Int)

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

Parameters
width: Int

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

height: Int

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

Public functions

getVerticalAlignment

Added in 1.2.0
fun getVerticalAlignment(): Int

Gets how the widget is positioned vertically in the ArcLayout.

getWeight

Added in 1.3.0
fun getWeight(): Float

Returns the weight used for computing expansion.

isRotated

Added in 1.2.0
fun isRotated(): Boolean

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

setRotated

Added in 1.2.0
fun setRotated(rotated: Boolean): Unit

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

setVerticalAlignment

Added in 1.2.0
fun setVerticalAlignment(verticalAlignment: Int): Unit

Sets how the widget is positioned vertically in the ArcLayout.

Parameters
verticalAlignment: Int

align the widget to outer, inner edges or center.

setWeight

Added in 1.3.0
fun setWeight(weight: Float): Unit

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.