sk.baka.ambient.views.gesturelist
Class MutableListAdapter

java.lang.Object
  extended by android.widget.BaseAdapter
      extended by sk.baka.ambient.views.gesturelist.MutableListAdapter
All Implemented Interfaces:
Adapter, ListAdapter, SpinnerAdapter

public final class MutableListAdapter
extends BaseAdapter

An adapter backed by a list. Unlike ArrayAdapter this adapter supports the list redraw operation - you don't need to set new adapter instance to the ListView when the items are changed.

Author:
Martin Vysny

Field Summary
static Object EOP_MODEL_MARKER
          Marks the EOP item in the model.
protected  LayoutInflater inflater
          The inflater used to inflate new views.
static int ZOOMED_HEIGHT
          Height of zoomed views, in pixels.
 
Fields inherited from interface android.widget.Adapter
IGNORE_ITEM_VIEW_TYPE, NO_SELECTION
 
Constructor Summary
MutableListAdapter(GesturesListView owner, ModelHolder model)
          Creates new adapter.
 
Method Summary
 void eopModified()
          The EOP state should be modified.
 int getCount()
           
 Object getItem(int position)
           
 long getItemId(int position)
           
 View getView(int arg0, View arg1, ViewGroup arg2)
           
 boolean isEOP(int position)
          Checks if given item is the EOP item.
 void notifyModified()
          Redraws items and reflects changes made to the ModelHolder.getModel() list.
 void setEOP(boolean visible)
          The EOP state should be modified.
 void zoom(boolean zoom)
          Zooms or un-zooms the items.
 
Methods inherited from class android.widget.BaseAdapter
areAllItemsEnabled, getDropDownView, getItemViewType, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetChanged, notifyDataSetInvalidated, registerDataSetObserver, unregisterDataSetObserver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inflater

protected final LayoutInflater inflater
The inflater used to inflate new views.


ZOOMED_HEIGHT

public static final int ZOOMED_HEIGHT
Height of zoomed views, in pixels.

See Also:
Constant Field Values

EOP_MODEL_MARKER

public static final Object EOP_MODEL_MARKER
Marks the EOP item in the model.

Constructor Detail

MutableListAdapter

public MutableListAdapter(GesturesListView owner,
                          ModelHolder model)
Creates new adapter.

Parameters:
owner - owning list view
model - the model
Method Detail

getView

public final View getView(int arg0,
                          View arg1,
                          ViewGroup arg2)

getCount

public int getCount()

isEOP

public boolean isEOP(int position)
Checks if given item is the EOP item.

Parameters:
position - the position
Returns:
true if it is EOP, false otherwise.

getItem

public Object getItem(int position)

getItemId

public long getItemId(int position)

eopModified

public void eopModified()
The EOP state should be modified. Update if needed.


setEOP

public void setEOP(boolean visible)
The EOP state should be modified. Update if needed.

Parameters:
visible - if true then show EOP, if false then hide it.

notifyModified

public void notifyModified()
Redraws items and reflects changes made to the ModelHolder.getModel() list.


zoom

public void zoom(boolean zoom)
Zooms or un-zooms the items.

Parameters:
zoom - true if zoom the view.


Copyright © 2007-2008. All Rights Reserved.