|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.widget.BaseAdapter
org.solovyev.android.list.ListAdapter<T>
public class ListAdapter<T>
User: serso Date: 6/6/12 Time: 12:53 AM
| Nested Class Summary | |
|---|---|
class |
ListAdapter.AdapterHelper
|
| Field Summary |
|---|
| Fields inherited from interface android.widget.Adapter |
|---|
IGNORE_ITEM_VIEW_TYPE, NO_SELECTION |
| Constructor Summary | |
|---|---|
ListAdapter(android.content.Context context,
int textViewResourceId)
Constructor |
|
ListAdapter(android.content.Context context,
int resource,
int textViewResourceId)
Constructor |
|
ListAdapter(android.content.Context context,
int resource,
int textViewResourceId,
List<T> elements)
Constructor |
|
ListAdapter(android.content.Context context,
int resource,
int textViewResourceId,
T[] elements)
Constructor |
|
ListAdapter(android.content.Context context,
int textViewResourceId,
List<T> elements)
Constructor |
|
ListAdapter(android.content.Context context,
int textViewResourceId,
T[] elements)
Constructor |
|
| Method Summary | |
|---|---|
void |
add(T object)
Adds the specified object at the end of the array. |
void |
addAll(Collection<? extends T> collection)
Adds the specified Collection at the end of the array. |
void |
addAll(T... items)
Adds the specified items at the end of the array. |
void |
clear()
Remove all elements from the list. |
boolean |
containsInAll(T element)
|
boolean |
containsInShown(T element)
|
protected android.widget.Filter |
createFilter()
|
static ListAdapter<CharSequence> |
createFromResource(android.content.Context context,
int textArrayResId,
int textViewResId)
Creates a new ListAdapter from external resources. |
void |
doWork(Runnable runnable)
|
void |
filter(String filterText)
|
void |
filter(String filterText,
android.widget.Filter.FilterListener listener)
|
protected ListAdapter.AdapterHelper |
getAdapterHelper()
|
protected List<T> |
getAllElements()
|
protected Comparator<? super T> |
getComparator()
|
android.content.Context |
getContext()
Returns the context associated with this array adapter. |
int |
getCount()
|
android.view.View |
getDropDownView(int position,
android.view.View convertView,
android.view.ViewGroup parent)
|
android.widget.Filter |
getFilter()
|
CharSequence |
getFilterText()
|
T |
getItem(int position)
|
long |
getItemId(int position)
|
int |
getPosition(T item)
Returns the position of the specified item in the array. |
protected List<T> |
getShownElements()
|
android.view.View |
getView(int position,
android.view.View convertView,
android.view.ViewGroup parent)
|
void |
insert(T object,
int index)
Inserts the specified object at the specified index in the array. |
boolean |
isNotifyOnChange()
|
void |
notifyDataSetChanged()
|
protected void |
onDataSetChanged()
|
protected void |
onDataSetChanged(boolean resortAndRefilter)
|
void |
refilter()
|
void |
remove(T object)
Removes the specified object from the array. |
void |
removeAt(int position)
|
void |
restoreState(android.os.Bundle savedInstanceState)
|
void |
saveState(android.os.Bundle outState)
|
void |
setDropDownViewResource(int resource)
Sets the layout resource to create the drop down views. |
void |
setNotifyOnChange(boolean notifyOnChange)
Control whether methods that change the list ( add(T),
insert(T, int), remove(T), clear()) automatically call
notifyDataSetChanged(). |
void |
sort(Comparator<? super T> comparator)
Sorts the content of this adapter using the specified comparator. |
| Methods inherited from class android.widget.BaseAdapter |
|---|
areAllItemsEnabled, getItemViewType, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetInvalidated, registerDataSetObserver, unregisterDataSetObserver |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ListAdapter(@Nonnull
android.content.Context context,
int textViewResourceId)
context - The current context.textViewResourceId - The resource ID for a layout file containing a TextView to use when
instantiating views.
public ListAdapter(android.content.Context context,
int resource,
int textViewResourceId)
context - The current context.resource - The resource ID for a layout file containing a layout to use when
instantiating views.textViewResourceId - The id of the TextView within the layout resource to be populated
public ListAdapter(@Nonnull
android.content.Context context,
int textViewResourceId,
@Nonnull
T[] elements)
context - The current context.textViewResourceId - The resource ID for a layout file containing a TextView to use when
instantiating views.elements - The objects to represent in the ListView.
public ListAdapter(@Nonnull
android.content.Context context,
int resource,
int textViewResourceId,
@Nonnull
T[] elements)
context - The current context.resource - The resource ID for a layout file containing a layout to use when
instantiating views.textViewResourceId - The id of the TextView within the layout resource to be populatedelements - The objects to represent in the ListView.
public ListAdapter(@Nonnull
android.content.Context context,
int textViewResourceId,
@Nonnull
List<T> elements)
context - The current context.textViewResourceId - The resource ID for a layout file containing a TextView to use when
instantiating views.elements - The objects to represent in the ListView.
public ListAdapter(@Nonnull
android.content.Context context,
int resource,
int textViewResourceId,
@Nonnull
List<T> elements)
context - The current context.resource - The resource ID for a layout file containing a layout to use when
instantiating views.textViewResourceId - The id of the TextView within the layout resource to be populatedelements - The objects to represent in the ListView.| Method Detail |
|---|
public void add(T object)
object - The object to add at the end of the array.protected final void onDataSetChanged(boolean resortAndRefilter)
protected final void onDataSetChanged()
public void addAll(Collection<? extends T> collection)
collection - The Collection to add at the end of the array.public void addAll(T... items)
items - The items to add at the end of the array.
public void insert(T object,
int index)
object - The object to insert into the array.index - The index at which the object must be inserted.public void remove(T object)
object - The object to remove.public void removeAt(int position)
public void clear()
public void sort(Comparator<? super T> comparator)
comparator - The comparator used to sort the objects contained
in this adapter.public void notifyDataSetChanged()
notifyDataSetChanged in class android.widget.BaseAdapterpublic void setNotifyOnChange(boolean notifyOnChange)
add(T),
insert(T, int), remove(T), clear()) automatically call
notifyDataSetChanged(). If set to false, caller must
manually call notifyDataSetChanged() to have the changes
reflected in the attached view.
The default is true, and calling notifyDataSetChanged()
resets the flag to true.
notifyOnChange - if true, modifications to the list will
automatically call notifyDataSetChanged()@Nonnull public android.content.Context getContext()
public int getCount()
getCount in interface android.widget.Adapterpublic T getItem(int position)
getItem in interface android.widget.Adapterpublic int getPosition(T item)
item - The item to retrieve the position of.
public boolean containsInShown(@Nonnull
T element)
public boolean containsInAll(@Nonnull
T element)
public long getItemId(int position)
getItemId in interface android.widget.Adapter
public android.view.View getView(int position,
android.view.View convertView,
android.view.ViewGroup parent)
getView in interface android.widget.Adapter
public void doWork(@Nonnull
Runnable runnable)
public void setDropDownViewResource(int resource)
Sets the layout resource to create the drop down views.
resource - the layout resource defining the drop down viewsgetDropDownView(int, android.view.View, android.view.ViewGroup)
public android.view.View getDropDownView(int position,
android.view.View convertView,
android.view.ViewGroup parent)
getDropDownView in interface android.widget.SpinnerAdaptergetDropDownView in class android.widget.BaseAdapter
public static ListAdapter<CharSequence> createFromResource(android.content.Context context,
int textArrayResId,
int textViewResId)
Resources.getTextArray(int).
context - The application's environment.textArrayResId - The identifier of the array to use as the data source.textViewResId - The identifier of the layout used to create views.
public final android.widget.Filter getFilter()
getFilter in interface android.widget.Filterable@Nonnull protected android.widget.Filter createFilter()
@Nonnull protected List<T> getShownElements()
@Nonnull protected List<T> getAllElements()
@Nullable protected Comparator<? super T> getComparator()
public void saveState(@Nonnull
android.os.Bundle outState)
public void restoreState(@Nonnull
android.os.Bundle savedInstanceState)
@Nonnull protected ListAdapter.AdapterHelper getAdapterHelper()
public boolean isNotifyOnChange()
public void filter(@Nullable
String filterText)
public void filter(@Nullable
String filterText,
@Nullable
android.widget.Filter.FilterListener listener)
public void refilter()
@Nullable public CharSequence getFilterText()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||