public class ExpandableHListView extends HListView
HListView by allowing two levels: groups which can
individually be expanded to show its children. The items come from the
ExpandableListAdapter associated with this view.
Expandable lists are able to show an indicator beside each item to display
the item's current state (the states are usually one of expanded group,
collapsed group, child, or last child). Use
setChildIndicator(Drawable) or setGroupIndicator(Drawable)
(or the corresponding XML attributes) to set these indicators (see the docs
for each method to see additional state that each Drawable can have). The
default style for an ExpandableHListView provides indicators which
will be shown next to Views given to the ExpandableHListView. The
layouts android.R.layout.simple_expandable_list_item_1 and
android.R.layout.simple_expandable_list_item_2 (which should be used with
SimpleCursorTreeAdapter) contain the preferred position information
for indicators.
The context menu information set by an ExpandableHListView will be a
ExpandableHListView.ExpandableListContextMenuInfo object with
ExpandableHListView.ExpandableListContextMenuInfo.packedPosition being a packed position
that can be used with getPackedPositionType(long) and the other
similar methods.
Note: You cannot use the value wrap_content
for the android:layout_height attribute of a
ExpandableListView in XML if the parent's size is also not strictly specified
(for example, if the parent were ScrollView you could not specify
wrap_content since it also can be any length. However, you can use
wrap_content if the ExpandableListView parent has a specific size, such as
100 pixels.| Modifier and Type | Class and Description |
|---|---|
static class |
ExpandableHListView.ExpandableListContextMenuInfo
Extra menu information specific to an
ExpandableHListView provided
to the
android.view.View.OnCreateContextMenuListener#onCreateContextMenu(ContextMenu, View, ContextMenuInfo)
callback when a context menu is brought up for this AdapterView. |
static interface |
ExpandableHListView.OnChildClickListener
Interface definition for a callback to be invoked when a child in this
expandable list has been clicked.
|
static interface |
ExpandableHListView.OnGroupClickListener
Interface definition for a callback to be invoked when a group in this
expandable list has been clicked.
|
static interface |
ExpandableHListView.OnGroupCollapseListener
Used for being notified when a group is collapsed
|
static interface |
ExpandableHListView.OnGroupExpandListener
Used for being notified when a group is expanded
|
HListView.FixedViewInfoAbsHListView.AdapterDataSetObserver, AbsHListView.LayoutParams, AbsHListView.OnScrollListener, AbsHListView.PositionScroller, AbsHListView.RecycleBin, AbsHListView.RecyclerListener, AbsHListView.SelectionBoundsAdjusterAdapterView.AdapterContextMenuInfo, AdapterView.OnItemClickListener, AdapterView.OnItemLongClickListener, AdapterView.OnItemSelectedListenerandroid.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListenerandroid.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnAttachStateChangeListener, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener| Modifier and Type | Field and Description |
|---|---|
static int |
CHILD_INDICATOR_INHERIT
Denotes when a child indicator should inherit this bound from the generic
indicator bounds
|
static int |
PACKED_POSITION_TYPE_CHILD
The packed position represents a child.
|
static int |
PACKED_POSITION_TYPE_GROUP
The packed position represents a group.
|
static int |
PACKED_POSITION_TYPE_NULL
The packed position represents a neither/null/no preference.
|
static long |
PACKED_POSITION_VALUE_NULL
The value for a packed position that represents neither/null/no
preference.
|
LAYOUT_FORCE_LEFT, LAYOUT_FORCE_RIGHT, LAYOUT_MOVE_SELECTION, LAYOUT_NORMAL, LAYOUT_SET_SELECTION, LAYOUT_SPECIFIC, LAYOUT_SYNC, mCachingActive, mCachingStarted, mCheckStates, mChoiceActionMode, mChoiceMode, mDataSetObserver, mHeightMeasureSpec, mIsAttached, mIsScrap, mLayoutMode, mListPadding, mMotionPosition, mOverscrollMax, mPositionScrollAfterLayout, mPositionScroller, mRecycler, mResurrectToPosition, mSelectedLeft, mSelectorRect, mStackFromRight, mTouchMode, OVERSCROLL_LIMIT_DIVISOR, STATESET_NOTHING, TOUCH_MODE_DONE_WAITING, TOUCH_MODE_DOWN, TOUCH_MODE_FLING, TOUCH_MODE_OVERFLING, TOUCH_MODE_OVERSCROLL, TOUCH_MODE_REST, TOUCH_MODE_SCROLL, TOUCH_MODE_TAP, TRANSCRIPT_MODE_ALWAYS_SCROLL, TRANSCRIPT_MODE_DISABLED, TRANSCRIPT_MODE_NORMALINVALID_COL_ID, INVALID_POSITION, ITEM_VIEW_TYPE_HEADER_OR_FOOTER, ITEM_VIEW_TYPE_IGNORE, LOG_ENABLED, mBlockLayoutRequests, mDataChanged, mFirstPosition, mInLayout, mItemCount, mNeedSync, mNextSelectedColId, mNextSelectedPosition, mOldItemCount, mOldSelectedColId, mOldSelectedPosition, mSelectedColId, mSelectedPosition, mSpecificLeft, mSyncColId, mSyncPosition, mSyncWidthCLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, LAYOUT_MODE_CLIP_BOUNDS, LAYOUT_MODE_OPTICAL_BOUNDS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHEACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y| Constructor and Description |
|---|
ExpandableHListView(android.content.Context context) |
ExpandableHListView(android.content.Context context,
android.util.AttributeSet attrs) |
ExpandableHListView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
collapseGroup(int groupPos)
Collapse a group in the grouped list view
|
protected void |
dispatchDraw(android.graphics.Canvas canvas) |
boolean |
expandGroup(int groupPos)
Expand a group in the grouped list view
|
boolean |
expandGroup(int groupPos,
boolean animate)
Expand a group in the grouped list view
|
android.widget.ListAdapter |
getAdapter()
This method should not be used, use
getExpandableListAdapter(). |
android.widget.ExpandableListAdapter |
getExpandableListAdapter()
Gets the adapter that provides data to this view.
|
long |
getExpandableListPosition(int flatListPosition)
Converts a flat list position (the raw position of an item (child or group)
in the list) to a group and/or child position (represented in a
packed position).
|
int |
getFlatListPosition(long packedPosition)
Converts a group and/or child position to a flat list position.
|
static int |
getPackedPositionChild(long packedPosition)
Gets the child position from a packed position that is of
PACKED_POSITION_TYPE_CHILD type (use getPackedPositionType(long)). |
static long |
getPackedPositionForChild(int groupPosition,
int childPosition)
Returns the packed position representation of a child's position.
|
static long |
getPackedPositionForGroup(int groupPosition)
Returns the packed position representation of a group's position.
|
static int |
getPackedPositionGroup(long packedPosition)
Gets the group position from a packed position.
|
static int |
getPackedPositionType(long packedPosition)
Gets the type of a packed position.
|
long |
getSelectedId()
Gets the ID of the currently selected group or child.
|
long |
getSelectedPosition()
Gets the position of the currently selected group or child (along with
its type).
|
boolean |
isGroupExpanded(int groupPosition)
Whether the given group is currently expanded.
|
void |
onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent event) |
void |
onInitializeAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo info) |
void |
onRestoreInstanceState(android.os.Parcelable state) |
void |
onRtlPropertiesChanged(int layoutDirection) |
android.os.Parcelable |
onSaveInstanceState() |
boolean |
performItemClick(android.view.View v,
int position,
long id)
Call the OnItemClickListener, if it is defined.
|
void |
setAdapter(android.widget.ExpandableListAdapter adapter)
Sets the adapter that provides data to this view.
|
void |
setAdapter(android.widget.ListAdapter adapter)
This overloaded method should not be used, instead use
setAdapter(ExpandableListAdapter). |
void |
setChildDivider(android.graphics.drawable.Drawable childDivider)
Sets the drawable that will be drawn adjacent to every child in the list.
|
void |
setChildIndicator(android.graphics.drawable.Drawable childIndicator)
Sets the indicator to be drawn next to a child.
|
void |
setGroupIndicator(android.graphics.drawable.Drawable groupIndicator)
Sets the indicator to be drawn next to a group.
|
void |
setOnChildClickListener(ExpandableHListView.OnChildClickListener onChildClickListener) |
void |
setOnGroupClickListener(ExpandableHListView.OnGroupClickListener onGroupClickListener) |
void |
setOnGroupCollapseListener(ExpandableHListView.OnGroupCollapseListener onGroupCollapseListener) |
void |
setOnGroupExpandListener(ExpandableHListView.OnGroupExpandListener onGroupExpandListener) |
void |
setOnItemClickListener(AdapterView.OnItemClickListener l)
Register a callback to be invoked when an item has been clicked and the
caller prefers to receive a ListView-style position instead of a group
and/or child position.
|
boolean |
setSelectedChild(int groupPosition,
int childPosition,
boolean shouldExpandGroup)
Sets the selection to the specified child.
|
void |
setSelectedGroup(int groupPosition)
Sets the selection to the specified group.
|
addFooterView, addFooterView, addHeaderView, addHeaderView, canAnimate, dispatchKeyEvent, drawChild, fillGap, findMotionCol, getCheckItemIds, getDivider, getDividerWidth, getFooterViewsCount, getHeaderViewsCount, getItemsCanFocus, getMaxScrollAmount, getOverscrollFooter, getOverscrollHeader, isOpaque, layoutChildren, lookForSelectablePosition, measureChild, onFinishInflate, onFocusChanged, onGlobalLayout, onKeyDown, onKeyMultiple, onKeyUp, onMeasure, onSizeChanged, recycleOnMeasure, removeFooterView, removeHeaderView, requestChildRectangleOnScreen, resetList, setCacheColorHint, setDivider, setDividerWidth, setFooterDividersEnabled, setHeaderDividersEnabled, setItemsCanFocus, setOverscrollFooter, setOverscrollHeader, setSelection, setSelectionAfterHeaderView, setSelectionFromLeft, setSelectionInt, smoothScrollByOffset, smoothScrollToPositionaddTouchables, checkInputConnectionProxy, checkLayoutParams, clearChoices, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, dispatchSetPressed, draw, drawableStateChanged, findClosestMotionCol, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getCacheColorHint, getCheckedItemCount, getCheckedItemIds, getCheckedItemPosition, getCheckedItemPositions, getChoiceMode, getContextMenuInfo, getDistance, getFocusedRect, getHorizontalScrollbarHeight, getHorizontalScrollFactor, getLeftFadingEdgeStrength, getListPaddingBottom, getListPaddingLeft, getListPaddingRight, getListPaddingTop, getRightFadingEdgeStrength, getSelectedView, getSelector, getSolidColor, getTranscriptMode, handleDataChanged, hideSelector, invalidateParentIfNeeded, invalidateViews, invokeOnItemScrollListener, isItemChecked, isScrollingCacheEnabled, isSmoothScrollbarEnabled, isStackFromRight, jumpDrawablesToCurrentState, keyPressed, obtainView, offsetChildrenLeftAndRight, onAttachedToWindow, onCreateDrawableState, onCreateInputConnection, onDetachedFromWindow, onGenericMotionEvent, onInterceptTouchEvent, onLayout, onOverScrolled, onTouchEvent, onTouchModeChanged, onWindowFocusChanged, performAccessibilityAction, performButtonActionOnTouchDown, pointToColId, pointToPosition, positionSelector, reclaimViews, reconcileSelectedPosition, requestDisallowInterceptTouchEvent, requestLayout, resurrectSelectionIfNeeded, sendAccessibilityEvent, setChoiceMode, setDrawSelectorOnTop, setFriction, setItemChecked, setMultiChoiceModeListener, setOnScrollListener, setOverScrollEffectPadding, setOverScrollMode, setRecyclerListener, setScrollIndicators, setScrollingCacheEnabled, setSelector, setSelector, setSmoothScrollbarEnabled, setStackFromRight, setTranscriptMode, setVelocityScale, setVisibleRangeHint, shouldShowSelector, showContextMenu, showContextMenuForChild, smoothScrollBy, smoothScrollBy, smoothScrollToPosition, smoothScrollToPositionFromLeft, smoothScrollToPositionFromLeft, updateScrollIndicators, verifyDrawableaddView, addView, addView, addView, checkFocus, checkSelectionChanged, dispatchPopulateAccessibilityEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, getCount, getEmptyView, getFirstVisiblePosition, getItemAtPosition, getItemIdAtPosition, getLastVisiblePosition, getOnItemClickListener, getOnItemLongClickListener, getOnItemSelectedListener, getPositionForView, getSelectedItem, getSelectedItemId, getSelectedItemPosition, onRequestSendAccessibilityEvent, rememberSyncState, removeAllViews, removeView, removeViewAt, setEmptyView, setFocusable, setFocusableInTouchMode, setNextSelectedPositionInt, setOnClickListener, setOnItemLongClickListener, setOnItemSelectedListener, setSelectedPositionIntaddChildrenForAccessibility, addFocusables, addStatesFromChildren, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchSetActivated, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, endViewTransition, findFocus, findViewsWithText, fitSystemWindows, focusableViewAvailable, focusSearch, gatherTransparentRegion, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getClipChildren, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getOverlay, getPersistentDrawingCache, hasFocus, hasFocusable, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isMotionEventSplittingEnabled, layout, measureChild, measureChildren, measureChildWithMargins, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAnimationEnd, onAnimationStart, onInterceptHoverEvent, onRequestFocusInDescendants, recomputeViewAttributes, removeAllViewsInLayout, removeDetachedView, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, shouldDelayChildPressedState, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayoutaddFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, clearAnimation, combineMeasuredStates, computeScroll, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, findViewById, findViewWithTag, focusSearch, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getClipBounds, getContentDescription, getContext, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getId, getImportantForAccessibility, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getResources, getRight, getRightPaddingOffset, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollX, getScrollY, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTranslationX, getTranslationY, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, hasOnClickListeners, hasOverlappingRendering, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, invalidateDrawable, isActivated, isAttachedToWindow, isClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isInEditMode, isInLayout, isInTouchMode, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isPaddingOffsetRequired, isPaddingRelative, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onCancelPendingInputEvents, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onDisplayHint, onDragEvent, onDraw, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishTemporaryDetach, onHoverChanged, onHoverEvent, onKeyLongPress, onKeyPreIme, onKeyShortcut, onPopulateAccessibilityEvent, onScreenStateChanged, onScrollChanged, onSetAlpha, onStartTemporaryDetach, onTrackballEvent, onVisibilityChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityLiveRegion, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBottom, setCameraDistance, setClickable, setClipBounds, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setKeepScreenOn, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setPadding, setPaddingRelative, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTop, setTouchDelegate, setTranslationX, setTranslationY, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, showContextMenu, startActionMode, startAnimation, startDrag, toString, unscheduleDrawable, unscheduleDrawable, willNotCacheDrawing, willNotDrawclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcanResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, requestFitSystemWindowspublic static final int PACKED_POSITION_TYPE_GROUP
public static final int PACKED_POSITION_TYPE_CHILD
public static final int PACKED_POSITION_TYPE_NULL
public static final long PACKED_POSITION_VALUE_NULL
public static final int CHILD_INDICATOR_INHERIT
public ExpandableHListView(android.content.Context context)
public ExpandableHListView(android.content.Context context,
android.util.AttributeSet attrs)
public ExpandableHListView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
public void onRtlPropertiesChanged(int layoutDirection)
onRtlPropertiesChanged in class android.view.Viewprotected void dispatchDraw(android.graphics.Canvas canvas)
dispatchDraw in class HListViewpublic void setChildDivider(android.graphics.drawable.Drawable childDivider)
HListView.setDivider(Drawable)) or
if it does not have an intrinsic height, the height set by HListView.setDividerWidth(int).childDivider - The drawable to use.public void setAdapter(android.widget.ListAdapter adapter)
setAdapter(ExpandableListAdapter).
Sets the data behind this ListView.
The adapter passed to this method may be wrapped by a WrapperListAdapter, depending on the ListView features currently
in use. For instance, adding headers and/or footers will cause the adapter to be wrapped.setAdapter in class HListViewadapter - The ListAdapter which is responsible for maintaining the data backing this list and for producing a view to
represent an item in that data set.HListView.getAdapter()public android.widget.ListAdapter getAdapter()
getExpandableListAdapter().getAdapter in class HListViewHListView.setAdapter(ListAdapter)public void setOnItemClickListener(AdapterView.OnItemClickListener l)
setOnGroupClickListener(it.sephiroth.android.library.widget.ExpandableHListView.OnGroupClickListener) and/or setOnChildClickListener(it.sephiroth.android.library.widget.ExpandableHListView.OnChildClickListener).
Register a callback to be invoked when an item in this AdapterView has been clicked.setOnItemClickListener in class AdapterView<android.widget.ListAdapter>l - The callback that will be invoked.public void setAdapter(android.widget.ExpandableListAdapter adapter)
adapter - The adapter that provides data to this view.public android.widget.ExpandableListAdapter getExpandableListAdapter()
public boolean performItemClick(android.view.View v,
int position,
long id)
AdapterViewperformItemClick in class AbsHListViewv - The view within the AdapterView that was clicked.position - The position of the view in the adapter.id - The col id of the item that was clicked.public boolean expandGroup(int groupPos)
groupPos - the group to be expandedpublic boolean expandGroup(int groupPos,
boolean animate)
groupPos - the group to be expandedanimate - true if the expanding group should be animated inpublic boolean collapseGroup(int groupPos)
groupPos - position of the group to collapsepublic void setOnGroupCollapseListener(ExpandableHListView.OnGroupCollapseListener onGroupCollapseListener)
public void setOnGroupExpandListener(ExpandableHListView.OnGroupExpandListener onGroupExpandListener)
public void setOnGroupClickListener(ExpandableHListView.OnGroupClickListener onGroupClickListener)
public void setOnChildClickListener(ExpandableHListView.OnChildClickListener onChildClickListener)
public long getExpandableListPosition(int flatListPosition)
ListView's methods. Use
getPackedPositionType(long) ,
getPackedPositionChild(long),
getPackedPositionGroup(long) to unpack.flatListPosition - The flat list position to be converted.public int getFlatListPosition(long packedPosition)
ListView's methods.packedPosition - The group and/or child positions to be converted in
packed position representation. Use
getPackedPositionForChild(int, int) or
getPackedPositionForGroup(int).public long getSelectedPosition()
PACKED_POSITION_VALUE_NULL if no selection.public long getSelectedId()
public void setSelectedGroup(int groupPosition)
groupPosition - The position of the group that should be selected.public boolean setSelectedChild(int groupPosition,
int childPosition,
boolean shouldExpandGroup)
groupPosition - The position of the group that contains the child.childPosition - The position of the child within the group.shouldExpandGroup - Whether the child's group should be expanded if
it is collapsed.public boolean isGroupExpanded(int groupPosition)
groupPosition - The group to check.public static int getPackedPositionType(long packedPosition)
getPackedPositionForChild(int, int).packedPosition - The packed position for which to return the type.PACKED_POSITION_TYPE_CHILD, PACKED_POSITION_TYPE_GROUP, or
PACKED_POSITION_TYPE_NULL.public static int getPackedPositionGroup(long packedPosition)
getPackedPositionForChild(int, int).packedPosition - The packed position from which the group position
will be returned.public static int getPackedPositionChild(long packedPosition)
PACKED_POSITION_TYPE_CHILD type (use getPackedPositionType(long)).
To get the group that this child belongs to, use
getPackedPositionGroup(long). See
getPackedPositionForChild(int, int).packedPosition - The packed position from which the child position
will be returned.public static long getPackedPositionForChild(int groupPosition,
int childPosition)
ExpandableListAdapter or ExpandableHListView method can
either be a child or group. The two positions are packed into a single
long which can be unpacked using
getPackedPositionChild(long),
getPackedPositionGroup(long), and
getPackedPositionType(long).groupPosition - The child's parent group's position.childPosition - The child position within the group.public static long getPackedPositionForGroup(int groupPosition)
getPackedPositionForChild(int, int).groupPosition - The child's parent group's position.public void setChildIndicator(android.graphics.drawable.Drawable childIndicator)
childIndicator - The drawable to be used as an indicator. If the
child is the last child for a group, the state
R.attr.state_last will be set.public void setGroupIndicator(android.graphics.drawable.Drawable groupIndicator)
groupIndicator - The drawable to be used as an indicator. If the
group is empty, the state R.attr.state_empty will be
set. If the group is expanded, the state
R.attr.state_expanded will be set.public android.os.Parcelable onSaveInstanceState()
onSaveInstanceState in class AbsHListViewpublic void onRestoreInstanceState(android.os.Parcelable state)
onRestoreInstanceState in class AbsHListViewpublic void onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent event)
onInitializeAccessibilityEvent in class HListViewpublic void onInitializeAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo info)
onInitializeAccessibilityNodeInfo in class HListView