|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsk.baka.ambient.activity.main.AbstractController
sk.baka.ambient.activity.main.AbstractListController
sk.baka.ambient.activity.main.ShoutcastController
public final class ShoutcastController
Controls the shoutcast server manager.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class sk.baka.ambient.activity.main.AbstractController |
|---|
AbstractController.Listener |
| Field Summary | |
|---|---|
static List<ActionsEnum> |
actions
The actions to display on the Task switcher. |
| 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 | |
|---|---|
ShoutcastController(MainActivity activity,
GesturesListView playlistView)
Creates the shoutcast controller instance. |
|
| Method Summary | |
|---|---|
boolean |
canComputeItems()
Checks if the model currently supports computing tracks. |
boolean |
canHighlight()
Checks if we can start highlight mode now. |
List<TrackMetadataBean> |
computeTracks(Interval highlight)
Retrieve a list of tracks from the selection. |
void |
destroy()
The controller is about to be destroyed. |
String |
getHint(Interval highlight)
Returns a very short and simple string representation of the selected contents. |
boolean |
isComputeTracksLong(Interval interval)
Checks if the IGestureListViewListener.computeTracks(Interval) method will be a long
operation. |
boolean |
isComputeTracksOnlineOp(Interval interval)
Checks if the IGestureListViewListener.computeTracks(Interval) method will involve
polling of some data from the Internet. |
void |
itemActivated(int index,
Object model)
The item was activated, either by clicking on it or using a keyboard. |
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 |
showGenre(String genre)
Browse given genre. |
void |
update(GesturesListView listView,
View itemView,
int index,
Object model)
An item view is being drawn (or re-drawn) on screen. |
protected void |
visibilityChanged(boolean visible)
Invoked when the component visibility changes. |
| Methods inherited from class sk.baka.ambient.activity.main.AbstractListController |
|---|
dropItems, getClipboard, highlightChanged, isReadOnly, 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, zoom |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final List<ActionsEnum> actions
| Constructor Detail |
|---|
public ShoutcastController(MainActivity activity,
GesturesListView playlistView)
activity - the activity instance.playlistView - the playlist view| Method Detail |
|---|
public void destroy()
AbstractControllersuper() if you override
this method!
destroy in class AbstractListControllerprotected void onAction(ActionsEnum action)
AbstractController
onAction in class AbstractControlleraction - the action to takeprotected void visibilityChanged(boolean visible)
AbstractController
visibilityChanged in class AbstractControllervisible - new visibility flag.protected void recomputeListItems()
AbstractListControllermodel. You don't have
to call the ModelHolder.notifyModified() - it is called
automatically after the method finishes.
recomputeListItems in class AbstractListControllerpublic String getHint(Interval highlight)
IGestureListViewListenerReturns a very short and simple string representation of the selected contents.
This method is only invoked when IGestureListViewListener.canComputeItems() returns
true.
getHint in interface IGestureListViewListenergetHint in class AbstractListControllerhighlight - the highlighted items.
null
if no hint should be shown.public boolean isComputeTracksLong(Interval interval)
IGestureListViewListener
Checks if the IGestureListViewListener.computeTracks(Interval) method will be a long
operation. If yes, then the operation will be run in new thread. If not,
the operation will be run in handler event thread.
This method is only invoked when IGestureListViewListener.canComputeItems() returns
true.
isComputeTracksLong in interface IGestureListViewListenerisComputeTracksLong in class AbstractListControllerinterval - the selection
true if long operation, false
otherwise.public boolean isComputeTracksOnlineOp(Interval interval)
IGestureListViewListener
Checks if the IGestureListViewListener.computeTracks(Interval) method will involve
polling of some data from the Internet.
This method is only invoked when IGestureListViewListener.canComputeItems() returns
true.
isComputeTracksOnlineOp in interface IGestureListViewListenerisComputeTracksOnlineOp in class AbstractListControllerinterval - the selection
true if some Internet resources will be polled,
false otherwise.public boolean canComputeItems()
IGestureListViewListener
canComputeItems in interface IGestureListViewListenercanComputeItems in class AbstractListControllertrue if the model can compute tracks,
false otherwise.public boolean canHighlight()
IGestureListViewListener
canHighlight in interface IGestureListViewListenercanHighlight in class AbstractListControllertrue if highlight mode can be started,
false otherwise.
public void itemActivated(int index,
Object model)
IGestureListViewListener
index - the index of the item.model - the model for the item.public void removeItems(Interval remove)
IGestureListViewListenerRemove 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.
removeItems in interface IGestureListViewListenerremoveItems in class AbstractListControllerremove - remove these items. The interval is not null
however it may be empty.
public void update(GesturesListView listView,
View itemView,
int index,
Object model)
IGestureListViewListenerGesturesListView.getModel() list.
The only exception is the EOP special item. For more information please
read here.
listView - the listview containing the viewitemView - the view representing a single itemindex - 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.public List<TrackMetadataBean> computeTracks(Interval highlight)
IGestureListViewListener
Retrieve a list of tracks from the selection. This operation may not be
invoked from the handler's thread (depending on the result of the
IGestureListViewListener.isComputeTracksLong(Interval) method). The method implementation
should thus periodically check for the interrupted flag. When interrupted, it should return an empty list or
null ASAP. It may do so by throwing an exception
If the method is invoked in a non-handler thread the callee wraps the result in a thread-safe list.
The method may throw RuntimeException - it will be caught and
displayed unless the thread is interrupted.
This method is only invoked when IGestureListViewListener.canComputeItems() returns
true.
computeTracks in interface IGestureListViewListenercomputeTracks in class AbstractListControllerhighlight - the selection
null.public void showGenre(String genre)
genre - the genre to browse.protected void performZoom(boolean zoom)
AbstractController
performZoom in class AbstractListControllerzoom - true zoom the controller in, false
zoom the controller out.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||