de.enough.polish.ui.containerviews
Class AlignAtContentContainerView

java.lang.Object
  extended by de.enough.polish.ui.ItemView
      extended by de.enough.polish.ui.ContainerView
          extended by de.enough.polish.ui.containerviews.AlignAtContentContainerView
All Implemented Interfaces:
Serializable

public class AlignAtContentContainerView
extends ContainerView

Aligns elements so that their contents start at the same position.

Usage:

 .myList {
                view-type: align-at-content;
                align-content-x: 30%; (optional)
 }
 

Copyright Enough Software 2008

Author:
Robert Virkus, j2mepolish@enough.de

Field Summary
 
Fields inherited from class de.enough.polish.ui.ContainerView
allowCycling, allowsAutoTraversal, allowsDirectSelectionByPointerEvent, appearanceMode, columnsSetting, columnsWidths, EQUAL_WIDTH_COLUMNS, focusedIndex, focusedItem, focusFirstElement, isAlignHeights, isExpandItems, isHorizontal, isPointerPressedHandled, isSequentialTraversal, isVertical, leftXOffset, NO_COLUMNS, NORMAL_WIDTH_COLUMNS, numberOfColumns, numberOfRows, parentContainer, restartAnimation, rightXOffset, rowsHeights, scrollContinuous, STATIC_WIDTH_COLUMNS, targetXOffset, topYOffset, xOffset, yOffset
 
Fields inherited from class de.enough.polish.ui.ItemView
availableHeight, availableWidth, contentHeight, contentWidth, isFocused, isLayoutCenter, isLayoutRight, layout, paddingHorizontal, paddingVertical, parentItem
 
Constructor Summary
AlignAtContentContainerView()
          Creates a new view type
 
Method Summary
protected  void initContent(Item parentContainerItem, int firstLineWidth, int availWidth, int availHeight)
          Initializes this container view.
protected  void setStyle(Style style)
          Sets the style for this view.
 
Methods inherited from class de.enough.polish.ui.ContainerView
addFullRepaintRegion, animate, destroy, focusItem, focusItem, focusItem, getAppearanceMode, getChildAt, getChildHeight, getChildWidth, getContentHeight, getContentWidth, getItemRelativeY, getNextFocusableItem, getNextItem, getParentRelativeY, getScreen, getScrollTargetXOffset, getScrollXOffset, handleKeyPressed, handlePointerDragged, handlePointerPressed, handlePointerReleased, handlePointerTouchDown, handlePointerTouchUp, initMargin, initPadding, isInBottomRow, isLayoutExpand, isValid, isVerticalLayout, isVirtualContainer, paintContent, paintContent, paintItem, releaseResources, scroll, setAppearanceMode, setScrollXOffset, setScrollXOffset, shiftFocus, shiftFocus, shiftFocus, showNotify, startScroll
 
Methods inherited from class de.enough.polish.ui.ItemView
addItemBackground, addItemBackgroundBorder, addItemBorder, adjustToContentArea, animate, defocus, focus, handleKeyReleased, handlePointerDragged, hideNotify, init, initContentByParent, notifyItemPressedEnd, notifyItemPressedEnd, notifyItemPressedStart, notifyItemPressedStart, onScreenSizeChanged, paintBackground, paintBorder, paintContentByParent, removeItemBackground, removeItemBorder, removeParentBackground, removeParentBorder, removeViewFromParent, requestInit, setContentHeight, setContentWidth, setStyle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlignAtContentContainerView

public AlignAtContentContainerView()
Creates a new view type

Method Detail

initContent

protected void initContent(Item parentContainerItem,
                           int firstLineWidth,
                           int availWidth,
                           int availHeight)
Description copied from class: ContainerView
Initializes this container view. The implementation needs to calculate and set the contentWidth and contentHeight fields. The style of the focused item has already been set. When the contentWidth will be larger than the specified availWidth, the container view allows to scroll horizontally automatically using pointer events.

Overrides:
initContent in class ContainerView
Parameters:
parentContainerItem - the Container which uses this view, use parent.getItems() for retrieving all items.
firstLineWidth - the maximum width of the first line
availWidth - the maximum width of any following lines
availHeight - the maximum height of the view
See Also:
ItemView.contentWidth, ItemView.contentHeight

setStyle

protected void setStyle(Style style)
Description copied from class: ContainerView
Sets the style for this view. The style can include additional parameters for the view. Subclasses should call super.setStyle(style) first.

Overrides:
setStyle in class ContainerView
Parameters:
style - the style