From 5e7cfb9af64d5f6bf616d9b6fa40bd0ae82e781a Mon Sep 17 00:00:00 2001 From: Damien Bargiacchi Date: Wed, 24 Aug 2016 18:28:43 -0700 Subject: Remove duplicate methods and variables from WearRecoveryUI Copy pasta is never as delicious as ones hopes. Also fix the Pike not rendering recovery bug. Change-Id: I903da7da436e3347a22ff51633e8a0f28fea2c46 --- screen_ui.h | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) (limited to 'screen_ui.h') diff --git a/screen_ui.h b/screen_ui.h index 898775778..de7b6442e 100644 --- a/screen_ui.h +++ b/screen_ui.h @@ -37,16 +37,16 @@ class ScreenRecoveryUI : public RecoveryUI { void SetSystemUpdateText(bool security_update); // progress indicator - void SetProgressType(ProgressType type); - void ShowProgress(float portion, float seconds); - void SetProgress(float fraction); + void SetProgressType(ProgressType type) override; + void ShowProgress(float portion, float seconds) override; + void SetProgress(float fraction) override; - void SetStage(int current, int max); + void SetStage(int current, int max) override; // text log - void ShowText(bool visible); - bool IsTextVisible(); - bool WasTextEverVisible(); + void ShowText(bool visible) override; + bool IsTextVisible() override; + bool WasTextEverVisible() override; // printing messages void Print(const char* fmt, ...) __printflike(2, 3); @@ -72,8 +72,6 @@ class ScreenRecoveryUI : public RecoveryUI { Icon currentIcon; const char* locale; - bool intro_done; - int current_frame; // The scale factor from dp to pixels. 1.0 for mdpi, 4.0 for xxxhdpi. float density_; @@ -123,8 +121,11 @@ class ScreenRecoveryUI : public RecoveryUI { pthread_t progress_thread_; // Number of intro frames and loop frames in the animation. - int intro_frames; - int loop_frames; + size_t intro_frames; + size_t loop_frames; + + size_t current_frame; + bool intro_done; // Number of frames per sec (default: 30) for both parts of the animation. int animation_fps; @@ -136,11 +137,13 @@ class ScreenRecoveryUI : public RecoveryUI { pthread_mutex_t updateMutex; bool rtl_locale; - void draw_background_locked(); - void draw_foreground_locked(); - void draw_screen_locked(); - void update_screen_locked(); - void update_progress_locked(); + virtual void InitTextParams(); + + virtual void draw_background_locked(); + virtual void draw_foreground_locked(); + virtual void draw_screen_locked(); + virtual void update_screen_locked(); + virtual void update_progress_locked(); GRSurface* GetCurrentFrame(); GRSurface* GetCurrentText(); @@ -148,8 +151,8 @@ class ScreenRecoveryUI : public RecoveryUI { static void* ProgressThreadStartRoutine(void* data); void ProgressThreadLoop(); - void ShowFile(FILE*); - void PrintV(const char*, bool, va_list); + virtual void ShowFile(FILE*); + virtual void PrintV(const char*, bool, va_list); void PutChar(char); void ClearText(); @@ -158,9 +161,9 @@ class ScreenRecoveryUI : public RecoveryUI { void LoadLocalizedBitmap(const char* filename, GRSurface** surface); int PixelsFromDp(int dp); - int GetAnimationBaseline(); - int GetProgressBaseline(); - int GetTextBaseline(); + virtual int GetAnimationBaseline(); + virtual int GetProgressBaseline(); + virtual int GetTextBaseline(); void DrawHorizontalRule(int* y); void DrawTextLine(int x, int* y, const char* line, bool bold); -- cgit v1.2.3