Most visited

Recently visited

ItemAlignmentFacet.ItemAlignmentDef

public static class ItemAlignmentFacet.ItemAlignmentDef
extends Object

java.lang.Object
   ↳ android.support.v17.leanback.widget.ItemAlignmentFacet.ItemAlignmentDef


Definition of an alignment position under a view.

Summary

Public constructors

ItemAlignmentFacet.ItemAlignmentDef()

Public methods

final int getItemAlignmentFocusViewId()

Returns Id of which child view take focus for alignment.

final int getItemAlignmentOffset()

Gets number of pixels to offset.

final float getItemAlignmentOffsetPercent()

Gets the offset percent for item alignment in addition to offset.

final int getItemAlignmentViewId()

Gets Id of which child view to be aligned.

boolean isAlignedToTextViewBaseLine()

Returns true when TextView should be aligned to the baseline.

final boolean isItemAlignmentOffsetWithPadding()

When it is true: we include left/top padding for positive item offset, include right/bottom padding for negative item offset.

final void setAlignedToTextViewBaseline(boolean alignToBaseline)

Align to baseline if getItemAlignmentViewId() is a TextView and alignToBaseline is true.

final void setItemAlignmentFocusViewId(int viewId)

Sets Id of which child view take focus for alignment.

final void setItemAlignmentOffset(int offset)

Sets number of pixels to offset.

final void setItemAlignmentOffsetPercent(float percent)

Sets the offset percent for item alignment in addition to offset.

final void setItemAlignmentOffsetWithPadding(boolean withPadding)

Sets whether to include left/top padding for positive item offset, include right/bottom padding for negative item offset.

final void setItemAlignmentViewId(int viewId)

Sets Id of which child view to be aligned.

Inherited methods

From class java.lang.Object

Public constructors

ItemAlignmentFacet.ItemAlignmentDef

ItemAlignmentFacet.ItemAlignmentDef ()

Public methods

getItemAlignmentFocusViewId

int getItemAlignmentFocusViewId ()

Returns Id of which child view take focus for alignment. When not set, it will use use same id of getItemAlignmentViewId()

Returns
int

getItemAlignmentOffset

int getItemAlignmentOffset ()

Gets number of pixels to offset. Can be negative for alignment from the high edge, or positive for alignment from the low edge.

Returns
int

getItemAlignmentOffsetPercent

float getItemAlignmentOffsetPercent ()

Gets the offset percent for item alignment in addition to offset. E.g., 40 means 40% of the width from the low edge. Use ITEM_ALIGN_OFFSET_PERCENT_DISABLED to disable.

Returns
float

getItemAlignmentViewId

int getItemAlignmentViewId ()

Gets Id of which child view to be aligned. View.NO_ID refers to root view and should be only used in first one. Extra ItemAlignmentDefs should provide view id to match currently focused view.

Returns
int

isAlignedToTextViewBaseLine

boolean isAlignedToTextViewBaseLine ()

Returns true when TextView should be aligned to the baseline.

Returns
boolean

isItemAlignmentOffsetWithPadding

boolean isItemAlignmentOffsetWithPadding ()

When it is true: we include left/top padding for positive item offset, include right/bottom padding for negative item offset.

Returns
boolean

setAlignedToTextViewBaseline

void setAlignedToTextViewBaseline (boolean alignToBaseline)

Align to baseline if getItemAlignmentViewId() is a TextView and alignToBaseline is true.

Parameters
alignToBaseline boolean: Boolean indicating whether to align the text to baseline.

setItemAlignmentFocusViewId

void setItemAlignmentFocusViewId (int viewId)

Sets Id of which child view take focus for alignment. When not set, it will use use same id of getItemAlignmentViewId()

Parameters
viewId int

setItemAlignmentOffset

void setItemAlignmentOffset (int offset)

Sets number of pixels to offset. Can be negative for alignment from the high edge, or positive for alignment from the low edge.

Parameters
offset int

setItemAlignmentOffsetPercent

void setItemAlignmentOffsetPercent (float percent)

Sets the offset percent for item alignment in addition to offset. E.g., 40 means 40% of the width from the low edge. Use ITEM_ALIGN_OFFSET_PERCENT_DISABLED to disable.

Parameters
percent float

setItemAlignmentOffsetWithPadding

void setItemAlignmentOffsetWithPadding (boolean withPadding)

Sets whether to include left/top padding for positive item offset, include right/bottom padding for negative item offset.

Parameters
withPadding boolean

setItemAlignmentViewId

void setItemAlignmentViewId (int viewId)

Sets Id of which child view to be aligned. View.NO_ID refers to root view and should be only used in first one. Extra ItemAlignmentDefs should provide view id to match currently focused view.

Parameters
viewId int

Hooray!