java.lang.Object | |||||
↳ | android.view.View | ||||
↳ | android.view.ViewGroup | ||||
↳ | com.htc.widget.HtcAdapterView<T extends android.widget.Adapter> | ||||
↳ | com.htc.widget.HtcAbsListView | ||||
↳ | com.htc.widget.HtcListView |
A view that shows items in a vertically scrolling list. The items
come from the ListAdapter
associated with this view.
See the List View tutorial.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
HtcListView.FixedViewInfo | A class that represents a fixed view in a list, for example a header at the top or a footer at the bottom. |
XML Attributes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
android:divider | Drawable or color to draw between list items. | ||||||||||
android:dividerHeight | Height of the divider. | ||||||||||
android:entries | Reference to an array resource that will populate the ListView. | ||||||||||
android:footerDividersEnabled | When set to false, the ListView will not draw the divider before each footer view. | ||||||||||
android:headerDividersEnabled | When set to false, the ListView will not draw the divider after each header view. |
[Expand]
Inherited XML Attributes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DEFAULT_INTRO_ANIMATION | Used to indicate the intro animation type | |||||||||
int | DOWN_INTRO_ANIMATION | ||||||||||
int | LEFT_INTRO_ANIMATION | ||||||||||
int | RIGHT_INTRO_ANIMATION | ||||||||||
int | UP_INTRO_ANIMATION |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
mBoucingAnimatorSet | |||||||||||
mEmptyHeight |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a fixed view to appear at the bottom of the list.
| |||||||||||
Adds a fixed view to appear at the bottom of the list.
| |||||||||||
Adds a fixed view to appear at the bottom of the list.
| |||||||||||
Adds a fixed view to appear at the top of the list.
| |||||||||||
Adds a fixed view to appear at the top of the list.
| |||||||||||
Enables or disables one kind of animation;
default : enable all animations
HtcAbsListView.ANIM_OVERSCROLL, ANIM_INTRO, ANIM_CLICK, ANIM_ADD, ANIM_DEL;
can use bit operation, e.g.: ANIM_OVERSCROLL & ANIM_INTRO
| |||||||||||
Returns the adapter currently in use in this ListView.
| |||||||||||
This method is deprecated.
Use #getCheckedItemIds() instead.
| |||||||||||
Returns the drawable that will be drawn between each item in the list.
| |||||||||||
Returns the number of footer views in the list.
| |||||||||||
Returns the number of header views in the list.
| |||||||||||
Callback method to be invoked when the list or grid has been scrolled.
| |||||||||||
Callback method to be invoked while the list view or grid view is being scrolled.
| |||||||||||
Removes a previously-added footer view.
| |||||||||||
Removes a previously-added header view.
| |||||||||||
Enables or disables 2D Press Animation
| |||||||||||
Enables activated background for item in portrait mode.
| |||||||||||
Sets the data behind this ListView.
| |||||||||||
When set to a non-zero value, the cache color hint indicates that this list is always drawn
on top of a solid, single-color, opaque background.
| |||||||||||
Sets the scale X of item of click animation.
| |||||||||||
Sets the scale Y of item of click animation.
| |||||||||||
Specifies if the background is in dark style.
| |||||||||||
Sets the drawable that will be drawn between each item in the list.
| |||||||||||
Sets the height of the divider that will be drawn between each item in the list.
| |||||||||||
Sets whether draw the bottom shadow of listView
| |||||||||||
Sets whether draw the shadow of pressed item or not
| |||||||||||
Sets whether listview will expand height to fill parent without showing listview background.
| |||||||||||
Enables or disables the drawing of the divider for footer views.
| |||||||||||
Enables or disables the drawing of the divider for header views.
| |||||||||||
Sets the delay in milliseconds before the intro animation runs
| |||||||||||
Indicates the intro aniamtion type
| |||||||||||
Indicates that the views created by the ListAdapter can contain focusable
items.
| |||||||||||
Sets the drawable that will be drawn below all other list content.
| |||||||||||
Sets the drawable that will be drawn above all other list content.
| |||||||||||
Sets up this AbsListView to use a remote views adapter which connects to a RemoteViewsService
through the specified intent.
| |||||||||||
Sets the currently selected item.
| |||||||||||
setSelectionAfterHeaderView set the selection to be the first list item
after the header views.
| |||||||||||
Sets the selected item and positions the selection y pixels from the top edge
of the ListView.
| |||||||||||
Smoothly scrolls to the specified adapter position offset.
| |||||||||||
Smoothly scrolls to the specified adapter position.
| |||||||||||
Plays the intro animation
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Drawable or color to draw between list items.
May be a reference to another resource, in the form "@[+][package:]type:name
"
or to a theme attribute in the form "?[package:][type:]name
".
May be a color value, in the form of "#rgb
", "#argb
",
"#rrggbb
", or "#aarrggbb
".
This corresponds to the global attribute resource symbol divider
.
Height of the divider. Will use the intrinsic height of the divider if this is not specified.
Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp
".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute resource symbol dividerHeight
.
Reference to an array resource that will populate the ListView. For static content, this is simpler than populating the ListView programmatically.
Must be a reference to another resource, in the form "@[+][package:]type:name
"
or to a theme attribute in the form "?[package:][type:]name
".
This corresponds to the global attribute resource symbol entries
.
When set to false, the ListView will not draw the divider before each footer view. The default value is true.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute resource symbol footerDividersEnabled
.
When set to false, the ListView will not draw the divider after each header view. The default value is true.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute resource symbol headerDividersEnabled
.
Used to indicate the intro animation type
Adds a fixed view to appear at the bottom of the list. If addFooterView is called more than once, the views will appear in the order they were added. Views added using this call can take focus if they want.
NOTE: Call this before calling setAdapter. This is so ListView can wrap the supplied cursor with one that that will also account for header views.
v | The view to add. |
---|---|
data | Data to associate with this view |
isSelectable | true if the footer view can be selected |
Adds a fixed view to appear at the bottom of the list. If addFooterView is called more than once, the views will appear in the order they were added. Views added using this call can take focus if they want.
NOTE: Call this before calling setAdapter. This is so ListView can wrap the supplied cursor with one that will also account for header and footer views.
v | The view to add. |
---|---|
data | Data to associate with this view |
isSelectable | true if the footer view can be selected |
Adds a fixed view to appear at the bottom of the list. If addFooterView is called more than once, the views will appear in the order they were added. Views added using this call can take focus if they want.
NOTE: Call this before calling setAdapter. This is so ListView can wrap the supplied cursor with one that will also account for header and footer views.
v | The view to add. |
---|
Adds a fixed view to appear at the top of the list. If addHeaderView is called more than once, the views will appear in the order they were added. Views added using this call can take focus if they want.
NOTE: Call this before calling setAdapter. This is so ListView can wrap the supplied cursor with one that will also account for header and footer views.
v | The view to add. |
---|---|
data | Data to associate with this view |
isSelectable | Whether the item is selectable |
Adds a fixed view to appear at the top of the list. If addHeaderView is called more than once, the views will appear in the order they were added. Views added using this call can take focus if they want.
NOTE: Call this before calling setAdapter. This is so ListView can wrap the supplied cursor with one that will also account for header and footer views.
v | The view to add. |
---|
Enables or disables one kind of animation; default : enable all animations HtcAbsListView.ANIM_OVERSCROLL, ANIM_INTRO, ANIM_CLICK, ANIM_ADD, ANIM_DEL; can use bit operation, e.g.: ANIM_OVERSCROLL & ANIM_INTRO
anim_id | HtcAbsListView.ANIM_OVERSCROLL, ANIM_INTRO, ANIM_CLICK, ANIM_ADD, ANIM_DEL; |
---|---|
enable | true or false |
Returns the adapter currently in use in this ListView. The returned adapter
might not be the same adapter passed to setAdapter(ListAdapter)
but
might be a WrapperListAdapter.
This method is deprecated.
Use #getCheckedItemIds() instead.
Returns the set of checked items ids. The result is only valid if the
choice mode has not been set to CHOICE_MODE_NONE
.
Returns the drawable that will be drawn between each item in the list.
Returns the number of footer views in the list. Footer views are special views at the bottom of the list that should not be recycled during a layout.
Returns the number of header views in the list. Header views are special views at the top of the list that should not be recycled during a layout.
Callback method to be invoked when the list or grid has been scrolled. This will be called after the scroll has completed
view | The view whose scroll state is being reported |
---|---|
firstVisibleItem | The index of the first visible cell (ignore if visibleItemCount == 0) |
visibleItemCount | The number of visible cells |
totalItemCount | The number of items in the list adaptor |
Callback method to be invoked while the list view or grid view is being scrolled. If the
view is being scrolled, this method will be called before the next frame of the scroll is
rendered. In particular, it will be called before any calls to
getView(int, View, ViewGroup)
.
view | The view whose scroll state is being reported |
---|---|
scrollState | The current scroll state. One of #SCROLL_STATE_IDLE, #SCROLL_STATE_TOUCH_SCROLL or #SCROLL_STATE_IDLE. |
view | 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. |
Removes a previously-added footer view.
v | The view to remove |
---|
Removes a previously-added header view.
v | The view to remove |
---|
Enable or disable 2D Press Animation
Enables activated background for item in portrait mode. default value is false;
b | true: enable; false: disable |
---|
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.
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. |
---|
When set to a non-zero value, the cache color hint indicates that this list is always drawn
on top of a solid, single-color, opaque background.
Zero means that what's behind this object is translucent (non solid) or is not made of a
single color. This hint will not affect any existing background drawable set on this view (
typically set via setBackgroundDrawable(Drawable)
).
color | The background color |
---|
Sets the scale X of item of click animation.
Sets the scale Y of item of click animation.
Specifies if the background is in dark style. The would impact the background of the child item.
enabled | True if dark mode is enabled. |
---|
Sets the drawable that will be drawn between each item in the list. If the drawable does
not have an intrinsic height, you should also call setDividerHeight(int)
divider | The drawable to use. |
---|
Sets the height of the divider that will be drawn between each item in the list. Calling
this will override the intrinsic height as set by setDivider(Drawable)
height | The new height of the divider in pixels. |
---|
Sets whether draw the bottom shadow of listView
isEnabled | If true, draw bottom shadow of listView. Otherwise, do not draw it. |
---|
Sets whether draw the shadow of pressed item or not
isEnabled | If true, draw shadow of pressed item. Otherwise, do not draw it. |
---|
Sets whether listview will expand height to fill parent without showing listview background.
fillEmpty | Sets true to enable fill empty and false to disable. |
---|
Enables or disables the drawing of the divider for footer views.
footerDividersEnabled | True to draw the footers, false otherwise. |
---|
Enables or disables the drawing of the divider for header views.
headerDividersEnabled | True to draw the headers, false otherwise. |
---|
Sets the delay in milliseconds before the intro animation runs
Indicates the intro aniamtion type
type | The intro animation type |
---|
Indicates that the views created by the ListAdapter can contain focusable items.
itemsCanFocus | true if items can get focus, false otherwise |
---|
Sets the drawable that will be drawn below all other list content. This area can become visible when the user overscrolls the list, or when the list's content does not fully fill the container area.
footer | The drawable to use |
---|
Sets the drawable that will be drawn above all other list content. This area can become visible when the user overscrolls the list.
header | The drawable to use |
---|
Sets up this AbsListView to use a remote views adapter which connects to a RemoteViewsService through the specified intent.
intent | The intent used to identify the RemoteViewsService for the adapter to connect to. |
---|
Sets the currently selected item. If in touch mode, the item will not be selected but it will still be positioned appropriately. If the specified selection position is less than 0, then the item at position 0 will be selected.
position | Index (starting at 0) of the data item to be selected. |
---|
setSelectionAfterHeaderView set the selection to be the first list item after the header views.
Sets the selected item and positions the selection y pixels from the top edge of the ListView. (If in touch mode, the item will not be selected but it will still be positioned appropriately.)
position | Index (starting at 0) of the data item to be selected. |
---|---|
y | The distance from the top edge of the ListView (plus padding) that the item will be positioned. |
Smoothly scrolls to the specified adapter position offset. The view will scroll such that the indicated position is displayed.
offset | The amount to offset from the adapter position to scroll to. |
---|
Smoothly scrolls to the specified adapter position. The view will scroll such that the indicated position is displayed.
position | Scroll to this adapter position. |
---|