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

What a tap on the toolbar shutdown-timer item does. More...

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

Classes

enum  Action
 The step to take. More...
 

Static Public Member Functions

static Action decide (boolean running)
 One toolbar icon does it all: a running timer is stopped by a tap, otherwise the duration picker opens and confirming it starts the timer.
 
static String subtitle (String name, String remaining, boolean running)
 The text under the title of the toolbar while a timer runs.
 

Detailed Description

What a tap on the toolbar shutdown-timer item does.

Plain Java so the rule is testable.

Starting a timer with a duration of 0 would exit the app at once, so without a configured duration the tap asks for one instead.

Member Function Documentation

◆ decide()

static Action de.yaacc.browser.ShutdownTimerToggle.decide ( boolean running)
static

One toolbar icon does it all: a running timer is stopped by a tap, otherwise the duration picker opens and confirming it starts the timer.

Starting straight from a stored duration is not offered, so a tap can never start (or, with 0, immediately fire) a timer unseen.

Parameters
runninga timer is counting down

◆ subtitle()

static String de.yaacc.browser.ShutdownTimerToggle.subtitle ( String name,
String remaining,
boolean running )
static

The text under the title of the toolbar while a timer runs.

The action item cannot carry the remaining time: the toolbar drops the text of an action with an icon on narrow screens (portrait phones), so the time is shown as the subtitle, which is always shown.

Parameters
namethe name of the timer, e.g. "Shutdown timer"
remainingthe remaining time, already formatted
runninga timer is counting down
Returns
the subtitle, or null when no timer runs (clears the subtitle)

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