sk.baka.ambient.activity.search
Class StringListController

java.lang.Object
  extended by sk.baka.ambient.activity.main.AbstractController
      extended by sk.baka.ambient.activity.main.AbstractListController
          extended by sk.baka.ambient.activity.search.StringListController
All Implemented Interfaces:
IGestureListViewListener

public class StringListController
extends AbstractListController

Shows an immutable list of strings.

Author:
Martin Vysny

Nested Class Summary
 
Nested classes/interfaces inherited from class sk.baka.ambient.activity.main.AbstractController
AbstractController.Listener
 
Field Summary
 
Fields inherited from class sk.baka.ambient.activity.main.AbstractListController
highlightColor, listView
 
Fields inherited from class sk.baka.ambient.activity.main.AbstractController
app, cycle, listener, mainActivity, mainView
 
Constructor Summary
StringListController(int listViewId, SearchActivity mainActivity)
          Creates new controller.
 
Method Summary
 void itemActivated(int index, Object model)
          The item was activated, either by clicking on it or using a keyboard.
protected  void recomputeListItems()
          Recomputes the model.
 void setContent(List<String> content)
          Sets the content and updates the list view.
 void update(GesturesListView listView, View itemView, int index, Object model)
          An item view is being drawn (or re-drawn) on screen.
 
Methods inherited from class sk.baka.ambient.activity.main.AbstractListController
canComputeItems, canHighlight, computeTracks, destroy, dropItems, getClipboard, getHint, highlightChanged, isComputeTracksLong, isComputeTracksOnlineOp, isReadOnly, moveItems, moveItemsByOne, performZoom, removeItems, setClipboard, update
 
Methods inherited from class sk.baka.ambient.activity.main.AbstractController
equals, flipVisibility, hashCode, hide, initButtonBar, initButtonBar, initButtonBar, isDestroyed, isVisible, isZoomed, onAction, setVisibility, show, visibilityChanged, zoom
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringListController

public StringListController(int listViewId,
                            SearchActivity mainActivity)
Creates new controller.

Parameters:
listViewId - the list view id.
mainActivity - owning activity.
Method Detail

setContent

public void setContent(List<String> content)
Sets the content and updates the list view.

Parameters:
content - the content.

recomputeListItems

protected void recomputeListItems()
Description copied from class: AbstractListController
Recomputes the model. You don't have to call the ModelHolder.notifyModified() - it is called automatically after the method finishes.

Specified by:
recomputeListItems in class AbstractListController

itemActivated

public void itemActivated(int index,
                          Object model)
Description copied from interface: IGestureListViewListener
The item was activated, either by clicking on it or using a keyboard.

Parameters:
index - the index of the item.
model - the model for the item.

update

public void update(GesturesListView listView,
                   View itemView,
                   int index,
                   Object model)
Description copied from interface: IGestureListViewListener
An item view is being drawn (or re-drawn) on screen. The implementation should correctly set the view contents, based on the model object. The model object is taken from the GesturesListView.getModel() list. The only exception is the EOP special item. For more information please read here.

Parameters:
listView - the listview containing the view
itemView - the view representing a single item
index - the index in the GesturesListView.getModel() list. May point outside of the model list only when drawing an EOP item.
model - The model object, taken from the GesturesListView.getModel() list. This value may optionally be the MutableListAdapter.EOP_MODEL_MARKER object - in this case the special EndOfPlaylist item must be drawn.


Copyright © 2007-2008. All Rights Reserved.