YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.player.PlaylistItemAdapter Class Reference

The playlist of a player in the order it plays: with shuffle the play order (the stored list is not touched), otherwise the list order. More...

Inheritance diagram for de.yaacc.player.PlaylistItemAdapter:
Inheritance graph
Collaboration diagram for de.yaacc.player.PlaylistItemAdapter:
Collaboration graph

Classes

class  ViewHolder
 

Public Member Functions

 PlaylistItemAdapter (Context ctx, RecyclerView listView, Player player)
 
void refresh (boolean stateChanged)
 Shows the playlist as the player has it now (after a change of the list, the order or the play mode).
 
int getItemCount ()
 
PlayableItem getItem (int position)
 
long getItemId (int position)
 
PlaylistItemAdapter.ViewHolder onCreateViewHolder (ViewGroup parent, int viewType)
 
void onBindViewHolder (final PlaylistItemAdapter.ViewHolder holder, final int position)
 
boolean moveItem (int fromPosition, int toPosition)
 Moves the item at a displayed position to another one: with shuffle in the play order, otherwise in the list (the player decides which, and refuses locked positions).
 

Detailed Description

The playlist of a player in the order it plays: with shuffle the play order (the stored list is not touched), otherwise the list order.

A row is a position of Player#getPlayOrder(); the item in it is items.get(order[position]). The adapter keeps a snapshot of both and reads the player again in refresh; edits go to the player, which decides (locked positions) and fires the change.

Member Function Documentation

◆ getItem()

PlayableItem de.yaacc.player.PlaylistItemAdapter.getItem ( int position)
Returns
the item shown at the position

◆ moveItem()

boolean de.yaacc.player.PlaylistItemAdapter.moveItem ( int fromPosition,
int toPosition )

Moves the item at a displayed position to another one: with shuffle in the play order, otherwise in the list (the player decides which, and refuses locked positions).

Returns
true if the item moved
Here is the call graph for this function:

◆ refresh()

void de.yaacc.player.PlaylistItemAdapter.refresh ( boolean stateChanged)

Shows the playlist as the player has it now (after a change of the list, the order or the play mode).

Nothing happens if the player has the playlist as it is shown. Main thread.

Parameters
stateChangedtrue if the current item or the playing state changed too: the rows are bound again (bold marker, lock) even if the playlist is the same

The documentation for this class was generated from the following file: