pebble
  • Tutorials
  • Get the SDK
  • Guides
  • Documentation
  • Examples
  • Community
  • Blog
  • More
Privacy
Cookies
Publish

Community

  • Events
    • Developer Retreat 2015
    • Developer Retreat 2014
  • Online Communities
  • Example Apps
    • Hello
    • Caltrain
    • HeroBoard
    • Multi Timer
    • Resistor Time
  • Tools
    • App Message Bridge
    • Appstore Badge Generator
    • GPath.svg
    • pBuild Travis CI Build Tool
    • Sublime Text Plugin
    • Watchface Generator
    • Watch Status
  • Libraries
    • Color Selector
    • Custom Status Bar for Pebble
    • EffectLayer
    • GBitmap Colour Palette Manipulator
    • Java Pebble Timeline
    • JS Message Queue
    • Pebble Timeline API for DotNet (C#)
    • Pebble API PHP
    • PebbleTimeline API Ruby
    • PHPebbleTimeline
    • PinPusher
    • pypebbleapi
    • Simple Dithering Library
    • T3 Keyboard
    • ToastLayer Library

Custom Status Bar for Pebble

A plug and play custom status bar implementation for pebble apps and watch faces. Easily populate 3 text layers and/or 5 bitmap layers.

Use:

Choose a status bar height and icon size. Icons should be square with a maximum of 28 pixels.

#define BAR_HEIGHT 20

#define ICON_WIDTH_HEIGHT 15

Declare

static CustomStatusBarLayer *custom_status_bar;

Create

custom_status_bar = custom_status_bar_layer_create(BAR_HEIGHT, GColorBlack, ICON_WIDTH_HEIGHT);

Set Text and Icons

Text layers, use positions CSB_TEXT_LEFT, CSB_TEXT_RIGHT, CSB_TEXT_CENTER

char *t = ...;

custom_status_bar_layer_set_text(custom_status_bar, CSB_TEXT_LEFT, t);

Icons, use positions CSB_ICON_0 to CSB_ICON_4 (positions are left to right, 0 indexed)

custom_status_bar_layer_set_bitmap(custom_status_bar, CSB_ICON_4, your_gbitmap); 

When you're done, destroy

custom_status_bar_layer_destroy(custom_status_bar);

One last note! Your window should have a height of 168 - BAR_HEIGHT.

See the header file for more details. Enjoy!

Created By:

Jonathan LaRocque (Reboot's Ramblings)

View Library