belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1
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()
Returns number of pixels to the end of low edge. |
final
float
|
getItemAlignmentOffsetPercent()
Gets the offset percent for item alignment in addition to offset. |
final
int
|
getItemAlignmentViewId()
Returns Id of which child view to be aligned. |
boolean
|
isAlignedToTextViewBaseLine()
Returns true when View should be aligned to |
final
boolean
|
isItemAlignmentOffsetWithPadding()
Returns true if applies padding to item alignment when
|
final
void
|
setAlignedToTextViewBaseline(boolean alignToBaseline)
When true, align to |
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 the end of low edge. |
final
void
|
setItemAlignmentOffsetPercent(float percent)
Sets the offset percent for item alignment in addition to offset. |
final
void
|
setItemAlignmentOffsetWithPadding(boolean withPadding)
Sets whether applies padding to item alignment when
|
final
void
|
setItemAlignmentViewId(int viewId)
Sets Id of which child view to be aligned. |
Inherited methods | |
---|---|
From
class
java.lang.Object
|
Public constructors
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 ()
Returns number of pixels to the end of low edge. Supports right to left layout direction. In left to right or vertical case, it's the offset added to left/top edge. In right to left case, it's the offset subtracted from right edge.
Returns | |
---|---|
int |
Number of pixels to the end of low edge. |
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. In the right to left case, it's the 40% from
right edge. Use ITEM_ALIGN_OFFSET_PERCENT_DISABLED
to disable.
Returns | |
---|---|
float |
getItemAlignmentViewId
int getItemAlignmentViewId ()
Returns Id of which child view to be aligned. View.NO_ID refers to root view and should
be only used in first one. Different view ids of #getAlignmentDefs()
define multiple alignment steps within one itemView, e.g. there are
two child views R.id.child1 and R.id.child2. App may allocated two
ItemAlignmentFacet.ItemAlignmentDef
s, one with view id R.id.child1, the other with view id
R.id.child2. Note this id may or may not be same as the child view that takes focus.
Returns | |
---|---|
int |
See also:
isAlignedToTextViewBaseLine
boolean isAlignedToTextViewBaseLine ()
Returns true when View should be aligned to getBaseline()
Returns | |
---|---|
boolean |
isItemAlignmentOffsetWithPadding
boolean isItemAlignmentOffsetWithPadding ()
Returns true if applies padding to item alignment when
getItemAlignmentOffsetPercent()
is 0 or 100; returns false otherwise.
When true:
Applies start/top padding when getItemAlignmentOffsetPercent()
is 0.
Applies end/bottom padding when getItemAlignmentOffsetPercent()
is 100.
Does not apply padding if getItemAlignmentOffsetPercent()
is neither 0 nor 100.
When false: does not apply padding
Returns | |
---|---|
boolean |
setAlignedToTextViewBaseline
void setAlignedToTextViewBaseline (boolean alignToBaseline)
When true, align to getBaseline()
for the view of with id equals
getItemAlignmentViewId()
; false otherwise.
Parameters | |
---|---|
alignToBaseline |
boolean : Boolean indicating whether to align to view 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 : The id of child view that will be focused to.
|
setItemAlignmentOffset
void setItemAlignmentOffset (int offset)
Sets number of pixels to the end of low edge. Supports right to left layout direction.
Parameters | |
---|---|
offset |
int : In left to right or vertical case, it's the offset added to left/top edge.
In right to left case, it's the offset subtracted from right edge.
|
setItemAlignmentOffsetPercent
void setItemAlignmentOffsetPercent (float percent)
Sets the offset percent for item alignment in addition to offset. E.g., 40
means 40% of width/height from the low edge. In the right to left case, it's the 40%
width from right edge. Use ITEM_ALIGN_OFFSET_PERCENT_DISABLED
to disable.
Parameters | |
---|---|
percent |
float |
setItemAlignmentOffsetWithPadding
void setItemAlignmentOffsetWithPadding (boolean withPadding)
Sets whether applies padding to item alignment when
getItemAlignmentOffsetPercent()
is 0 or 100.
When true:
Applies start/top padding if getItemAlignmentOffsetPercent()
is 0.
Applies end/bottom padding if getItemAlignmentOffsetPercent()
is 100.
Does not apply padding if getItemAlignmentOffsetPercent()
is neither 0 nor 100.
When false: does not apply padding
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. Different view ids of #getAlignmentDefs()
define multiple alignment steps within one itemView, e.g. there are
two child views R.id.child1 and R.id.child2. App may allocated two
ItemAlignmentFacet.ItemAlignmentDef
s, one with view id R.id.child1, the other with view id
R.id.child2. Note this id may or may not be same as the child view that takes focus.
Parameters | |
---|---|
viewId |
int : The id of child view that will be aligned to. |
See also:
Interfaces
- BaseGridView.OnKeyInterceptListener
- BaseGridView.OnMotionInterceptListener
- BaseGridView.OnTouchInterceptListener
- BaseGridView.OnUnhandledKeyListener
- BaseOnItemViewClickedListener
- BaseOnItemViewSelectedListener
- BrowseFrameLayout.OnChildFocusListener
- BrowseFrameLayout.OnFocusSearchListener
- FacetProvider
- FacetProviderAdapter
- FocusHighlight
- FragmentAnimationProvider
- ImeKeyMonitor
- ImeKeyMonitor.ImeKeyListener
- MultiActionsProvider
- OnActionClickedListener
- OnChildLaidOutListener
- OnChildSelectedListener
- OnItemViewClickedListener
- OnItemViewSelectedListener
- PlaybackSeekUi
- SearchBar.SearchBarListener
- SearchBar.SearchBarPermissionListener
- SearchEditText.OnKeyboardDismissListener
- SpeechRecognitionCallback
- TitleViewAdapter.Provider
- ViewHolderTask
Classes
- AbstractDetailsDescriptionPresenter
- AbstractDetailsDescriptionPresenter.ViewHolder
- AbstractMediaItemPresenter
- AbstractMediaItemPresenter.ViewHolder
- AbstractMediaListHeaderPresenter
- AbstractMediaListHeaderPresenter.ViewHolder
- Action
- ArrayObjectAdapter
- BaseCardView
- BaseCardView.LayoutParams
- BaseGridView
- BrowseFrameLayout
- ClassPresenterSelector
- ControlButtonPresenterSelector
- CursorObjectAdapter
- DetailsOverviewLogoPresenter
- DetailsOverviewLogoPresenter.ViewHolder
- DetailsOverviewRow
- DetailsOverviewRow.Listener
- DetailsOverviewRowPresenter
- DetailsOverviewRowPresenter.ViewHolder
- DetailsParallax
- DiffCallback
- DividerPresenter
- DividerRow
- FocusHighlightHelper
- FullWidthDetailsOverviewRowPresenter
- FullWidthDetailsOverviewRowPresenter.Listener
- FullWidthDetailsOverviewRowPresenter.ViewHolder
- FullWidthDetailsOverviewRowPresenter.ViewHolder.DetailsOverviewRowListener
- FullWidthDetailsOverviewSharedElementHelper
- GuidanceStylist
- GuidanceStylist.Guidance
- GuidedAction
- GuidedAction.Builder
- GuidedAction.BuilderBase
- GuidedActionDiffCallback
- GuidedActionEditText
- GuidedActionsStylist
- GuidedActionsStylist.ViewHolder
- GuidedDatePickerAction
- GuidedDatePickerAction.Builder
- GuidedDatePickerAction.BuilderBase
- HeaderItem
- HorizontalGridView
- HorizontalHoverCardSwitcher
- ImageCardView
- ItemAlignmentFacet
- ItemAlignmentFacet.ItemAlignmentDef
- ItemBridgeAdapter
- ItemBridgeAdapter.AdapterListener
- ItemBridgeAdapter.ViewHolder
- ItemBridgeAdapter.Wrapper
- ItemBridgeAdapterShadowOverlayWrapper
- ListRow
- ListRowHoverCardView
- ListRowPresenter
- ListRowPresenter.SelectItemViewHolderTask
- ListRowPresenter.ViewHolder
- ListRowView
- MultiActionsProvider.MultiAction
- ObjectAdapter
- ObjectAdapter.DataObserver
- OnChildViewHolderSelectedListener
- PageRow
- Parallax
- Parallax.FloatProperty
- Parallax.IntProperty
- Parallax.PropertyMarkerValue
- ParallaxEffect
- ParallaxTarget
- ParallaxTarget.DirectPropertyTarget
- ParallaxTarget.PropertyValuesHolderTarget
- PlaybackControlsRow
- PlaybackControlsRow.ClosedCaptioningAction
- PlaybackControlsRow.FastForwardAction
- PlaybackControlsRow.HighQualityAction
- PlaybackControlsRow.MoreActions
- PlaybackControlsRow.MultiAction
- PlaybackControlsRow.OnPlaybackProgressCallback
- PlaybackControlsRow.PictureInPictureAction
- PlaybackControlsRow.PlayPauseAction
- PlaybackControlsRow.RepeatAction
- PlaybackControlsRow.RewindAction
- PlaybackControlsRow.ShuffleAction
- PlaybackControlsRow.SkipNextAction
- PlaybackControlsRow.SkipPreviousAction
- PlaybackControlsRow.ThumbsAction
- PlaybackControlsRow.ThumbsDownAction
- PlaybackControlsRow.ThumbsUpAction
- PlaybackControlsRowPresenter
- PlaybackControlsRowPresenter.ViewHolder
- PlaybackRowPresenter
- PlaybackRowPresenter.ViewHolder
- PlaybackSeekDataProvider
- PlaybackSeekDataProvider.ResultCallback
- PlaybackSeekUi.Client
- PlaybackTransportRowPresenter
- PlaybackTransportRowPresenter.ViewHolder
- Presenter
- Presenter.ViewHolder
- Presenter.ViewHolderTask
- PresenterSelector
- PresenterSwitcher
- RecyclerViewParallax
- RecyclerViewParallax.ChildPositionProperty
- Row
- RowHeaderPresenter
- RowHeaderPresenter.ViewHolder
- RowHeaderView
- RowPresenter
- RowPresenter.ViewHolder
- SearchBar
- SearchEditText
- SearchOrbView
- SearchOrbView.Colors
- SectionRow
- ShadowOverlayContainer
- ShadowOverlayHelper
- ShadowOverlayHelper.Builder
- ShadowOverlayHelper.Options
- SinglePresenterSelector
- SparseArrayObjectAdapter
- SpeechOrbView
- TitleHelper
- TitleView
- TitleViewAdapter
- VerticalGridPresenter
- VerticalGridPresenter.ViewHolder
- VerticalGridView