Skip to content

Commit

Permalink
Revert "charger: Draw battery percentage over charger screen"
Browse files Browse the repository at this point in the history
This reverts commit f7e1ef2.

Rationale:
The tiny (blue) number drawn on top of the otherwise black-and-white
battery symbol looks pretty out of place and gives the perception of
being a debugging leftover that just was forgotten to be removed.
Additionally it's very unlikely the user is interested in the exact
value of battery charge in offmode charging. It's much more likely he's
interested in rough state information only ('is my battery fully charged
now?').

Change-Id: I2b4f881faa4a254d03e07d5d46b6870a2fe9ec4a
  • Loading branch information
maniac103 committed Jul 7, 2014
1 parent bf140a9 commit 54e72ea
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions charger/charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,20 +707,6 @@ static void android_blue(void)
gr_color(0, 191, 255, 255);
}

static void draw_capacity(struct charger *charger)
{
char cap_str[64];
int x, y;
int str_len_px;

snprintf(cap_str, sizeof(cap_str), "%d%%", charger->batt_anim->capacity);
str_len_px = gr_measure(cap_str);
x = (gr_fb_width() - str_len_px) / 2;
y = (gr_fb_height() + char_height) / 2;
android_blue();
gr_text(x, y, cap_str, 0);
}

/* returns the last y-offset of where the surface ends */
static int draw_surface_centered(struct charger *charger, gr_surface surface)
{
Expand Down Expand Up @@ -773,10 +759,8 @@ static void redraw_screen(struct charger *charger)
/* try to display *something* */
if (batt_anim->capacity < 0 || batt_anim->num_frames == 0)
draw_unknown(charger);
else {
else
draw_battery(charger);
draw_capacity(charger);
}
gr_flip();
}

Expand Down

0 comments on commit 54e72ea

Please sign in to comment.