Class HomeCardRows

java.lang.Object
com.aurelienpierre.sioul.HomeCardRows
All Implemented Interfaces:
RemoteViewsService.RemoteViewsFactory

The rows of a home-screen card's list (HomeCard, through HomeCardService), as a mail card and an agenda card show them, from what Rust wrote (crates/ sioul-app/src/homecard.rs). First "Mail": the messages the Porch shows in the frame for now, newest first, each with a thin bar in its account's colour, its sender (bold while not read), when it came, its subject and a line of its text; or the Porch's sentence instead ("The Porch opens tomorrow at 09:00.", "Nothing waits on the Porch."). Then "Agenda": the events not over yet, each under its day ("Today, Wed 7 Oct", "Tomorrow, Thu 8 Oct", "Mon 12 Oct": each name as it holds now, Rust having said until when), as a block in its calendar's colour with its title and its time. Never a count. A row tapped fills its address into the list's template (HomeCard), for HomeCardOpener: the Porch, a message ("mail/" and its file), the Agenda, an event ("event/" and its file).
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    (package private) static final class 
    One row: its kind, the message or event it shows, its words, where a tap leads.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final int[]
    The accounts' colours, by their place among your accounts: Theme.qml's chart colours, taken between their light and dark tones so that each reads on either ground (the host draws the card in the phone's theme, these are fixed here).
    private final Context
     
    private static final int
    The text on a light block; on a dark one, white.
    (package private) static final int
    The rows' kinds, each with its layout.
    (package private) static final int
    The rows' kinds, each with its layout.
    private final String
     
    private static final int[]
     
    (package private) static final int
    The rows' kinds, each with its layout.
    (package private) static final int
    The rows' kinds, each with its layout.
    private long
    When the rows were made: the dates and days said as at then.
    private static final int
    An event whose calendar gives no colour: Sioul's green.
     
    (package private) static final int
    The rows' kinds, each with its layout.
  • Constructor Summary

    Constructors
    Constructor
    Description
    HomeCardRows(Context context, String kind)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static void
    agenda(List<HomeCardRows.Row> rows, JSONObject card, JSONObject frame, String heading, long now, String kind)
    "Agenda", then each event not over yet under its day: the day it starts, or today while it runs.
    (package private) static long
    ahead(JSONArray labels, long now)
    The first `until` ahead of `now` among some wordings; none, Long.MAX_VALUE.
    private static CharSequence
    bold(String text, boolean bold)
     
    private static int
    "#4c6b5c" as a colour; anything else, Sioul's own.
    private static int
    dayOf(JSONArray days, long at)
    The day `at` falls in, by its place in `days`; -1 outside them.
    private void
    event(RemoteViews views, JSONObject event)
    An event, as an agenda card shows it: a block in its calendar's colour, the text as that colour asks.
    int
     
    long
    getItemId(int position)
     
    A blank line while a row comes, rather than Android's "Loading…".
    getViewAt(int position)
     
    int
     
    boolean
     
    (package private) static String
    label(JSONArray labels, long now)
    The wording that holds at `now`: the first whose `until` is ahead, or 0 (for good).
    private static double
    linear(int value)
     
    private static double
    luminance(int color)
    WCAG 2's relative luminance of an sRGB colour.
    private static void
    mail(List<HomeCardRows.Row> rows, JSONObject card, JSONObject frame, String heading, String kind)
    "Mail", then the messages the frame lists, or its sentence.
    private void
    message(RemoteViews views, JSONObject message)
    A message, as a mail card shows it; sender and subject in bold while it is not read.
    (package private) static long
    nextChange(JSONObject card, long now)
    When the list says something else (Unix ms), for HomeCard's next drawing: an event over, a message's or a day's name changing at midnight.
    void
     
    void
    The file read again (HomeCard asks it at each drawing): the rows for now.
    void
     
    (package private) static List<HomeCardRows.Row>
    rows(JSONObject card, long now, String kind)
    The rows for `now`, for a card of `kind` (HomeCard.ALL, MAIL, AGENDA): the Porch's part of the frame for now, then the agenda's.
    (package private) static int
    textOn(int color)
    Dark text on a light block, white on a dark one: whichever contrasts more (WCAG 2's ratio).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait