ArcLayout.LayoutParams
class ArcLayout.LayoutParams : ViewGroup.MarginLayoutParams
| kotlin.Any | |||
| ↳ | android.view.ViewGroup.LayoutParams | ||
| ↳ | android.view.ViewGroup.MarginLayoutParams | ||
| ↳ | androidx.wear.widget.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 |
|
|---|---|
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 |
|---|
LayoutParams(source: ViewGroup.LayoutParams)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 |
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 |
Inherited Constants |
||||||
|---|---|---|---|---|---|---|
|
Inherited functions |
||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||
|
Inherited properties |
|---|
Constants
VERTICAL_ALIGN_CENTER
const val VERTICAL_ALIGN_CENTER = 1: Int
Align to the center of the parent ArcLayout.
VERTICAL_ALIGN_INNER
const val VERTICAL_ALIGN_INNER = 2: Int
Align to the inner edge of the parent ArcLayout.
VERTICAL_ALIGN_OUTER
const val VERTICAL_ALIGN_OUTER = 0: Int
Align to the outer edge of the parent ArcLayout.
Public constructors
LayoutParams
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
LayoutParams(width: Int, height: Int)
Creates a new set of layout parameters with specified width and height
Public functions
getVerticalAlignment
fun getVerticalAlignment(): Int
Gets how the widget is positioned vertically in the ArcLayout.
isRotated
fun isRotated(): Boolean
Gets whether the widget shall be rotated by the ArcLayout container corresponding to its layout position angle
setRotated
fun setRotated(rotated: Boolean): Unit
Sets whether the widget shall be rotated by the ArcLayout container corresponding to its layout position angle
setVerticalAlignment
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
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.