Skip to content

Commit

Permalink
Fix: battery bar
Browse files Browse the repository at this point in the history
  • Loading branch information
littleprojects committed Aug 11, 2015
1 parent d0c9d43 commit 2868d6e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion appinfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"shortName": "circuit binary",
"uuid": "4912af97-9664-425c-8cb7-2d04b40e0f8c",
"versionCode": 1,
"versionLabel": "2.0",
"versionLabel": "2.1",
"watchapp": {
"watchface": true
}
Expand Down
12 changes: 9 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ persist settings = {
.numbers = true,
.vibe_h = false,
.vibe_bt = false,
.show_bat = false,
.show_bat = true, //false,
.day = true,
.number_old = true,
.bt_old = true
Expand Down Expand Up @@ -204,11 +204,17 @@ void bt_status(GContext* ctx, bool on) {
}

void bat_status(GContext* ctx, BatteryChargeState charge_state) {
if(settings.show_bat){
if(true){ //settings.show_bat
//change the color
graphics_context_set_fill_color(ctx, settings.day ? GColorWhite : GColorBlack); //on
//draw the line
graphics_fill_rect(ctx, GRect(0, 166, (int)(144/100*charge_state.charge_percent), 10), 1, 0);

//float var1 = (144*charge_state.charge_percent)/100;
//int var = (int)var1;
//APP_LOG(APP_LOG_LEVEL_DEBUG, "Battery Level is %d", charge_state.charge_percent);
//APP_LOG(APP_LOG_LEVEL_DEBUG, "Battery Bar hav %d", var);

graphics_fill_rect(ctx, GRect(0, 166, (int)((144*charge_state.charge_percent)/100), 10), 1, 0);
}
}

Expand Down

0 comments on commit 2868d6e

Please sign in to comment.