Watchmaker Wiki

The ultimate watch maker for Android Wear!

User Tools

Site Tools


tips:textshortening

Differences

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

Link to this comparison view

Next revision
Previous revision
tips:textshortening [2015/01/24 06:22]
rahul_pawa created
tips:textshortening [2015/01/24 06:36] (current)
rahul_pawa [Intro]
Line 9: Line 9:
 Show ellipses after shortened event text Show ellipses after shortened event text
  
- string.format('%-.18s%s',string.sub('{c1t}', 1, 15), string.len('{c1t}')>18 and '...' or string.sub('{c1t}',16,18))+   string.format('%-.18s%s',string.sub('{c1t}', 1, 15), string.len('{c1t}')>18 and '...' or string.sub('{c1t}',16,18))
  
 Show event time with shortened event text and ellipses when needed Show event time with shortened event text and ellipses when needed
  
-string.format('%s %-.18s%s', '{c1b}', string.sub('{c1t}', 1, 15), string.len('{c1t}')>18 and '...' or string.sub('{c1t}',16,18))+   string.format('%s %-.18s%s', '{c1b}', string.sub('{c1t}', 1, 15), string.len('{c1t}')>18 and '...' or string.sub('{c1t}',16,18)) 
 + 
 +===== Intro ===== 
 + 
 +If you display three event text on your watch face, you may find times when the text is just too long. 
 + 
 +You //could// handle this problem by editing the event in your calendar, or simply ignoring it. After all, it will go away in a few hours. With a little code, you can instead be prepared for this inevitability. 
 + 
 +The examples on this page use string functions in LUA to limit the length of the event text. If you want to use the examples as is, you can copy them into the text field where you display the event text. 
 + 
 +===== Explanation of Examples ===== 
 + 
 +(Coming Soon) 
tips/textshortening.1422076948.txt.gz · Last modified: 2015/01/24 06:22 by rahul_pawa