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

Maps the stored "Layout" preference value to the browser layout to launch: the classic tab activity or the new tab-less one. More...

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

Classes

enum  Layout
 

Static Public Member Functions

static Layout resolve (String storedValue)
 

Static Public Attributes

static final String STORED_CLASSIC = "classic"
 Stored preference value for the classic tab layout.
 
static final String STORED_NEW = "new"
 Stored preference value for the new layout.
 
static final String DEFAULT_STORED_VALUE = STORED_NEW
 Stored value a fresh install gets from the preference defaults.
 

Detailed Description

Maps the stored "Layout" preference value to the browser layout to launch: the classic tab activity or the new tab-less one.

Only an explicit STORED_CLASSIC resolves to classic; anything else (null, empty, unknown, differently cased) resolves to the new layout, so an install without a stored value (a fresh install or an update from a version that had no "Layout" setting) starts in the new layout. The preference default (res/xml/preference.xml) is DEFAULT_STORED_VALUE as well.

Deliberately has no android.* imports so it can be unit-tested on the plain JVM, like DeviceSessionGrouper.

Member Function Documentation

◆ resolve()

static Layout de.yaacc.browser.BrowserLayoutChoice.resolve ( String storedValue)
static
Parameters
storedValuethe stored preference value, may be null
Returns
Layout#CLASSIC for exactly STORED_CLASSIC, otherwise Layout#NEW

Referenced by de.yaacc.browser.BrowserLauncher.effectiveLayout().

Here is the caller graph for this function:

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