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

Single place that answers "which browser activity do we start": the launcher activity, the three internal notification launches and the resume check of each browser all go through it, so they cannot disagree. More...

Collaboration diagram for de.yaacc.browser.BrowserLauncher:
Collaboration graph

Static Public Member Functions

static Layout effectiveLayout (String storedValue)
 
static Layout effectiveLayout (Context context)
 Reads the stored "Layout" preference with default null: BrowserLayoutChoice#resolve(String) turns a missing value into the new layout.
 
static Class<? extends Activity > targetClass (Context context)
 The browser activity class for the effective layout.
 
static Class<? extends Activity > targetClass (Layout effective)
 The browser activity class for an effective layout that the caller already computed, so a decision and the target derived from it cannot disagree.
 
static boolean relaunchIfOtherLayout (Activity activity, Layout own)
 The resume-time (and, for the new layout, create-time) check of both browsers: if the effective layout is not the one activity renders, starts the browser of the effective layout with a fresh intent and finishes activity without animation.
 

Detailed Description

Single place that answers "which browser activity do we start": the launcher activity, the three internal notification launches and the resume check of each browser all go through it, so they cannot disagree.

The stored "Layout" preference is only ever mapped to a Layout by BrowserLayoutChoice#resolve(String); the stored string is never treated as a class name.

Member Function Documentation

◆ effectiveLayout()

static Layout de.yaacc.browser.BrowserLauncher.effectiveLayout ( String storedValue)
static
Parameters
storedValuethe stored preference value, may be null
Returns
the layout that is actually launched

Referenced by de.yaacc.browser.BrowserLauncher.effectiveLayout(), de.yaacc.browser.BrowserLauncher.relaunchIfOtherLayout(), and de.yaacc.browser.BrowserLauncher.targetClass().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ relaunchIfOtherLayout()

static boolean de.yaacc.browser.BrowserLauncher.relaunchIfOtherLayout ( Activity activity,
Layout own )
static

The resume-time (and, for the new layout, create-time) check of both browsers: if the effective layout is not the one activity renders, starts the browser of the effective layout with a fresh intent and finishes activity without animation.

A static guard allows one relaunch per ~2 s, so a wrong decision cannot loop; when it trips the activity stays where it is and logs.

Returns
true if activity is finishing and must skip the rest of its callback
Here is the call graph for this function:

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