charger: updates for 7.1.2 minui
Change-Id: I613799e7ed332d11333ba166f7df310b86deb450
This commit is contained in:
@@ -62,8 +62,6 @@ static struct animation anim = {
|
|||||||
.num_frames = 0,
|
.num_frames = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool font_inited;
|
|
||||||
|
|
||||||
static int draw_surface_centered(GRSurface* surface)
|
static int draw_surface_centered(GRSurface* surface)
|
||||||
{
|
{
|
||||||
int w, h, x, y;
|
int w, h, x, y;
|
||||||
@@ -85,14 +83,14 @@ static void draw_capacity(int capacity)
|
|||||||
|
|
||||||
struct frame *f = &anim.frames[0];
|
struct frame *f = &anim.frames[0];
|
||||||
int font_x, font_y;
|
int font_x, font_y;
|
||||||
gr_font_size(&font_x, &font_y);
|
gr_font_size(gr_sys_font(), &font_x, &font_y);
|
||||||
int w = gr_measure(cap_str);
|
int w = gr_measure(gr_sys_font(), cap_str);
|
||||||
int h = gr_get_height(f->surface);
|
int h = gr_get_height(f->surface);
|
||||||
int x = (gr_fb_width() - w) / 2;
|
int x = (gr_fb_width() - w) / 2;
|
||||||
int y = (gr_fb_height() + h) / 2;
|
int y = (gr_fb_height() + h) / 2;
|
||||||
|
|
||||||
gr_color(255, 255, 255, 255);
|
gr_color(255, 255, 255, 255);
|
||||||
gr_text(x, y + font_y / 2, cap_str, 0);
|
gr_text(gr_sys_font(), x, y + font_y / 2, cap_str, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QCOM_HARDWARE
|
#ifdef QCOM_HARDWARE
|
||||||
@@ -337,11 +335,6 @@ void healthd_board_mode_charger_draw_battery(
|
|||||||
int start_frame = 0;
|
int start_frame = 0;
|
||||||
int capacity = -1;
|
int capacity = -1;
|
||||||
|
|
||||||
if (!font_inited) {
|
|
||||||
gr_set_font("log");
|
|
||||||
font_inited = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (batt_prop && batt_prop->batteryLevel >= 0) {
|
if (batt_prop && batt_prop->batteryLevel >= 0) {
|
||||||
capacity = batt_prop->batteryLevel;
|
capacity = batt_prop->batteryLevel;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user