YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.browser.BrowserHost Interface Reference

Navigation that fragments and helpers may ask of the activity that hosts them. More...

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

Public Member Functions

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.
 
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).
 
default 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.
 
default boolean isPickOpen (String pickId)
 Whether the receiver picker with this id is open (a restored sheet asks, then closes itself if not).
 
default void onPendingShare (String token, String displayName)
 A shared file is waiting for the user to pick the receivers (see ShareIntentHandler).
 

Detailed Description

Navigation that fragments and helpers may ask of the activity that hosts them.

Implemented by the browser activities; callers must tolerate "no host" (the context or activity is not a BrowserHost) and may call from any thread, so implementations hop to the main thread themselves.

Member Function Documentation

◆ isPickOpen()

default boolean de.yaacc.browser.BrowserHost.isPickOpen ( String pickId)

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

Implemented in de.yaacc.browser.BrowserActivity, and de.yaacc.browser.TabBrowserActivity.

◆ onPendingShare()

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

A shared file is waiting for the user to pick the receivers (see ShareIntentHandler).

Called on the main thread. The host shows its receiver picker with displayName (already cleaned, safe for setText) and later calls ShareIntentHandler#confirm or ShareIntentHandler#cancel with the token. The default does nothing: the pending share then waits for its timeout (two minutes) and is dropped.

Parameters
tokenbinds the pending share to its pick; a result with another token changes nothing
displayNamethe cleaned name of the file

Implemented in de.yaacc.browser.BrowserActivity, and de.yaacc.browser.TabBrowserActivity.

◆ pickReceivers()

default boolean de.yaacc.browser.BrowserHost.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).

Implemented in de.yaacc.browser.BrowserActivity, and de.yaacc.browser.TabBrowserActivity.

Referenced by de.yaacc.browser.ContentListFragment.startPlayAction().

Here is the caller graph for this function:

◆ providesReceiverBar()

default boolean de.yaacc.browser.BrowserHost.providesReceiverBar ( )

Whether the host shows the receiver bar itself, at every level (new layout).

A content list then hides its own footer and opens the device sheet through showReceivers(). False for the classic tabs, where the content list shows the original static footer (current provider, selected receivers) and there is no sheet.

Implemented in de.yaacc.browser.BrowserActivity.

Referenced by de.yaacc.browser.ShareIntentHandler.handle(), and de.yaacc.browser.ContentListFragment.startPlayAction().

Here is the caller graph for this function:

◆ providesShutdownTimer()

default boolean de.yaacc.browser.BrowserHost.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.

False for the classic tabs.

Implemented in de.yaacc.browser.BrowserActivity.

◆ showContent()

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

Shows the content of the currently selected server.

Implemented in de.yaacc.browser.BrowserActivity, and de.yaacc.browser.TabBrowserActivity.

◆ showPlayers()

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

Shows the running players.

Implemented in de.yaacc.browser.BrowserActivity, and de.yaacc.browser.TabBrowserActivity.

◆ showReceivers()

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

Shows the receivers.

Implemented in de.yaacc.browser.BrowserActivity, and de.yaacc.browser.TabBrowserActivity.

◆ showsBackAtContentRoot()

default boolean de.yaacc.browser.BrowserHost.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).

False for the classic tabs, where the root has nothing to go back to.

Implemented in de.yaacc.browser.BrowserActivity.

◆ showServers()

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

Shows the list of servers.

Implemented in de.yaacc.browser.BrowserActivity, and de.yaacc.browser.TabBrowserActivity.


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