|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.baka.ambient.activity.main.AbstractController sk.baka.ambient.activity.main.AbstractListController sk.baka.ambient.activity.main.AbstractPlaylistController sk.baka.ambient.activity.main.StaticPlaylistController
public final class StaticPlaylistController
Manages provided track list. Uses a simple List
of tracks as model.
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.AbstractPlaylistController |
---|
PLAYLIST_VIEW_ID |
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 | |
---|---|
StaticPlaylistController(int mainViewId,
int listviewId,
Activity activity,
List<TrackMetadataBean> tracks,
boolean addActivated)
Creates new controller. |
Method Summary | |
---|---|
String |
getHint(Interval highlight)
Returns a very short and simple string representation of the selected contents. |
protected int |
getPlaylistSize()
Returns the underlying playlist size. |
protected int |
getQueueNumber(int index)
Returns queue status of given track. |
protected TrackMetadataBean |
getTrack(int index)
Retrieves a track from given position. |
List<TrackMetadataBean> |
getTracks()
Returns an unmodifiable view on the track list. |
protected boolean |
isCurrentlyPlayedTrack(int index)
Checks if the track at given index is currently being played. |
void |
itemActivated(int index,
Object model)
The item was activated, either by clicking on it or using a keyboard. |
Interval |
moveItems(Interval highlight,
int index)
Move selected items up or down. |
Interval |
moveItemsByOne(Interval highlight,
boolean down)
Move selected items up or down. |
void |
removeItems(Interval remove)
The contract: when overriding this method, be sure to call this super method after you are done deleting items. |
void |
setResults(List<TrackMetadataBean> tracks,
String query,
SearchType type)
Shows given search result on the list view. |
void |
setTracks(List<TrackMetadataBean> tracks)
Sets new track list. |
void |
stateChanged(AppState state)
The application state was changed. |
Methods inherited from class sk.baka.ambient.activity.main.AbstractPlaylistController |
---|
canComputeItems, clipboardChanged, computeTracks, configChanged, initialize, isComputeTracksLong, isComputeTracksOnlineOp, isReadOnly, offline, recomputeListItems, update |
Methods inherited from class sk.baka.ambient.activity.main.AbstractListController |
---|
canHighlight, destroy, dropItems, getClipboard, highlightChanged, performZoom, 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 |
---|
public StaticPlaylistController(int mainViewId, int listviewId, Activity activity, List<TrackMetadataBean> tracks, boolean addActivated)
mainViewId
- the view whose visibility is controlled.listviewId
- the list view idactivity
- the parent activity.tracks
- initial track list.addActivated
- if true
then the activated items are added at the
end of the playlist.Method Detail |
---|
public void itemActivated(int index, Object model)
IGestureListViewListener
index
- the index of the item.model
- the model for the item.protected int getPlaylistSize()
AbstractPlaylistController
getPlaylistSize
in class AbstractPlaylistController
protected TrackMetadataBean getTrack(int index)
AbstractPlaylistController
getTrack
in class AbstractPlaylistController
index
- the index
null
.protected boolean isCurrentlyPlayedTrack(int index)
AbstractPlaylistController
isCurrentlyPlayedTrack
in class AbstractPlaylistController
index
- the track index
true
if it is being played, false
otherwise.public void removeItems(Interval remove)
AbstractPlaylistController
removeItems
in interface IGestureListViewListener
removeItems
in class AbstractPlaylistController
remove
- the interval to removepublic Interval moveItems(Interval highlight, int index)
IGestureListViewListener
Move selected items up or down. The listener must update the items and return the new highlight. This operation is always considered as a short-running and thus always executed directly in handler's event thread.
The list view will be redrawn automatically when the method returns.
This operation is invoked only when IGestureListViewListener.isReadOnly()
returns
false
.
moveItems
in interface IGestureListViewListener
moveItems
in class AbstractListController
highlight
- move these itemsindex
- drop the items before item with this index.
public Interval moveItemsByOne(Interval highlight, boolean down)
IGestureListViewListener
Move selected items up or down. The listener must update the items and return the new highlight. This operation is always considered as a short-running and thus always executed directly in handler's event thread.
The list view will be redrawn automatically when the method returns.
This operation is invoked only when IGestureListViewListener.isReadOnly()
returns
false
.
moveItemsByOne
in interface IGestureListViewListener
moveItemsByOne
in class AbstractListController
highlight
- move these itemsdown
- down if true
then move the highlighted interval
down, otherwise move it up.
public List<TrackMetadataBean> getTracks()
public String getHint(Interval highlight)
IGestureListViewListener
Returns a very short and simple string representation of the selected contents.
This method is only invoked when IGestureListViewListener.canComputeItems()
returns
true
.
getHint
in interface IGestureListViewListener
getHint
in class AbstractPlaylistController
highlight
- the highlighted items.
null
if no hint should be shown.protected int getQueueNumber(int index)
AbstractPlaylistController
getQueueNumber
in class AbstractPlaylistController
index
- the track index
public void setResults(List<TrackMetadataBean> tracks, String query, SearchType type)
tracks
- the model to show.query
- the querytype
- hint on the type of data in the model.public void setTracks(List<TrackMetadataBean> tracks)
tracks
- public void stateChanged(AppState state)
IApplicationListener
state
- the state instance, must NOT be modified.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |