aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes2016-04-14 18:49:04 -0500
committerElliott Hughes2016-04-15 00:44:23 -0500
commit498cda6ef6c610efb055221d6c689185d49447bb (patch)
tree93254321220442262525eb80b50f60055e3cea17 /screen_ui.h
parent8febafa67e93b2159804b1130a41f15b009de1cd (diff)
downloadplatform-bootable-recovery-498cda6ef6c610efb055221d6c689185d49447bb.tar.gz
platform-bootable-recovery-498cda6ef6c610efb055221d6c689185d49447bb.tar.xz
platform-bootable-recovery-498cda6ef6c610efb055221d6c689185d49447bb.zip
Update the system update animation.
Switch to a Wear-like intro/loop system. We don't have an intro yet, but hopefully this will let Wear delete more code when they move to N. Unlike them, we don't hard-code the number of frames: we just look to see what we have available. We do hard-code the fps though. Also add a graphics test mode so you can see a demo of the UI components without having to actually apply an OTA. Also fix a bug where default locale is null rather than en-US: it's more useful to show _some_ text if we don't have a locale (which should only be during development anyway). Bug: http://b/26548285 Change-Id: I63422e3fef3c41109f924d96fb5ded0b3ae7815d
Diffstat (limited to 'screen_ui.h')
-rw-r--r--screen_ui.h50
1 files changed, 32 insertions, 18 deletions
diff --git a/screen_ui.h b/screen_ui.h
index 9e1b2dfa..233ff55e 100644
--- a/screen_ui.h
+++ b/screen_ui.h
@@ -67,14 +67,23 @@ class ScreenRecoveryUI : public RecoveryUI {
67 }; 67 };
68 void SetColor(UIElement e); 68 void SetColor(UIElement e);
69 69
70 private: 70 protected:
71 Icon currentIcon; 71 Icon currentIcon;
72 int installingFrame; 72
73 const char* locale; 73 const char* locale;
74 bool intro_done;
75 int current_frame;
76
77 GRSurface* error_icon;
78
79 GRSurface* erasing_text;
80 GRSurface* error_text;
81 GRSurface* installing_text;
82 GRSurface* no_command_text;
83
84 GRSurface** introFrames;
85 GRSurface** loopFrames;
74 86
75 GRSurface* backgroundIcon[5];
76 GRSurface* backgroundText[5];
77 GRSurface** installation;
78 GRSurface* progressBarEmpty; 87 GRSurface* progressBarEmpty;
79 GRSurface* progressBarFill; 88 GRSurface* progressBarFill;
80 GRSurface* stageMarkerEmpty; 89 GRSurface* stageMarkerEmpty;
@@ -107,21 +116,31 @@ class ScreenRecoveryUI : public RecoveryUI {
107 116
108 pthread_t progress_thread_; 117 pthread_t progress_thread_;
109 118
110 // The following two are parsed from the image file 119 // Number of intro frames and loop frames in the animation.
111 // (e.g. '/res/images/icon_installing.png'). 120 int intro_frames;
121 int loop_frames;
122
123 // Number of frames per sec (default: 30) for both parts of the animation.
112 int animation_fps; 124 int animation_fps;
113 int installing_frames;
114 125
115 int iconX, iconY; 126 int iconX, iconY;
116 127
117 int stage, max_stage; 128 int stage, max_stage;
118 129
119 void draw_background_locked(Icon icon); 130 int char_width_;
131 int char_height_;
132 pthread_mutex_t updateMutex;
133 bool rtl_locale;
134
135 void draw_background_locked();
120 void draw_progress_locked(); 136 void draw_progress_locked();
121 void draw_screen_locked(); 137 void draw_screen_locked();
122 void update_screen_locked(); 138 void update_screen_locked();
123 void update_progress_locked(); 139 void update_progress_locked();
124 140
141 GRSurface* GetCurrentFrame();
142 GRSurface* GetCurrentText();
143
125 static void* ProgressThreadStartRoutine(void* data); 144 static void* ProgressThreadStartRoutine(void* data);
126 void ProgressThreadLoop(); 145 void ProgressThreadLoop();
127 146
@@ -130,16 +149,11 @@ class ScreenRecoveryUI : public RecoveryUI {
130 void PutChar(char); 149 void PutChar(char);
131 void ClearText(); 150 void ClearText();
132 151
133 void DrawHorizontalRule(int* y); 152 void LoadAnimation();
134
135 void LoadBitmapArray(const char* filename, int* frames, int* fps, GRSurface*** surface);
136 void LoadLocalizedBitmap(const char* filename, GRSurface** surface);
137 protected:
138 int char_width_;
139 int char_height_;
140 pthread_mutex_t updateMutex;
141 bool rtl_locale;
142 void LoadBitmap(const char* filename, GRSurface** surface); 153 void LoadBitmap(const char* filename, GRSurface** surface);
154 void LoadLocalizedBitmap(const char* filename, GRSurface** surface);
155
156 void DrawHorizontalRule(int* y);
143 void DrawTextLine(int x, int* y, const char* line, bool bold); 157 void DrawTextLine(int x, int* y, const char* line, bool bold);
144 void DrawTextLines(int x, int* y, const char* const* lines); 158 void DrawTextLines(int x, int* y, const char* const* lines);
145}; 159};