Ga naar inhoud

Generic-sjabloon

Een flexibel, op voortgang gebaseerd sjabloon, geschikt voor builds, downloads, deployments en elke langlopende taak.

Demonstratie van een live activiteit

On Android, a generic activity is a Live Update in the notification shade: progress fills the bar, and the status bar chip shows the percentage, or the time left while live_progress runs.

Fields

FieldTypeDescription
templatestringRequired. Must be "generic"
progressfloatRequired. Value between 0.0 and 1.0; shown as a percentage in the top-right corner
statestringShort status text (e.g. "Building...", "Complete")
iconstringSF Symbol name (e.g. "arrow.triangle.branch", "washer") or MDI icon with mdi: prefix (e.g. "mdi:washing-machine", "mdi:thermometer")
remaining_timeintegerRemaining time in seconds, shown as a countdown alongside the progress bar
subtitlestringSecondary text below the progress bar
accent_colorstringNamed color or hex (e.g. "cyan", "#00BCD4")
background_colorstringBackground color override
text_colorstringText color override
Komt in app-versie 1.3.3
Komt in app-versie 1.7.0
Komt in app-versie 1.14.0
Komt in app-versie 1.19.1

Renders url_action and secondary_url_action as buttons beneath the progress bar, and treats taps on the rest of the card as tap_action -- see Tap actions.

Example Payload

Een Generic-activity starten
{
  "state": "ongoing",
  "content": {
    "template": "generic",
    "progress": 0.65,
    "state": "Washing",
    "icon": "washer",
    "remaining_time": 1800,
    "subtitle": "Cycle 2 of 3",
    "accent_color": "blue"
  }
}

Live progress

Komt in app-versie 1.3.3

Dit gedeelte beschrijft een functie in een app-update die door de App Store wordt beoordeeld. Zodra de update live is, wordt het hier automatisch ontgrendeld.

Komt in app-versie 1.7.0

Dit gedeelte beschrijft een functie in een app-update die door de App Store wordt beoordeeld. Zodra de update live is, wordt het hier automatisch ontgrendeld.