From 02ec6b88ed4e6cf40cc257572b07c7277b7b6341 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Wed, 22 Aug 2012 17:26:40 -0700 Subject: add simple text to recovery UI - recovery takes a --locale argument, which will be passed by the main system - the locale is saved in cache, in case the --locale argument is missing (eg, when recovery is started from fastboot) - we include images that have prerendered text for many locales - we split the background states into four (installing update, erasing, no command, error) so that appropriate text can be shown. Change-Id: I731b8108e83d5ccc09a4aacfc1dbf7e86b397aaf --- screen_ui.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'screen_ui.h') diff --git a/screen_ui.h b/screen_ui.h index 34929ee1a..16ee741b7 100644 --- a/screen_ui.h +++ b/screen_ui.h @@ -57,7 +57,8 @@ class ScreenRecoveryUI : public RecoveryUI { int installingFrame; pthread_mutex_t updateMutex; - gr_surface backgroundIcon[3]; + gr_surface backgroundIcon[5]; + gr_surface backgroundText[5]; gr_surface *installationOverlay; gr_surface *progressBarIndeterminate; gr_surface progressBarEmpty; @@ -92,6 +93,7 @@ class ScreenRecoveryUI : public RecoveryUI { int indeterminate_frames; int installing_frames; int install_overlay_offset_x, install_overlay_offset_y; + int overlay_offset_x, overlay_offset_y; void draw_install_overlay_locked(int frame); void draw_background_locked(Icon icon); @@ -104,7 +106,7 @@ class ScreenRecoveryUI : public RecoveryUI { void progress_loop(); void LoadBitmap(const char* filename, gr_surface* surface); - + void LoadLocalizedBitmap(const char* filename, gr_surface* surface); }; #endif // RECOVERY_UI_H -- cgit v1.2.3 From 5fa8c23911759a9e81af0e7fb5eb431277b8e9a6 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Tue, 18 Sep 2012 12:37:02 -0700 Subject: localization for recovery messages Add images of text for all locales we support. Make the progress bar fill the correct way for RTL languages. (Flip the direction the spinner turns, too, just for good measure.) Bug: 7064142 Change-Id: I5dddb26e02ee5275c57c4dc4a03c6d68432ac7ba --- screen_ui.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'screen_ui.h') diff --git a/screen_ui.h b/screen_ui.h index 16ee741b7..80051724b 100644 --- a/screen_ui.h +++ b/screen_ui.h @@ -29,6 +29,7 @@ class ScreenRecoveryUI : public RecoveryUI { ScreenRecoveryUI(); void Init(); + void SetLocale(const char* locale); // overall recovery state ("background image") void SetBackground(Icon icon); @@ -55,6 +56,7 @@ class ScreenRecoveryUI : public RecoveryUI { private: Icon currentIcon; int installingFrame; + bool rtl_locale; pthread_mutex_t updateMutex; gr_surface backgroundIcon[5]; -- cgit v1.2.3 From 6fd59ac07d91eb373f4269a40e688aa82a6ccc6e Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Wed, 6 Mar 2013 15:01:11 -0800 Subject: more font improvements and cleanup Get rid of the notion of a font's "ascent"; the reference point for drawing is the top-left corner of the character box rather than the baseline. Add some more space between the menu entries and make the highlight bar around the text. Replace the default font.png with two images; the build system will include one or the other based on the resolutions of the device. Restore the original compiled-in bitmap font, to fall back on when font.png can't be found (eg, in the charger binary). Add support for bold text (when a font.png image is used). Change-Id: I6d211a486a3636f20208502b1cd2aeae8b9f5b02 --- screen_ui.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'screen_ui.h') diff --git a/screen_ui.h b/screen_ui.h index 80051724b..fe0de46e8 100644 --- a/screen_ui.h +++ b/screen_ui.h @@ -76,7 +76,7 @@ class ScreenRecoveryUI : public RecoveryUI { bool pagesIdentical; static const int kMaxCols = 96; - static const int kMaxRows = 32; + static const int kMaxRows = 96; // Log text overlay, displayed when a magic key is pressed char text[kMaxRows][kMaxCols]; @@ -100,7 +100,6 @@ class ScreenRecoveryUI : public RecoveryUI { void draw_install_overlay_locked(int frame); void draw_background_locked(Icon icon); void draw_progress_locked(); - void draw_text_line(int row, const char* t); void draw_screen_locked(); void update_screen_locked(); void update_progress_locked(); -- cgit v1.2.3