LinearLayoutCompat
open class LinearLayoutCompat : ViewGroup
kotlin.Any | |||
↳ | android.view.View | ||
↳ | android.view.ViewGroup | ||
↳ | androidx.appcompat.widget.LinearLayoutCompat |
A Layout that arranges its children in a single column or a single row. The direction of the row can be set by calling setOrientation()
. You can also specify gravity, which specifies the alignment of all the child elements by calling setGravity()
or specify that specific children grow to fill up any remaining space in the layout by setting the weight member of LinearLayoutCompat.LayoutParams
. The default orientation is horizontal.
See the Linear Layout guide.
Also see LinearLayoutCompat.LayoutParams
for layout attributes
Summary
Nested classes | |
---|---|
open |
Per-child layout information associated with ViewLinearLayout. |
Constants | |
---|---|
static Int | |
static Int |
Show a divider at the beginning of the group. |
static Int |
Show a divider at the end of the group. |
static Int |
Show dividers between each item in the group. |
static Int |
Don't show any dividers. |
static Int |
Public constructors | |
---|---|
<init>(@NonNull context: Context, @Nullable attrs: AttributeSet?) |
|
<init>(@NonNull context: Context, @Nullable attrs: AttributeSet?, defStyleAttr: Int) |
Public methods | |
---|---|
open LinearLayoutCompat.LayoutParams! |
generateLayoutParams(attrs: AttributeSet!) |
open Int | |
open Int | |
open Drawable! | |
open Int |
Get the padding size used to inset dividers in pixels |
open Int |
Returns the current gravity. |
open Int |
Returns the current orientation. |
open Int | |
open Float |
Returns the desired weights sum. |
open Boolean |
Indicates whether widgets contained within this layout are aligned on their baseline or not. |
open Boolean |
When true, all children with a weight will be considered having the minimum size of the largest child. |
open Unit | |
open Unit | |
open Unit |
setBaselineAligned(baselineAligned: Boolean) Defines whether widgets contained in this layout are baseline-aligned or not. |
open Unit | |
open Unit |
setDividerDrawable(divider: Drawable!) Set a drawable to be used as a divider between items. |
open Unit |
setDividerPadding(padding: Int) Set padding displayed on both ends of dividers. |
open Unit |
setGravity(gravity: Int) Describes how the child views are positioned. |
open Unit |
setHorizontalGravity(horizontalGravity: Int) |
open Unit |
setMeasureWithLargestChildEnabled(enabled: Boolean) When set to true, all children with a weight will be considered having the minimum size of the largest child. |
open Unit |
setOrientation(orientation: Int) Should the layout be a column or a row. |
open Unit |
setShowDividers(showDividers: Int) Set how dividers should be shown between items in this layout |
open Unit |
setVerticalGravity(verticalGravity: Int) |
open Unit |
setWeightSum(weightSum: Float) Defines the desired weights sum. |
open Boolean |
Protected methods | |
---|---|
open Boolean | |
open LinearLayoutCompat.LayoutParams! |
Returns a set of layout parameters with a width of |
open LinearLayoutCompat.LayoutParams! | |
open Unit | |
open Unit | |
open Unit |
Constants
SHOW_DIVIDER_BEGINNING
static val SHOW_DIVIDER_BEGINNING: Int
Show a divider at the beginning of the group.
Value: 1
SHOW_DIVIDER_MIDDLE
static val SHOW_DIVIDER_MIDDLE: Int
Show dividers between each item in the group.
Value: 2
Public constructors
<init>
LinearLayoutCompat(@NonNull context: Context)
<init>
LinearLayoutCompat(
@NonNull context: Context,
@Nullable attrs: AttributeSet?)
<init>
LinearLayoutCompat(
@NonNull context: Context,
@Nullable attrs: AttributeSet?,
defStyleAttr: Int)
Public methods
generateLayoutParams
open fun generateLayoutParams(attrs: AttributeSet!): LinearLayoutCompat.LayoutParams!
getBaseline
open fun getBaseline