LayoutParams
open class LayoutParams : MarginLayoutParams
kotlin.Any | |||
↳ | android.view.ViewGroup.LayoutParams | ||
↳ | android.view.ViewGroup.MarginLayoutParams | ||
↳ | androidx.wear.widget.WearArcLayout.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 Int |
Align to the center of the parent WearArcLayout. |
static Int |
Align to the inner edge of the parent WearArcLayout. |
static Int |
Align to the outer edge of the parent WearArcLayout. |
Public constructors | |
---|---|
<init>(@NonNull context: Context, @Nullable attrs: AttributeSet?) Creates a new set of layout parameters. |
|
Creates a new set of layout parameters with specified width and height |
|
<init>(@NonNull source: LayoutParams) Copy constructor |
Public methods | |
---|---|
open Boolean |
Gets whether the widget shall be rotated by the WearArcLayout container corresponding to its layout position angle |
open Int |
Gets how the widget is positioned vertically in the WearArcLayout. |
open Unit |
Sets whether the widget shall be rotated by the WearArcLayout container corresponding to its layout position angle |
open Unit |
setVerticalAlignment(verticalAlignment: Int) Sets how the widget is positioned vertically in the WearArcLayout. |
Constants
VALIGN_CENTER
static val VALIGN_CENTER: Int
Align to the center of the parent WearArcLayout.
Value: 1
VALIGN_INNER
static val VALIGN_INNER: Int
Align to the inner edge of the parent WearArcLayout.
Value: 2
VALIGN_OUTER
static val VALIGN_OUTER: Int
Align to the outer edge of the parent WearArcLayout.
Value: 0
Public constructors
<init>
LayoutParams(
@NonNull context: Context,
@Nullable attrs: AttributeSet?)
Creates a new set of layout parameters. The values are extracted from the supplied attributes set and context.
Parameters | |
---|---|
context |
Context: the application environment |
attrs |
AttributeSet?: the set of attributes from which to extract the layout parameters' values |
<init>
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 methods
getRotate
open fun getRotate(): Boolean
Gets whether the widget shall be rotated by the WearArcLayout container corresponding to its layout position angle
getVerticalAlignment
open fun getVerticalAlignment(): Int
Gets how the widget is positioned vertically in the WearArcLayout.
setRotate
open fun setRotate(rotate: Boolean): Unit
Sets whether the widget shall be rotated by the WearArcLayout container corresponding to its layout position angle