v0.24.0: R1 app 0.18.0 — a high-contrast dark look with bigger text, the status bar matches the header, suggestions indented less, a block's times line up with its name; a font for the note's text; installing on the R1 works when adb runs as root

This commit is contained in:
2026-11-21 13:51:02 -08:00
parent 5ea848bddc
commit 069fb3bfd9
9 changed files with 65 additions and 16 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ import subprocess
import sys
import zipfile
VERSION_NAME = "0.17.0"
VERSION_NAME = "0.18.0"
PKG = "me.teafry.routine"
HERE = os.path.dirname(os.path.abspath(__file__))
REPO = os.path.dirname(HERE)
@@ -106,6 +106,18 @@ public final class MainActivity extends Activity {
private SwipeFrame swipe;
// ── setup ──
/** The status bar takes the header's colour (behind the date); dark icons on the light look (rabbit.html#statusbar). */
private void statusBar() {
android.view.Window w = getWindow();
w.addFlags(android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
w.clearFlags(android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
w.setStatusBarColor(Ui.BG);
View d = w.getDecorView();
int f = d.getSystemUiVisibility();
f = Ui.light ? f | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR : f & ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
d.setSystemUiVisibility(f);
}
@Override
protected void onCreate(Bundle b) {
super.onCreate(b);
@@ -147,6 +159,7 @@ public final class MainActivity extends Activity {
anim = new AnimView(this, assetOr("animations.json", "{}"));
root.addView(anim, new FrameLayout.LayoutParams(-1, -1));
setContentView(root);
statusBar();
today = Model.routineDate(schedule);
show(today, true);
@@ -200,6 +213,11 @@ public final class MainActivity extends Activity {
}
private TextView text(String s, float sp, int color, boolean bold) {
return text(s, sp * Ui.SCALE, color, bold, true);
}
/** As text(), at sp exactly: the bottom bar's tiles, which must fit its fixed height in both looks. */
private TextView text(String s, float sp, int color, boolean bold, boolean exact) {
TextView t = new TextView(this);
t.setText(s);
t.setTextSize(TypedValue.COMPLEX_UNIT_SP, sp);
@@ -223,9 +241,9 @@ public final class MainActivity extends Activity {
bar.setPadding(dp(12), dp(8), dp(12), dp(8));
bar.setBackgroundColor(Ui.BAR_BG);
int line = Math.max(2, dp(1)); // the light look's outline, shared where tiles meet
tileAll = text("All", Ui.TEXT_SMALL + 2, Ui.FG, false);
tileInc = text("To do", Ui.TEXT_SMALL + 2, Ui.FG, false); // the desktop's Incomplete,
tileDone = text("Done", Ui.TEXT_SMALL + 2, Ui.FG, false); // and Completed: short to fit
tileAll = text("All", Ui.TEXT_SMALL + 2, Ui.FG, false, true);
tileInc = text("To do", Ui.TEXT_SMALL + 2, Ui.FG, false, true); // the desktop's Incomplete,
tileDone = text("Done", Ui.TEXT_SMALL + 2, Ui.FG, false, true); // and Completed: short to fit
for (TextView t : new TextView[] {tileAll, tileInc, tileDone}) {
t.setGravity(Gravity.CENTER);
t.setPadding(dp(16), 0, dp(16), 0);
@@ -411,7 +429,7 @@ public final class MainActivity extends Activity {
nl.setPadding(dp(16), dp(14), dp(16), dp(8));
content.addView(nl);
note = new EditText(this);
note.setTextSize(TypedValue.COMPLEX_UNIT_SP, Ui.TEXT_BODY);
note.setTextSize(TypedValue.COMPLEX_UNIT_SP, Ui.TEXT_BODY * Ui.SCALE);
note.setTextColor(Ui.FG);
note.setGravity(Gravity.TOP | Gravity.START);
note.setMinHeight(dp(220));
@@ -546,7 +564,7 @@ public final class MainActivity extends Activity {
h.block = b;
LinearLayout v = new LinearLayout(this);
v.setOrientation(LinearLayout.HORIZONTAL);
v.setGravity(Gravity.CENTER_VERTICAL);
v.setBaselineAligned(true); // the name, hours and helper share one text baseline, as on the desktop
int color = blockColor(b);
if (style.equals("heading")) { // a little taller than before: it's a tap target now
v.setPadding(dp(16), dp(16), dp(16), dp(16));
@@ -561,6 +579,7 @@ public final class MainActivity extends Activity {
chip.setBackground(rounded(color, color, 0, dp(6)));
LinearLayout.LayoutParams cp = new LinearLayout.LayoutParams(dp(26), dp(26));
cp.setMargins(0, 0, dp(14), 0);
cp.gravity = Gravity.CENTER_VERTICAL; // a swatch has no baseline: it sits in the middle
v.addView(chip, cp);
}
v.addView(text(b.optString("label"), Ui.TEXT_BIG, Ui.FG, true));
@@ -590,7 +609,7 @@ public final class MainActivity extends Activity {
v.setMinimumHeight(0);
r.label = text(it.optString("label"), Ui.TEXT_SUB, Ui.GRAY, false);
r.label.setTypeface(r.label.getTypeface(), android.graphics.Typeface.ITALIC);
r.label.setPadding(dp(Ui.BOX + 20 + 12), 0, dp(8), 0);
r.label.setPadding(dp(12), 0, dp(8), 0); // just its depth's indent: the R1 is too narrow to line it up past a box
v.addView(r.label, new LinearLayout.LayoutParams(0, -2, 1));
r.view = v;
return r;
@@ -4,7 +4,7 @@ import android.content.Context;
/**
* Every size and colour in one place, sizes already doubled for the R1 (rabbit.html#dp).
* Two looks: dark (white on black, the default: best in bright sunlight) and light (the
* Two looks: dark (high contrast: only white on black, bigger text; the default: best in bright sunlight) and light (the
* desktop's: its grays, embossed boxes, block colours, the Edition date). setLight picks one;
* the colours below FG are set by it.
*/
@@ -14,6 +14,8 @@ final class Ui {
static final int WHITE = 0xFFFFFFFF, BLACK = 0xFF000000, HIGHLIGHT = 0xFF3584E4, SUN = 0xFFFFC400;
static boolean light;
/** Text size multiplier: dark is the high-contrast look, so its text is bigger (light = the desktop's sizes). */
static float SCALE;
static int FG, BG, TASKS, BAR_BG, GRAY, DIM, NOTE_BG, NOTE_EDGE, BUTTON;
static {
@@ -27,6 +29,7 @@ final class Ui {
BG = 0xFFEFEFEF; // 239: header and footer
TASKS = 0xFFF7F7F7; // 247: the tasks area, a little lighter
BAR_BG = 0xFFEFEFEF;
SCALE = 1f;
GRAY = 0xFF808080;
DIM = 0xFFA8A8A8;
NOTE_BG = WHITE;
@@ -36,10 +39,11 @@ final class Ui {
FG = WHITE;
BG = BLACK;
TASKS = BLACK;
BAR_BG = 0xFF111111;
GRAY = 0xFF8A8A8A;
DIM = 0xFF3A3A3A;
NOTE_BG = 0xFF161616;
BAR_BG = BLACK; // high contrast: only black and white, no grays
GRAY = WHITE;
DIM = WHITE;
SCALE = 1.2f;
NOTE_BG = BLACK;
NOTE_EDGE = DIM;
BUTTON = BLACK;
}