This is a binding to get the same result as the dynamic calendar icon script, but now from a binding in the dummy…
This is a binding to get the same result as the dynamic calendar icon script, but now from a binding in the dummy property (an alternative way, can’t tell which one is better).
The instructions are the same as the old script (http://www.lightninglauncher.com/wiki/doku.php?id=script_dynamic_calendar_icon) but now you can simply use lightning variables to set it to show the day or the month ( $ll_day or $ll_month respectively)
]]>« Hi Pierre Hébert Sent you a logcat. (Previous Post)
(Next Post) Everytime I click on a panel I get an ever growing dark circle in the middle of the panel. »
< ![CDATA[
//go to the icon picker and search the 31 items. Long click the first one (it will be copied) and paste it here between the brackets
var link = [ ]
//write here the number to set
var number=$ll_day;
//end of config
if(link.length==0){alert(“follow the instructions and paste the icon properties in the script”);return;}
var now=parseInt(number);
var iconPackName = link[0];
var prefixName = link[1].substring(0,link[1].length-1);
var icon=LL.createImage(iconPackName,prefixName+now);
if(icon==null){alert(“no icon found, make sure the pasted data is right and the icon pack have it”);return;}
item.setCustomIcon(icon);
]]>
< ![CDATA[
Wow Thanks
]]>
< ![CDATA[
Great. Just found it again
]]>
< ![CDATA[
🙂 I didn’t remember this one. Nice find!
]]>
< ![CDATA[
Seems not fine on the new aplha.
LLx not responding and then icon is changed but bindings vanishing
Pierre Hébert sent you a report
]]>
< ![CDATA[
Pierre Hébert please check
The icon is changed after reloading LLx but bindings not saved
]]>
< ![CDATA[
I understand the issue. I don’t know why it works in previous versions, lol. The issue is that this script forces the item to be reloaded, and bindings to be evaluated again, and it loops this way forever until a stack overflow.
Fortunately I have a fix for this problem.
]]>
< ![CDATA[
Using the item resume event should be well enough to update the icon. You can use this event instead of the binding to make it work decently well until the next update.
]]>
< ![CDATA[
Pierre Hébert I can wait for the update.. Thank you
]]>
< ![CDATA[
I think it will come soon anyway
]]>
< ![CDATA[
Pierre Hébert tried to run on Resumed event
I had to replace $ll_day by calendar thing, here no issue, but last instruction saying error
item.setCustomIcon(icon); item not defined
Must I getItem here ?
]]>
< ![CDATA[
Yes, it should be getEvent().getItem().
When using bindings, there is no event, and the script must return immediately (no way to display an alert for instance), hence the reason for the “item” parameter being used differently.
But don’t spend too much time on this, I’m going to build new packages and push them to the play store.
]]>
< ![CDATA[
Pierre Hébert could you recheck the variables backup and restore ? I’ve lost some variables after a restore
]]>
< ![CDATA[
Is it reproducible?
]]>
< ![CDATA[
Pierre Hébert I’ll recheck. No hurry if nothing evident for you.
I succedded in resumed script but first I had a reboot lol
]]>
< ![CDATA[
Pierre Hébert finally not.
The icon is changed but Resumed event not saved.
So waiting the update
]]>
< ![CDATA[
The only way I see for a variable to be erased is when its value is null, but I don’t think this is the case of course.
]]>
< ![CDATA[
Pierre Hébert sure. I”ll prepare a new test here
]]>
< ![CDATA[
Pierre Hébert now fine. So I’ll check more in detail later
]]>
< ![CDATA[
ok
]]>