make density-specific recovery assets
Provide different recovery UI resources for different display densities. Right now only the text images and the progress bars are rescaled; the main icon will get scaled when it's updated for QP. Lightly quantum-ify the rest of the recovery interface. (Light background, progress bars, etc.) Change-Id: Ia639c4ce8534b01bc843524efbc4b040c1cf38b3
BIN
res-hdpi/images/erasing_text.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
res-hdpi/images/error_text.png
Normal file
After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 116 KiB |
BIN
res-hdpi/images/installing_text.png
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
res-hdpi/images/no_command_text.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
res-hdpi/images/progress_empty.png
Normal file
After Width: | Height: | Size: 81 B |
BIN
res-hdpi/images/progress_fill.png
Normal file
After Width: | Height: | Size: 83 B |
Before Width: | Height: | Size: 322 B After Width: | Height: | Size: 322 B |
Before Width: | Height: | Size: 258 B After Width: | Height: | Size: 258 B |
BIN
res-mdpi/images/erasing_text.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
res-mdpi/images/error_text.png
Normal file
After Width: | Height: | Size: 7 KiB |
BIN
res-mdpi/images/icon_error.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
res-mdpi/images/icon_installing.png
Normal file
After Width: | Height: | Size: 116 KiB |
BIN
res-mdpi/images/installing_text.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
res-mdpi/images/no_command_text.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
res-mdpi/images/progress_empty.png
Normal file
After Width: | Height: | Size: 74 B |
BIN
res-mdpi/images/progress_fill.png
Normal file
After Width: | Height: | Size: 83 B |
BIN
res-mdpi/images/stage_empty.png
Normal file
After Width: | Height: | Size: 322 B |
BIN
res-mdpi/images/stage_fill.png
Normal file
After Width: | Height: | Size: 258 B |
BIN
res-xhdpi/images/erasing_text.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
res-xhdpi/images/error_text.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
res-xhdpi/images/icon_error.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
res-xhdpi/images/icon_installing.png
Normal file
After Width: | Height: | Size: 116 KiB |
BIN
res-xhdpi/images/installing_text.png
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
res-xhdpi/images/no_command_text.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
res-xhdpi/images/progress_empty.png
Normal file
After Width: | Height: | Size: 84 B |
BIN
res-xhdpi/images/progress_fill.png
Normal file
After Width: | Height: | Size: 84 B |
BIN
res-xhdpi/images/stage_empty.png
Normal file
After Width: | Height: | Size: 322 B |
BIN
res-xhdpi/images/stage_fill.png
Normal file
After Width: | Height: | Size: 258 B |
BIN
res-xxhdpi/images/erasing_text.png
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
res-xxhdpi/images/error_text.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
res-xxhdpi/images/icon_error.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
res-xxhdpi/images/icon_installing.png
Normal file
After Width: | Height: | Size: 116 KiB |
BIN
res-xxhdpi/images/installing_text.png
Normal file
After Width: | Height: | Size: 130 KiB |
BIN
res-xxhdpi/images/no_command_text.png
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
res-xxhdpi/images/progress_empty.png
Normal file
After Width: | Height: | Size: 86 B |
BIN
res-xxhdpi/images/progress_fill.png
Normal file
After Width: | Height: | Size: 86 B |
BIN
res-xxhdpi/images/stage_empty.png
Normal file
After Width: | Height: | Size: 322 B |
BIN
res-xxhdpi/images/stage_fill.png
Normal file
After Width: | Height: | Size: 258 B |
BIN
res-xxxhdpi/images/erasing_text.png
Normal file
After Width: | Height: | Size: 84 KiB |
BIN
res-xxxhdpi/images/error_text.png
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
res-xxxhdpi/images/icon_error.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
res-xxxhdpi/images/icon_installing.png
Normal file
After Width: | Height: | Size: 116 KiB |
BIN
res-xxxhdpi/images/installing_text.png
Normal file
After Width: | Height: | Size: 181 KiB |
BIN
res-xxxhdpi/images/no_command_text.png
Normal file
After Width: | Height: | Size: 107 KiB |
BIN
res-xxxhdpi/images/progress_empty.png
Normal file
After Width: | Height: | Size: 90 B |
BIN
res-xxxhdpi/images/progress_fill.png
Normal file
After Width: | Height: | Size: 90 B |
BIN
res-xxxhdpi/images/stage_empty.png
Normal file
After Width: | Height: | Size: 322 B |
BIN
res-xxxhdpi/images/stage_fill.png
Normal file
After Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 118 B |
Before Width: | Height: | Size: 404 B |
|
@ -87,7 +87,7 @@ ScreenRecoveryUI::ScreenRecoveryUI() :
|
||||||
void ScreenRecoveryUI::draw_background_locked(Icon icon)
|
void ScreenRecoveryUI::draw_background_locked(Icon icon)
|
||||||
{
|
{
|
||||||
pagesIdentical = false;
|
pagesIdentical = false;
|
||||||
gr_color(0, 0, 0, 255);
|
gr_color(250, 250, 250, 255);
|
||||||
gr_clear();
|
gr_clear();
|
||||||
|
|
||||||
if (icon) {
|
if (icon) {
|
||||||
|
@ -123,7 +123,7 @@ void ScreenRecoveryUI::draw_background_locked(Icon icon)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gr_color(255, 255, 255, 255);
|
gr_color(115, 115, 115, 255);
|
||||||
gr_texticon(textX, textY, text_surface);
|
gr_texticon(textX, textY, text_surface);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,7 @@ void ScreenRecoveryUI::draw_progress_locked()
|
||||||
int dy = (3*gr_fb_height() + iconHeight - 2*height)/4;
|
int dy = (3*gr_fb_height() + iconHeight - 2*height)/4;
|
||||||
|
|
||||||
// Erase behind the progress bar (in case this was a progress-only update)
|
// Erase behind the progress bar (in case this was a progress-only update)
|
||||||
gr_color(0, 0, 0, 255);
|
gr_color(250, 250, 250, 255);
|
||||||
gr_fill(dx, dy, width, height);
|
gr_fill(dx, dy, width, height);
|
||||||
|
|
||||||
if (progressBarType == DETERMINATE) {
|
if (progressBarType == DETERMINATE) {
|
||||||
|
@ -179,20 +179,17 @@ void ScreenRecoveryUI::draw_progress_locked()
|
||||||
void ScreenRecoveryUI::SetColor(UIElement e) {
|
void ScreenRecoveryUI::SetColor(UIElement e) {
|
||||||
switch (e) {
|
switch (e) {
|
||||||
case HEADER:
|
case HEADER:
|
||||||
gr_color(247, 0, 6, 255);
|
gr_color(0xff, 0x57, 0x22, 255); // Quantum "Deep Orange" 500
|
||||||
break;
|
break;
|
||||||
case MENU:
|
case MENU:
|
||||||
case MENU_SEL_BG:
|
case MENU_SEL_BG:
|
||||||
gr_color(0, 106, 157, 255);
|
gr_color(0x67, 0x3a, 0xb7, 255); // Quantum "Deep Purple" 500
|
||||||
break;
|
break;
|
||||||
case MENU_SEL_FG:
|
case MENU_SEL_FG:
|
||||||
gr_color(255, 255, 255, 255);
|
gr_color(255, 255, 255, 255);
|
||||||
break;
|
break;
|
||||||
case LOG:
|
case LOG:
|
||||||
gr_color(249, 194, 0, 255);
|
gr_color(0x3f, 0x51, 0xb5, 255); // Quantum "Indigo" 500
|
||||||
break;
|
|
||||||
case TEXT_FILL:
|
|
||||||
gr_color(0, 0, 0, 160);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
gr_color(255, 255, 255, 255);
|
gr_color(255, 255, 255, 255);
|
||||||
|
@ -208,7 +205,7 @@ void ScreenRecoveryUI::draw_screen_locked()
|
||||||
draw_background_locked(currentIcon);
|
draw_background_locked(currentIcon);
|
||||||
draw_progress_locked();
|
draw_progress_locked();
|
||||||
} else {
|
} else {
|
||||||
gr_color(0, 0, 0, 255);
|
gr_color(250, 250, 250, 255);
|
||||||
gr_clear();
|
gr_clear();
|
||||||
|
|
||||||
int y = 0;
|
int y = 0;
|
||||||
|
@ -222,13 +219,13 @@ void ScreenRecoveryUI::draw_screen_locked()
|
||||||
if (i == menu_top + menu_sel) {
|
if (i == menu_top + menu_sel) {
|
||||||
// draw the highlight bar
|
// draw the highlight bar
|
||||||
SetColor(MENU_SEL_BG);
|
SetColor(MENU_SEL_BG);
|
||||||
gr_fill(0, y-2, gr_fb_width(), y+char_height+2);
|
gr_fill(0, y-2+kTextYOffset, gr_fb_width(), y+char_height+2+kTextYOffset);
|
||||||
// white text of selected item
|
// white text of selected item
|
||||||
SetColor(MENU_SEL_FG);
|
SetColor(MENU_SEL_FG);
|
||||||
if (menu[i][0]) gr_text(4, y, menu[i], 1);
|
if (menu[i][0]) gr_text(kTextXOffset, y+kTextYOffset, menu[i], 1);
|
||||||
SetColor(MENU);
|
SetColor(MENU);
|
||||||
} else {
|
} else {
|
||||||
if (menu[i][0]) gr_text(4, y, menu[i], i < menu_top);
|
if (menu[i][0]) gr_text(kTextXOffset, y+kTextYOffset, menu[i], i < menu_top);
|
||||||
}
|
}
|
||||||
y += char_height+4;
|
y += char_height+4;
|
||||||
}
|
}
|
||||||
|
@ -249,7 +246,7 @@ void ScreenRecoveryUI::draw_screen_locked()
|
||||||
for (int ty = gr_fb_height() - char_height, count = 0;
|
for (int ty = gr_fb_height() - char_height, count = 0;
|
||||||
ty > y+2 && count < text_rows;
|
ty > y+2 && count < text_rows;
|
||||||
ty -= char_height, ++count) {
|
ty -= char_height, ++count) {
|
||||||
gr_text(4, ty, text[row], 0);
|
gr_text(kTextXOffset, ty+kTextYOffset, text[row], 0);
|
||||||
--row;
|
--row;
|
||||||
if (row < 0) row = text_rows-1;
|
if (row < 0) row = text_rows-1;
|
||||||
}
|
}
|
||||||
|
@ -350,11 +347,11 @@ void ScreenRecoveryUI::Init()
|
||||||
gr_font_size(&char_width, &char_height);
|
gr_font_size(&char_width, &char_height);
|
||||||
|
|
||||||
text_col = text_row = 0;
|
text_col = text_row = 0;
|
||||||
text_rows = gr_fb_height() / char_height;
|
text_rows = (gr_fb_height() - 2 * kTextYOffset) / char_height;
|
||||||
if (text_rows > kMaxRows) text_rows = kMaxRows;
|
if (text_rows > kMaxRows) text_rows = kMaxRows;
|
||||||
text_top = 1;
|
text_top = 1;
|
||||||
|
|
||||||
text_cols = gr_fb_width() / char_width;
|
text_cols = (gr_fb_width() - 2 * kTextXOffset) / char_width;
|
||||||
if (text_cols > kMaxCols - 1) text_cols = kMaxCols - 1;
|
if (text_cols > kMaxCols - 1) text_cols = kMaxCols - 1;
|
||||||
|
|
||||||
backgroundIcon[NONE] = NULL;
|
backgroundIcon[NONE] = NULL;
|
||||||
|
|
|
@ -87,6 +87,9 @@ class ScreenRecoveryUI : public RecoveryUI {
|
||||||
static const int kMaxCols = 96;
|
static const int kMaxCols = 96;
|
||||||
static const int kMaxRows = 96;
|
static const int kMaxRows = 96;
|
||||||
|
|
||||||
|
static const int kTextXOffset = 8;
|
||||||
|
static const int kTextYOffset = 4;
|
||||||
|
|
||||||
// Log text overlay, displayed when a magic key is pressed
|
// Log text overlay, displayed when a magic key is pressed
|
||||||
char text[kMaxRows][kMaxCols];
|
char text[kMaxRows][kMaxCols];
|
||||||
int text_cols, text_rows;
|
int text_cols, text_rows;
|
||||||
|
|