aboutsummaryrefslogtreecommitdiffstats
path: root/screen_ui.h
diff options
context:
space:
mode:
authorTom Marshall <tdm@cyngn.com>2016-02-15 15:36:06 -0800
committerTom Marshall <tdm@cyngn.com>2016-03-07 15:16:25 -0800
commit6c20b00105e405823aa3ec12479e52cc30c0df9c (patch)
tree607a9223c74ea58e8d62bce4874ebc281846c134 /screen_ui.h
parentd66f66eb72fc72c17d1a292cfbeaf2ec08721327 (diff)
downloadbootable_recovery-6c20b00105e405823aa3ec12479e52cc30c0df9c.zip
bootable_recovery-6c20b00105e405823aa3ec12479e52cc30c0df9c.tar.gz
bootable_recovery-6c20b00105e405823aa3ec12479e52cc30c0df9c.tar.bz2
recovery: Implement sysbar
Add a system bar (navigation bar) similar to the main Android system with back and home buttons. This makes it easier for users to figure out how to go back on devices that lack hardware buttons, and also provides a quick way to get back to the main menu. Note only buttons that do not have a hardware equivalent are shown, in order to prevent redundancy and confusion. Change-Id: I7538749978837571a8c250c3c8e54ac127b39d84
Diffstat (limited to 'screen_ui.h')
-rw-r--r--screen_ui.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/screen_ui.h b/screen_ui.h
index 93d06bc..9d7b263 100644
--- a/screen_ui.h
+++ b/screen_ui.h
@@ -23,6 +23,9 @@
#include "ui.h"
#include "minui/minui.h"
+#define SYSBAR_BACK 0x01
+#define SYSBAR_HOME 0x02
+
// Implementation of RecoveryUI appropriate for devices with a screen
// (shows an icon + a progress bar, text logging, menu, etc.)
class ScreenRecoveryUI : public RecoveryUI {
@@ -60,6 +63,11 @@ class ScreenRecoveryUI : public RecoveryUI {
void DialogDismiss();
void SetHeadlessMode();
+ // sysbar
+ int GetSysbarHeight() { return gr_get_height(sysbarBackHighlightIcon); }
+ int GetSysbarState() { return sysbar_state; }
+ void SetSysbarState(int state) { sysbar_state = state; Redraw(); }
+
// menu display
virtual int MenuItemStart() const { return menu_item_start_; }
virtual int MenuItemHeight() const { return 3 * char_height_; }
@@ -87,6 +95,10 @@ class ScreenRecoveryUI : public RecoveryUI {
pthread_cond_t progressCondition;
GRSurface* headerIcon;
+ GRSurface* sysbarBackIcon;
+ GRSurface* sysbarBackHighlightIcon;
+ GRSurface* sysbarHomeIcon;
+ GRSurface* sysbarHomeHighlightIcon;
GRSurface* backgroundIcon[NR_ICONS];
GRSurface* backgroundText[NR_ICONS];
GRSurface** installation;
@@ -126,6 +138,8 @@ class ScreenRecoveryUI : public RecoveryUI {
int menu_show_start_;
int max_menu_rows_;
+ int sysbar_state;
+
// An alternate text screen, swapped with 'text_' when we're viewing a log file.
char** file_viewer_text_;
@@ -147,6 +161,7 @@ class ScreenRecoveryUI : public RecoveryUI {
int char_height_, char_width_;
int header_height_, header_width_;
+ int sysbar_height_;
int text_first_row_;
bool update_waiting;
@@ -155,6 +170,7 @@ class ScreenRecoveryUI : public RecoveryUI {
void draw_progress_locked();
int draw_header_icon();
void draw_menu_item(int textrow, const char *text, int selected);
+ void draw_sysbar();
void draw_dialog();
void draw_screen_locked();
void update_screen_locked();