Skip to content

Pebble library to add a simple battery bar to your watch app

License

Notifications You must be signed in to change notification settings

orviwan/pebble-battery-bar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pebble-battery-bar

Pebble library for easily adding a battery bar to your app.

Screenshot of library in action

Usage

pebble package install pebble-battery-bar

// This is a simple example, demonstrating the basic usage.
#include <pebble-battery-bar/pebble-battery-bar.h>

static BatteryBarLayer *s_battery_layer;

static void window_load(Window *window) {
  Layer *window_layer = window_get_root_layer(window);

  s_battery_layer = battery_bar_layer_create();
  layer_add_child(window_layer, s_battery_layer);
}

static void window_unload(Window *window) {
  battery_bar_layer_destroy(s_battery_layer);
}

Additional Settings

Position the battery bar on screen.

void battery_bar_set_position(GPoint position);

Hide the percentage text (100%).

void battery_bar_set_percent_hidden(bool hidden);

Hide the battery icon.

void battery_bar_set_icon_hidden(bool hidden);

Override the color scheme for each state.

void battery_bar_set_colors(GColor normal, GColor warning, GColor danger, GColor charging);

About

Pebble library to add a simple battery bar to your watch app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published