IT. Expert System.

Android Reference

ExpandableListView


android.widget

Class ExpandableListView

    • Field Detail

      • PACKED_POSITION_TYPE_GROUP

        public static final int PACKED_POSITION_TYPE_GROUP
        The packed position represents a group.
        See Also:
        Constant Field Values
      • PACKED_POSITION_TYPE_CHILD

        public static final int PACKED_POSITION_TYPE_CHILD
        The packed position represents a child.
        See Also:
        Constant Field Values
      • PACKED_POSITION_TYPE_NULL

        public static final int PACKED_POSITION_TYPE_NULL
        The packed position represents a neither/null/no preference.
        See Also:
        Constant Field Values
      • PACKED_POSITION_VALUE_NULL

        public static final long PACKED_POSITION_VALUE_NULL
        The value for a packed position that represents neither/null/no preference. This value is not otherwise possible since a group type (first bit 0) should not have a child position filled.
        See Also:
        Constant Field Values
      • CHILD_INDICATOR_INHERIT

        public static final int CHILD_INDICATOR_INHERIT
        Denotes when a child indicator should inherit this bound from the generic indicator bounds
        See Also:
        Constant Field Values
    • Constructor Detail

      • ExpandableListView

        public ExpandableListView(Context context)
      • ExpandableListView

        public ExpandableListView(Context context,
                          AttributeSet attrs,
                          int defStyle)
    • Method Detail

      • dispatchDraw

        protected void dispatchDraw(Canvas canvas)
        Description copied from class: ViewGroup
        Called by draw to draw the child views. This may be overridden by derived classes to gain control just before its children are drawn (but after its own view has been drawn).
        Overrides:
        dispatchDraw in class ListView
        Parameters:
        canvas - the canvas on which to draw the view
      • setChildDivider

        public void setChildDivider(Drawable childDivider)
        Sets the drawable that will be drawn adjacent to every child in the list. This will be drawn using the same height as the normal divider (ListView.setDivider(Drawable)) or if it does not have an intrinsic height, the height set by ListView.setDividerHeight(int).
        Parameters:
        childDivider - The drawable to use.
      • setAdapter

        public void setAdapter(ListAdapter adapter)
        This overloaded method should not be used, instead use 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.

        Overrides:
        setAdapter in class ListView
        Parameters:
        adapter - 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.
        See Also:
        ListView.getAdapter()
      • setAdapter

        public void setAdapter(ExpandableListAdapter adapter)
        Sets the adapter that provides data to this view.
        Parameters:
        adapter - The adapter that provides data to this view.
      • getExpandableListAdapter

        public ExpandableListAdapter getExpandableListAdapter()
        Gets the adapter that provides data to this view.
        Returns:
        The adapter that provides data to this view.
      • performItemClick

        public boolean performItemClick(View v,
                               int position,
                               long id)
        Description copied from class: AdapterView
        Call the OnItemClickListener, if it is defined.
        Overrides:
        performItemClick in class AbsListView
        Parameters:
        v - The view within the AdapterView that was clicked.
        position - The position of the view in the adapter.
        id - The row id of the item that was clicked.
        Returns:
        True if there was an assigned OnItemClickListener that was called, false otherwise is returned.
      • expandGroup

        public boolean expandGroup(int groupPos)
        Expand a group in the grouped list view
        Parameters:
        groupPos - the group to be expanded
        Returns:
        True if the group was expanded, false otherwise (if the group was already expanded, this will return false)
      • expandGroup

        public boolean expandGroup(int groupPos,
                          boolean animate)
        Expand a group in the grouped list view
        Parameters:
        groupPos - the group to be expanded
        animate - true if the expanding group should be animated in
        Returns:
        True if the group was expanded, false otherwise (if the group was already expanded, this will return false)
      • collapseGroup

        public boolean collapseGroup(int groupPos)
        Collapse a group in the grouped list view
        Parameters:
        groupPos - position of the group to collapse
        Returns:
        True if the group was collapsed, false otherwise (if the group was already collapsed, this will return false)
      • getExpandableListPosition

        public 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). This is useful in situations where the caller needs to use the underlying ListView's methods. Use getPackedPositionType(long) , getPackedPositionChild(long), getPackedPositionGroup(long) to unpack.
        Parameters:
        flatListPosition - The flat list position to be converted.
        Returns:
        The group and/or child position for the given flat list position in packed position representation. #PACKED_POSITION_VALUE_NULL if the position corresponds to a header or a footer item.
      • getFlatListPosition

        public int getFlatListPosition(long packedPosition)
        Converts a group and/or child position to a flat list position. This is useful in situations where the caller needs to use the underlying ListView's methods.
        Parameters:
        packedPosition - The group and/or child positions to be converted in packed position representation. Use getPackedPositionForChild(int, int) or getPackedPositionForGroup(int).
        Returns:
        The flat list position for the given child or group.
      • getSelectedPosition

        public long getSelectedPosition()
        Gets the position of the currently selected group or child (along with its type). Can return PACKED_POSITION_VALUE_NULL if no selection.
        Returns:
        A packed position containing the currently selected group or child's position and type. #PACKED_POSITION_VALUE_NULL if no selection or if selection is on a header or a footer item.
      • getSelectedId

        public long getSelectedId()
        Gets the ID of the currently selected group or child. Can return -1 if no selection.
        Returns:
        The ID of the currently selected group or child. -1 if no selection.
      • setSelectedGroup

        public void setSelectedGroup(int groupPosition)
        Sets the selection to the specified group.
        Parameters:
        groupPosition - The position of the group that should be selected.
      • setSelectedChild

        public boolean setSelectedChild(int groupPosition,
                               int childPosition,
                               boolean shouldExpandGroup)
        Sets the selection to the specified child. If the child is in a collapsed group, the group will only be expanded and child subsequently selected if shouldExpandGroup is set to true, otherwise the method will return false.
        Parameters:
        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.
        Returns:
        Whether the selection was successfully set on the child.
      • isGroupExpanded

        public boolean isGroupExpanded(int groupPosition)
        Whether the given group is currently expanded.
        Parameters:
        groupPosition - The group to check.
        Returns:
        Whether the group is currently expanded.
      • getPackedPositionGroup

        public static int getPackedPositionGroup(long packedPosition)
        Gets the group position from a packed position. See getPackedPositionForChild(int, int).
        Parameters:
        packedPosition - The packed position from which the group position will be returned.
        Returns:
        The group position portion of the packed position. If this does not contain a group, returns -1.
      • getPackedPositionForChild

        public static long getPackedPositionForChild(int groupPosition,
                                     int childPosition)
        Returns the packed position representation of a child's position.

        In general, a packed position should be used in situations where the position given to/returned from an ExpandableListAdapter or ExpandableListView 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).

        Parameters:
        groupPosition - The child's parent group's position.
        childPosition - The child position within the group.
        Returns:
        The packed position representation of the child (and parent group).
      • getPackedPositionForGroup

        public static long getPackedPositionForGroup(int groupPosition)
        Returns the packed position representation of a group's position. See getPackedPositionForChild(int, int).
        Parameters:
        groupPosition - The child's parent group's position.
        Returns:
        The packed position representation of the group.
      • setChildIndicator

        public void setChildIndicator(Drawable childIndicator)
        Sets the indicator to be drawn next to a child.
        Parameters:
        childIndicator - The drawable to be used as an indicator. If the child is the last child for a group, the state android.R.attr#state_last will be set.
      • setChildIndicatorBounds

        public void setChildIndicatorBounds(int left,
                                   int right)
        Sets the drawing bounds for the child indicator. For either, you can specify CHILD_INDICATOR_INHERIT to use inherit from the general indicator's bounds.
        Parameters:
        left - The left position (relative to the left bounds of this View) to start drawing the indicator.
        right - The right position (relative to the left bounds of this View) to end the drawing of the indicator.
        See Also:
        setIndicatorBounds(int, int)
      • setGroupIndicator

        public void setGroupIndicator(Drawable groupIndicator)
        Sets the indicator to be drawn next to a group.
        Parameters:
        groupIndicator - The drawable to be used as an indicator. If the group is empty, the state android.R.attr#state_empty will be set. If the group is expanded, the state android.R.attr#state_expanded will be set.
      • setIndicatorBounds

        public void setIndicatorBounds(int left,
                              int right)
        Sets the drawing bounds for the indicators (at minimum, the group indicator is affected by this; the child indicator is affected by this if the child indicator bounds are set to inherit).
        Parameters:
        left - The left position (relative to the left bounds of this View) to start drawing the indicator.
        right - The right position (relative to the left bounds of this View) to end the drawing of the indicator.
        See Also:
        setChildIndicatorBounds(int, int)
      • onSaveInstanceState

        public Parcelable onSaveInstanceState()
        Description copied from class: View
        Hook allowing a view to generate a representation of its internal state that can later be used to create a new instance with that same state. This state should only contain information that is not persistent or can not be reconstructed later. For example, you will never store your current position on screen because that will be computed again when a new instance of the view is placed in its view hierarchy.

        Some examples of things you may store here: the current cursor position in a text view (but usually not the text itself since that is stored in a content provider or other persistent storage), the currently selected item in a list view.

        Overrides:
        onSaveInstanceState in class AbsListView
        Returns:
        Returns a Parcelable object containing the view's current dynamic state, or null if there is nothing interesting to save. The default implementation returns null.
        See Also:
        View.onRestoreInstanceState(android.os.Parcelable), View.saveHierarchyState(android.util.SparseArray), View.dispatchSaveInstanceState(android.util.SparseArray), View.setSaveEnabled(boolean)


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 596 / . Delta: 0.13066 с