Package com.aurelienpierre.sioul
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 ClassesModifier and TypeClassDescription(package private) static final classOne row: its kind, the message or event it shows, its words, where a tap leads. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate 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 Contextprivate static final intThe text on a light block; on a dark one, white.(package private) static final intThe rows' kinds, each with its layout.(package private) static final intThe rows' kinds, each with its layout.private final Stringprivate static final int[](package private) static final intThe rows' kinds, each with its layout.(package private) static final intThe rows' kinds, each with its layout.private longWhen the rows were made: the dates and days said as at then.private static final intAn event whose calendar gives no colour: Sioul's green.private List<HomeCardRows.Row> (package private) static final intThe rows' kinds, each with its layout. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidagenda(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 longThe first `until` ahead of `now` among some wordings; none, Long.MAX_VALUE.private static CharSequenceprivate static int"#4c6b5c" as a colour; anything else, Sioul's own.private static intThe day `at` falls in, by its place in `days`; -1 outside them.private voidevent(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.intgetCount()longgetItemId(int position) A blank line while a row comes, rather than Android's "Loading…".getViewAt(int position) intboolean(package private) static StringThe wording that holds at `now`: the first whose `until` is ahead, or 0 (for good).private static doublelinear(int value) private static doubleluminance(int color) WCAG 2's relative luminance of an sRGB colour.private static voidmail(List<HomeCardRows.Row> rows, JSONObject card, JSONObject frame, String heading, String kind) "Mail", then the messages the frame lists, or its sentence.private voidmessage(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 longnextChange(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.voidonCreate()voidThe 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 inttextOn(int color) Dark text on a light block, white on a dark one: whichever contrasts more (WCAG 2's ratio).
-
Field Details
-
SECTION
The rows' kinds, each with its layout.- See Also:
-
LINE
The rows' kinds, each with its layout.- See Also:
-
MAIL
The rows' kinds, each with its layout.- See Also:
-
DAY
The rows' kinds, each with its layout.- See Also:
-
EVENT
The rows' kinds, each with its layout.- See Also:
-
LAYOUTS
-
ACCOUNTS
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). -
OWN
An event whose calendar gives no colour: Sioul's green.- See Also:
-
DARK
The text on a light block; on a dark one, white.- See Also:
-
context
-
kind
-
rows
-
now
When the rows were made: the dates and days said as at then.
-
-
Constructor Details
-
HomeCardRows
HomeCardRows(Context context, String kind)
-
-
Method Details
-
onCreate
- Specified by:
onCreatein interfaceRemoteViewsService.RemoteViewsFactory
-
onDataSetChanged
The file read again (HomeCard asks it at each drawing): the rows for now.- Specified by:
onDataSetChangedin interfaceRemoteViewsService.RemoteViewsFactory
-
onDestroy
- Specified by:
onDestroyin interfaceRemoteViewsService.RemoteViewsFactory
-
getCount
- Specified by:
getCountin interfaceRemoteViewsService.RemoteViewsFactory
-
getViewAt
- Specified by:
getViewAtin interfaceRemoteViewsService.RemoteViewsFactory
-
getLoadingView
A blank line while a row comes, rather than Android's "Loading…".- Specified by:
getLoadingViewin interfaceRemoteViewsService.RemoteViewsFactory
-
getViewTypeCount
- Specified by:
getViewTypeCountin interfaceRemoteViewsService.RemoteViewsFactory
-
getItemId
- Specified by:
getItemIdin interfaceRemoteViewsService.RemoteViewsFactory
-
hasStableIds
- Specified by:
hasStableIdsin interfaceRemoteViewsService.RemoteViewsFactory
-
rows
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. None before Sioul wrote a card with lists (an older Sioul's card, or none: the lines on top say what there is). -
mail
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. Asleep, in a pause, in free time, the Porch says nothing: on the full card the status line says why; the mail card says it under its heading. -
agenda
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. Rust gave them nearest first, so the days only go forward. In a pause the full card shows the pause alone; the agenda card says it under its heading. Without a calendar, nothing. -
dayOf
The day `at` falls in, by its place in `days`; -1 outside them. -
label
The wording that holds at `now`: the first whose `until` is ahead, or 0 (for good). -
ahead
The first `until` ahead of `now` among some wordings; none, Long.MAX_VALUE. -
nextChange
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. Long.MAX_VALUE: never. -
message
A message, as a mail card shows it; sender and subject in bold while it is not read. -
event
An event, as an agenda card shows it: a block in its calendar's colour, the text as that colour asks. -
bold
-
colour
"#4c6b5c" as a colour; anything else, Sioul's own. -
textOn
Dark text on a light block, white on a dark one: whichever contrasts more (WCAG 2's ratio). -
luminance
WCAG 2's relative luminance of an sRGB colour. -
linear
-