YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.browser.TabBrowserActivity Class Reference

Activity for browsing devices and folders. More...

Inheritance diagram for de.yaacc.browser.TabBrowserActivity:
Inheritance graph
Collaboration diagram for de.yaacc.browser.TabBrowserActivity:
Collaboration graph

Public Member Functions

void onCreate (Bundle savedInstanceState)
 
void showServers ()
 Shows the list of servers.
 
void showContent ()
 Shows the content of the currently selected server.
 
void showReceivers ()
 Shows the receivers.
 
void showPlayers ()
 Shows the running players.
 
boolean pickReceivers (PickedAction action, String shareName, Collection< String > initialIds)
 Opens the receiver picker ("Play on...", the device sheet in pick mode) and reports the answer through action: exactly one of PickedAction#onConfirmed (with the chosen receiver ids and a done callback to end the single flight) or PickedAction#onCancelled runs, on the main thread, and only if this returns true.
 
boolean isPickOpen (String pickId)
 Whether the receiver picker with this id is open (a restored sheet asks, then closes itself if not).
 
void onPendingShare (String token, String displayName)
 A shared file is waiting: the same "Play on..." sheet as in the new layout, showing the cleaned file name, with the classic receiver selection as the initial ticks.
 
void setCurrentTab (final BrowserTabs content)
 
void onResume ()
 
void onBackPressed ()
 
void onCreateContextMenu (ContextMenu menu, View v, ContextMenuInfo menuInfo)
 
boolean onCreateOptionsMenu (Menu menu)
 
boolean onOptionsItemSelected (MenuItem item)
 Navigation in option menu.
 
void onClick (View view)
 
boolean onKeyDown (int keyCode, KeyEvent event)
 
- Public Member Functions inherited from de.yaacc.browser.BrowserHost
default boolean providesShutdownTimer ()
 Whether the host shows the shutdown timer itself (in its toolbar), so the server list leaves its own timer rows out and uses the top-level layout.
 
default boolean providesReceiverBar ()
 Whether the host shows the receiver bar itself, at every level (new layout).
 
default boolean showsBackAtContentRoot ()
 Whether the content list shows the back arrow at the content root too, and its tap calls showServers() there (new layout: the root of a server is one step below the server list).
 

Protected Member Functions

void onSaveInstanceState (@NonNull Bundle outState)
 
void onNewIntent (Intent intent)
 
void onDestroy ()
 
void onStart ()
 
void onStop ()
 

Detailed Description

Activity for browsing devices and folders.

Represents the entrypoint for the whole application.

Author
Tobias Schoene (the openbit)

Member Function Documentation

◆ isPickOpen()

boolean de.yaacc.browser.TabBrowserActivity.isPickOpen ( String pickId)

Whether the receiver picker with this id is open (a restored sheet asks, then closes itself if not).

Implements de.yaacc.browser.BrowserHost.

◆ onPendingShare()

void de.yaacc.browser.TabBrowserActivity.onPendingShare ( String token,
String displayName )

A shared file is waiting: the same "Play on..." sheet as in the new layout, showing the cleaned file name, with the classic receiver selection as the initial ticks.

The selection is put back once the playback has started (de.yaacc.share.AfterStartSelection).

Implements de.yaacc.browser.BrowserHost.

Here is the call graph for this function:

◆ pickReceivers()

boolean de.yaacc.browser.TabBrowserActivity.pickReceivers ( PickedAction action,
String shareName,
Collection< String > initialIds )

Opens the receiver picker ("Play on...", the device sheet in pick mode) and reports the answer through action: exactly one of PickedAction#onConfirmed (with the chosen receiver ids and a done callback to end the single flight) or PickedAction#onCancelled runs, on the main thread, and only if this returns true.

Only one picked action may be between its confirm and its done: a confirm while another is still starting is refused with onCancelled. Call it on the main thread.

The new layout uses it for play, play-all, add-to-playlist and a pending share; classic uses it only for a pending shared file (normal classic browsing never shows the sheet). Nothing is stored by the picker: the host's callbacks decide what a confirm sets and clears.

Parameters
actionwhat to do with the answer
shareNamethe cleaned name of the pending share, or null if the pick is not for a share (an empty name is replaced by a fixed text on the sheet)
initialIdsreceivers that start ticked, may be null (classic: its tab-based selection)
Returns
false (the action is never called) if the host has no picker, a pick is already open, another action is still starting, or the screen cannot show it now; a new request never replaces the open one. The caller should tell the user (a short toast).

Implements de.yaacc.browser.BrowserHost.

◆ showContent()

void de.yaacc.browser.TabBrowserActivity.showContent ( )

Shows the content of the currently selected server.

Implements de.yaacc.browser.BrowserHost.

◆ showPlayers()

void de.yaacc.browser.TabBrowserActivity.showPlayers ( )

Shows the running players.

Implements de.yaacc.browser.BrowserHost.

◆ showReceivers()

void de.yaacc.browser.TabBrowserActivity.showReceivers ( )

Shows the receivers.

Implements de.yaacc.browser.BrowserHost.

◆ showServers()

void de.yaacc.browser.TabBrowserActivity.showServers ( )

Shows the list of servers.

Implements de.yaacc.browser.BrowserHost.


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