Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// Update the view
function onUpdate(dc as Dc) as Void {
//Get and show the current battery percentage
var pwr = System.getSystemStats().battery;
var batStr = Lang.format( "$1$%", [ pwr.format( "%2d" ) ] );
updateDisplayObject("BatteryLabel", batStr);
//Update battery text color
// Call the parent onUpdate function to redraw the layout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment