Class HomeCardToday

java.lang.Object
com.aurelienpierre.sioul.HomeCardToday

final class HomeCardToday extends Object
Sioul's full card on the home screen (HomeCard draws it; docs/android.md, "The card on the home screen"), from what Rust wrote (crates/sioul-app/src/ homecard.rs). Today first: the date, the weather now and the next four hours on its row (the farthest left out first when they do not fit, never wrapped), the next morning, afternoon, evening and night, the next seven days, and Open-Meteo's credit. Then what the Porch has for you: a dose due, a code you asked for and its warning, reminders, the calls declined, two events at once. Then Now: what now is for, do-not-disturb, the next step, where you stopped. The mail and the agenda are on their own cards. As the card shrinks, its parts are left out, the least needed first, today kept longest: where you stopped, the step, two events at once, the calls, the reminders, do-not-disturb, the code, the dose, then the seven days and the parts of the day; the date, the weather now and what now is for stay. Lines.of is the pure part (org.json alone), checked on a computer's JVM (android/jvm-checks/CardCheck.java); views draws it.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    (package private) static final class 
    A cell of the weather: an hour, a part of the day, a day.
    private static final class 
    What fits in the card's height, the most needed first; and what its width allows.
    (package private) static final class 
    What the full card says now, and when that changes next: the pure part.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final float[]
    The space above each line (dp), as the layout has it.
    (package private) static final int
    The text lines, each a view of the layout.
    (package private) static final int
    Three reminders and two calls at most: the card is no list.
    (package private) static final int
    The text lines, each a view of the layout.
    (package private) static final int
    The text lines, each a view of the layout.
    (package private) static final int
    The text lines, each a view of the layout.
    private static final int[][]
     
    private static final int
     
    (package private) static final int
    The text lines, each a view of the layout.
    (package private) static final int
    The text lines, each a view of the layout.
    private static final int[]
     
    private static final int
    An hour's cell, at its narrowest (the layout's minWidth), in dp.
    private static final int[][]
     
    (package private) static final int
    The next hours beside the weather now, four at most (weather.rs, CARD_HOURS).
    private static final String[]
    The weather's icons, as weather.rs names them (Breeze's), and their drawings (tools/make-weather-drawables.py).
    private static final int[]
     
    private static final int
     
    private static final int
     
    private static final int[]
     
    (package private) static final int
    The text lines, each a view of the layout.
    (package private) static final int
    The text lines, each a view of the layout.
    private static final int[][]
     
    private static final int
     
    private static final int[]
    Kept while the card shrinks, the lowest first: today (the date, the weather now or the line said instead, what now is for) always; then the dose, a "not set up yet", the code, do-not-disturb, the reminders, the calls, two events at once, the step, where you stopped.
    (package private) static final int
    The text lines, each a view of the layout.
    (package private) static final int
    Three reminders and two calls at most: the card is no list.
    private static final float[]
    Each line's text size (sp) and its most lines, as the layout has them.
    (package private) static final int
    The text lines, each a view of the layout.
    (package private) static final int
    The text lines, each a view of the layout.
    (package private) static final int
    The text lines, each a view of the layout.
    private static final int[]
     
    (package private) static final int
    The text lines, each a view of the layout.
    (package private) static final int
    The text lines, each a view of the layout.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static void
    cell(RemoteViews views, int[] ids, HomeCardToday.Cell cell, boolean day)
    A cell's views (label, icon, temperature, [low,] rain) said, and its words for screen readers.
    (package private) static int
    icon(String name)
    A weather icon's drawing, by weather.rs's name; one it does not know, "none available".
    private static String
    join(String... parts)
    Some words for screen readers, the empty ones left out: "Rain, 16°, 98 %".
    (package private) static RemoteViews
    views(Context context, HomeCardToday.Lines lines, Bundle options)
    The full card at its size: each part kept while it fits, the most needed first (RANKS), and its taps (HomeCard.opener(android.content.Context, java.lang.String), through HomeCardOpener); the rest opens Sioul as its icon does.
    (package private) static JSONObject
    within(JSONArray items, long now)
    The item `now` falls in, among items each {from, until}; none.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DATE

      static final int DATE
      The text lines, each a view of the layout.
      See Also:
    • WEATHER_LINE

      static final int WEATHER_LINE
      The text lines, each a view of the layout.
      See Also:
    • CREDIT

      static final int CREDIT
      The text lines, each a view of the layout.
      See Also:
    • DOSE

      static final int DOSE
      The text lines, each a view of the layout.
      See Also:
    • CODE

      static final int CODE
      The text lines, each a view of the layout.
      See Also:
    • WARNING

      static final int WARNING
      The text lines, each a view of the layout.
      See Also:
    • REMINDER

      static final int REMINDER
      The text lines, each a view of the layout.
      See Also:
    • CALL

      static final int CALL
      The text lines, each a view of the layout.
      See Also:
    • OVERLAP

      static final int OVERLAP
      The text lines, each a view of the layout.
      See Also:
    • NOTE

      static final int NOTE
      The text lines, each a view of the layout.
      See Also:
    • STATUS

      static final int STATUS
      The text lines, each a view of the layout.
      See Also:
    • DND

      static final int DND
      The text lines, each a view of the layout.
      See Also:
    • STEP

      static final int STEP
      The text lines, each a view of the layout.
      See Also:
    • STOPPED

      static final int STOPPED
      The text lines, each a view of the layout.
      See Also:
    • REMINDERS

      static final int REMINDERS
      Three reminders and two calls at most: the card is no list.
      See Also:
    • CALLS

      static final int CALLS
      Three reminders and two calls at most: the card is no list.
      See Also:
    • LINES

      private static final int LINES
      See Also:
    • VIEWS

      private static final int[] VIEWS
    • SIZES

      private static final float[] SIZES
      Each line's text size (sp) and its most lines, as the layout has them.
    • MOST

      private static final int[] MOST
    • ABOVE

      private static final float[] ABOVE
      The space above each line (dp), as the layout has it.
    • RANKS

      private static final int[] RANKS
      Kept while the card shrinks, the lowest first: today (the date, the weather now or the line said instead, what now is for) always; then the dose, a "not set up yet", the code, do-not-disturb, the reminders, the calls, two events at once, the step, where you stopped. The parts of the day and the seven days come before the dose (ranks 1 and 2).
    • PARTS_RANK

      private static final int PARTS_RANK
      See Also:
    • DAYS_RANK

      private static final int DAYS_RANK
      See Also:
    • LAST_RANK

      private static final int LAST_RANK
      See Also:
    • HOURS_SHOWN

      static final int HOURS_SHOWN
      The next hours beside the weather now, four at most (weather.rs, CARD_HOURS).
      See Also:
    • HOUR_CELLS

      private static final int[] HOUR_CELLS
    • HOURS

      private static final int[][] HOURS
    • HOUR_DP

      private static final int HOUR_DP
      An hour's cell, at its narrowest (the layout's minWidth), in dp.
      See Also:
    • PARTS

      private static final int[][] PARTS
    • DAYS

      private static final int[][] DAYS
    • ICON_NAMES

      private static final String[] ICON_NAMES
      The weather's icons, as weather.rs names them (Breeze's), and their drawings (tools/make-weather-drawables.py).
    • ICONS

      private static final int[] ICONS
  • Constructor Details

  • Method Details