abdoNull / kraigsandroid

Automatically exported from code.google.com/p/kraigsandroid
0 stars 0 forks source link

Patch supplied - more custom lockscreen text formatting options #69

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
First - I love this clock - and the fact you made it opensource!

I fancied some more control over the formatting options in the Custom 
Lockscreen text (next alarm) - so here's a really simple patch attached.

I added a call to android.text.format.Time.format() which handles the almost 
universal strftime() format specifiers.

The code for handling %c is retained, but changed to handle %i (interval) as %c 
already has meaning to format() and %i does not.

Although the code for %t is logically redundant, I kept it so as not to break 
existing configs (%t means TAB in strftime(), %R is the equivalent specifier).

Known bugs:

1) It's hard to fit any meaningful description into the help text due to lack 
of space

2) The %i (%c) handling code will break in the special case of "%%i" which 
should render as "%i" but will collapse harmlessly to "<interval>" (ie format() 
ignores the lone % that remains after %i has been substituted). Same applies 
for %t.

Feel free to mail me on tw@dionic.net

All the best!

Tim

Original issue reported on code.google.com by t...@dionic.net on 12 Mar 2012 at 2:55

Attachments:

GoogleCodeExporter commented 8 years ago
WARNING!

This will cause crashes - I think in the case of "persistent custom lockscreen 
text" being enabled AND there being no alarms enabled
therefore no time to format().

As we are unable (trivially at least) to remove the format specifiers and leave 
meaningful text in the event of no scheduled alarms, 
I suggest this patch which disables the persistent text tickbox.

At this stage, I am not attempting to remove the code to handle this case - 

Tim

Original comment by t...@dionic.net on 16 Mar 2012 at 6:35

Attachments: