sk.baka.ambient.activity.main
Class PlaylistManagerController

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.main.PlaylistManagerController
All Implemented Interfaces:
IGestureListViewListener

public final class PlaylistManagerController
extends AbstractListController

Controls the playlist manager.

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
PlaylistManagerController(MainActivity mainActivity)
          Creates new playlist manager controller instance.
 
Method Summary
 boolean isReadOnly()
          Checks if the list view is currently read-only.
 void itemActivated(int index, Object model)
          The item was activated, either by clicking on it or using a keyboard.
 void loadPlaylist(String name)
          Loads playlist with given name.
protected  void onAction(ActionsEnum action)
          Called when an action button is pressed.
protected  void performZoom(boolean zoom)
          Zooms, or un-zooms the controller.
protected  void recomputeListItems()
          Recomputes the model.
 void removeItems(Interval remove)
           Remove these items from the list.
 void savePlaylistWizard(Context context)
          Navigates user through a 'save playlist' wizard.
 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, moveItems, moveItemsByOne, setClipboard, update
 
Methods inherited from class sk.baka.ambient.activity.main.AbstractController
equals, flipVisibility, hashCode, hide, initButtonBar, initButtonBar, initButtonBar, isDestroyed, isVisible, isZoomed, setVisibility, show, visibilityChanged, zoom
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlaylistManagerController

public PlaylistManagerController(MainActivity mainActivity)
Creates new playlist manager controller instance.

Parameters:
mainActivity -
Method Detail

onAction

protected void onAction(ActionsEnum action)
Description copied from class: AbstractController
Called when an action button is pressed. By default invokes main activity. Subclasses can override.

Overrides:
onAction in class AbstractController
Parameters:
action - the action to take

savePlaylistWizard

public void savePlaylistWizard(Context context)
Navigates user through a 'save playlist' wizard.

Parameters:
context - the context.

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

isReadOnly

public boolean isReadOnly()
Description copied from interface: IGestureListViewListener
Checks if the list view is currently read-only.

Specified by:
isReadOnly in interface IGestureListViewListener
Overrides:
isReadOnly in class AbstractListController
Returns:
true if the view cannot be modified, false otherwise.

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.

loadPlaylist

public void loadPlaylist(String name)
Loads playlist with given name. Shows an error message when the playlist failed to be loaded.

Parameters:
name - the name of the playlist.

removeItems

public void removeItems(Interval remove)
Description copied from interface: IGestureListViewListener

Remove these items from the list. The list view sets the highlight automatically to zero interval.

This operation is invoked even when IGestureListViewListener.isReadOnly() returns false as some use cases activates a "Go Back" activity instead of deleting items.

Specified by:
removeItems in interface IGestureListViewListener
Overrides:
removeItems in class AbstractListController
Parameters:
remove - remove these items. The interval is not null however it may be empty.

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.

performZoom

protected void performZoom(boolean zoom)
Description copied from class: AbstractController
Zooms, or un-zooms the controller.

Overrides:
performZoom in class AbstractListController
Parameters:
zoom - true zoom the controller in, false zoom the controller out.


Copyright © 2007-2008. All Rights Reserved.