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.
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 |
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
|
ItemAlignmentFacet.ItemAlignmentDef ()
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 |
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 |
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 |
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 |
boolean isAlignedToTextViewBaseLine ()
Returns true when TextView should be aligned to the baseline.
Returns | |
---|---|
boolean |
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 |
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.
|
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
|
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
|
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
|
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
|
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
|