Package com.aurelienpierre.sioul
Class HomeCard
java.lang.Object
android.content.BroadcastReceiver
android.appwidget.AppWidgetProvider
com.aurelienpierre.sioul.HomeCard
- Direct Known Subclasses:
HomeCardAgenda,HomeCardMail
Sioul's cards on the home screen (docs/android.md, "The card on the home
screen"). The full card (HomeCardToday): today first, the date and the
weather; then what the Porch has for you, a dose due, a code you asked for,
reminders, the calls declined, two events at once; then Now, what now is
for and the next step. The mail card (HomeCardMail) and the agenda card
(HomeCardAgenda): a list that scrolls (HomeCardRows, through
HomeCardService), the Porch's latest messages, or the coming events, day by
day. Rust writes what they say (crates/sioul-app/src/homecard.rs) in
Sioul's state folder, ahead, in frames: one per change of time until the
end of tomorrow, since Android freezes Sioul in the background; the weather
hour by hour. Here: the frame and the hour for now, drawn again at the next
change (a frame's end, an hour, a code expiring, a dose, a reminder, an
event over, midnight) by an alarm that wakes nothing, and whenever Rust
says so (HOME_CARD, sent through android/main.cpp's
sioul_android_broadcast). No Rust, no network: cards drawn from a file. A
tap opens Sioul: as by its icon on the card itself and on the weather; on
a code, a dose, a call, the Porch; on a reminder, what it is about; on the
step, Now; in a list, the Porch, a message on it, the Agenda or an event in
it (HomeCardOpener). No button does anything else. This class draws all three.
-
Nested Class Summary
Nested classes/interfaces inherited from class android.content.BroadcastReceiver
BroadcastReceiver.PendingResult -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final StringWhat a card shows: everything, its messages alone, its events alone.(package private) static final StringWhat a card shows: everything, its messages alone, its events alone.(package private) static final Stringprivate static final Stringprivate static final StringRust's state folder (android/main.cpp: XDG_STATE_HOME is files/state).private static final String[](package private) static final StringWhat a card shows: everything, its messages alone, its events alone.private static final Stringprivate static final Class<?>[]The three kinds of cards, by their providers.(package private) static final StringA tap's address:"sioul-card:porch","sioul-card:mail/<its file>"… -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voiddraw(Context context, AppWidgetManager manager, int[] ids, String kind) Cards of one kind drawn, the lists read again (HomeCardRows), and the next drawing set: the same for every kind, made from the same file.(package private) static voidEvery card on the home screens drawn again, of every kind; none, the next drawing let go.(package private) static Stringempty()The card before Sioul wrote one, in Sioul's two languages by the phone's (asDoseAlarms.words(int)); every other word is Rust's.(package private) static JSONObjectThe frame for now; before the first (the clock set back), the first; past the last, none.(package private) static JSONArrayframes(JSONObject card) A card's frames: "times" from version 3, "frames" before (an older Sioul's Java reads "frames" alone, finds none in a card of version 3, and says its "beyond": "Open Sioul to bring this card up to date.").(package private) Stringkind()What this card shows; the mail and agenda cards say theirs.(package private) static PendingIntentSioul, as by its icon.voidonAppWidgetOptionsChanged(Context context, AppWidgetManager manager, int id, Bundle options) voidonDisabled(Context context) voidvoidonUpdate(Context context, AppWidgetManager manager, int[] ids) (package private) static voidA tap kept for Rust (homecard.rs, `opened`), which takes it when the window comes up: {"open": "porch" | "now" | "mail" | "agenda" | "event" | "reminder", "uid" (a step's), "key" (a message's or an event's file, a reminder's address: "sioul:task/…"), "at"}.(package private) static PendingIntentSioul on the Porch, on Now, on what a reminder is about: through HomeCardOpener, which keeps the tap for Rust.(package private) static JSONObjectThe card Rust wrote last; none before Sioul's first start, or one that does not read.private static voidThe cards drawn again at `at`, when a frame ends, a code expires, a dose comes or goes, the age is to be said, an event is over, or a day's or a message's name changes at midnight: one alarm for every card, that wakes nothing (the cards are drawn when the phone is next awake), on time when Android allows Sioul exact alarms (the doses' "Alarms & reminders"), else within a few minutes.private static PendingIntentThe list's taps: HomeCardOpener, each row's address filled in (HomeCardRows).private static RemoteViewsA mail card or an agenda card: its list (HomeCardRows, one factory per card, its address naming the card and its kind).Methods inherited from class android.appwidget.AppWidgetProvider
onDeleted, onEnabled, onRestoredMethods inherited from class android.content.BroadcastReceiver
abortBroadcast, clearAbortBroadcast, getAbortBroadcast, getDebugUnregister, getResultCode, getResultData, getResultExtras, getSentFromPackage, getSentFromUid, goAsync, isInitialStickyBroadcast, isOrderedBroadcast, peekService, setDebugUnregister, setOrderedHint, setResult, setResultCode, setResultData, setResultExtras
-
Field Details
-
DRAW
- See Also:
-
ALL
What a card shows: everything, its messages alone, its events alone.- See Also:
-
MAIL
What a card shows: everything, its messages alone, its events alone.- See Also:
-
AGENDA
What a card shows: everything, its messages alone, its events alone.- See Also:
-
FOLDER
Rust's state folder (android/main.cpp: XDG_STATE_HOME is files/state).- See Also:
-
FILE
- See Also:
-
OPENED
- See Also:
-
SCHEME
A tap's address:"sioul-card:porch","sioul-card:mail/<its file>"…- See Also:
-
PROVIDERS
The three kinds of cards, by their providers. -
KINDS
-
-
Constructor Details
-
HomeCard
public HomeCard()
-
-
Method Details
-
kind
What this card shows; the mail and agenda cards say theirs. -
onReceive
- Overrides:
onReceivein classAppWidgetProvider
-
onUpdate
- Overrides:
onUpdatein classAppWidgetProvider
-
onAppWidgetOptionsChanged
public void onAppWidgetOptionsChanged(Context context, AppWidgetManager manager, int id, Bundle options) - Overrides:
onAppWidgetOptionsChangedin classAppWidgetProvider
-
onDisabled
- Overrides:
onDisabledin classAppWidgetProvider
-
empty
The card before Sioul wrote one, in Sioul's two languages by the phone's (asDoseAlarms.words(int)); every other word is Rust's. -
drawAll
Every card on the home screens drawn again, of every kind; none, the next drawing let go. -
draw
Cards of one kind drawn, the lists read again (HomeCardRows), and the next drawing set: the same for every kind, made from the same file. -
read
The card Rust wrote last; none before Sioul's first start, or one that does not read. -
frames
A card's frames: "times" from version 3, "frames" before (an older Sioul's Java reads "frames" alone, finds none in a card of version 3, and says its "beyond": "Open Sioul to bring this card up to date."). -
frame
The frame for now; before the first (the clock set back), the first; past the last, none. -
views
A mail card or an agenda card: its list (HomeCardRows, one factory per card, its address naming the card and its kind). -
launch
Sioul, as by its icon. -
opener
Sioul on the Porch, on Now, on what a reminder is about: through HomeCardOpener, which keeps the tap for Rust. Each address its own pending intent (Android tells them apart by their data). -
template
The list's taps: HomeCardOpener, each row's address filled in (HomeCardRows). Mutable for that alone, from Android 12 where it must be said; its class is fixed, so a row can only say where Sioul opens. -
opened
A tap kept for Rust (homecard.rs, `opened`), which takes it when the window comes up: {"open": "porch" | "now" | "mail" | "agenda" | "event" | "reminder", "uid" (a step's), "key" (a message's or an event's file, a reminder's address: "sioul:task/…"), "at"}. -
schedule
The cards drawn again at `at`, when a frame ends, a code expires, a dose comes or goes, the age is to be said, an event is over, or a day's or a message's name changes at midnight: one alarm for every card, that wakes nothing (the cards are drawn when the phone is next awake), on time when Android allows Sioul exact alarms (the doses' "Alarms & reminders"), else within a few minutes. Long.MAX_VALUE: none.
-