54 lines
1.8 KiB
Java
54 lines
1.8 KiB
Java
package me.teafry.routine;
|
|
|
|
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
|
|
* desktop's: its grays, embossed boxes, block colours, the Edition date). setLight picks one;
|
|
* the colours below FG are set by it.
|
|
*/
|
|
final class Ui {
|
|
static final float TEXT_SMALL = 22, TEXT_BODY = 28, TEXT_BIG = 32, TEXT_SUB = 25;
|
|
static final int ROW_MIN = 88, BAR = 76, BOX = 52, INDENT = 40, ANIM_UNIT = 44;
|
|
static final int WHITE = 0xFFFFFFFF, BLACK = 0xFF000000, HIGHLIGHT = 0xFF3584E4, SUN = 0xFFFFC400;
|
|
|
|
static boolean light;
|
|
static int FG, BG, TASKS, BAR_BG, GRAY, DIM, NOTE_BG, NOTE_EDGE, BUTTON;
|
|
|
|
static {
|
|
setLight(false);
|
|
}
|
|
|
|
static void setLight(boolean on) {
|
|
light = on;
|
|
if (on) { // shared-resources design.html#colors light defaults
|
|
FG = BLACK;
|
|
BG = 0xFFEFEFEF; // 239: header and footer
|
|
TASKS = 0xFFF7F7F7; // 247: the tasks area, a little lighter
|
|
BAR_BG = 0xFFEFEFEF;
|
|
GRAY = 0xFF808080;
|
|
DIM = 0xFFA8A8A8;
|
|
NOTE_BG = WHITE;
|
|
NOTE_EDGE = 0xFFBDBDBD;
|
|
BUTTON = 0xFFF7F7F7; // 247
|
|
} else {
|
|
FG = WHITE;
|
|
BG = BLACK;
|
|
TASKS = BLACK;
|
|
BAR_BG = 0xFF111111;
|
|
GRAY = 0xFF8A8A8A;
|
|
DIM = 0xFF3A3A3A;
|
|
NOTE_BG = 0xFF161616;
|
|
NOTE_EDGE = DIM;
|
|
BUTTON = BLACK;
|
|
}
|
|
}
|
|
|
|
private Ui() {}
|
|
|
|
static int dp(Context c, float v) {
|
|
return Math.round(v * c.getResources().getDisplayMetrics().density);
|
|
}
|
|
}
|