Watchmaker Wiki

The ultimate watch maker for Android Wear!

User Tools

Site Tools


battery

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

battery [2015/01/20 19:26] – created splitbrainbattery [2015/01/20 19:45] (current) – moved to sprites splitbrain
Line 1: Line 1:
-====== Battery Widget ====== 
- 
-{{ :official:images:battery_set_3.png?200|}} 
-Battery Widgets are [[image]] widgets so please refer to them for their general use. 
- 
-To display the current battery level, the battery widget uses a special image that contains multiple icons (also called a sprite). Depending on the image set chosen, the widget can display the level in different degrees of accuracy. 
- 
-When adding the widget you can switch between the watch's and the phone's battery level to be displayed. 
- 
-===== Using your own image ===== 
- 
-You can provide your own image. To do so select it in the "Custom Image" property and make sure to adjust the "image grid" property to match the layout of your sprite. 
- 
-Which icon is displayed is displayed is determined by the "Image Selection" property. It should contain a [[lua]] expression returning the number of the image to show (on a 3x3 grid, 1 is the top left corner, 3 is top right and 7 is bottom left). 
- 
-The default expression for the 7-icon set "Battery Set 3" is this: 
- 
-<code lua> 
-'{bc}' == 'Charging' and 7 or {bl} >= 90 and 1 or {bl} >= 70 and 2 or {bl} >= 50 and 3 or {bl} >= 30 and 4 or {bl} >= 10 and 5 or 6 
-</code> 
- 
-''{bl}'' refers to the [[tags#battery tag]] containing the current level in percent. The expression maps the many states this tag can have to the 7 available icons. 
  
battery.1421781964.txt.gz · Last modified: 2015/01/20 19:26 by splitbrain