This small script try to reproduce the dynamic icon (calendar) of nova launcher.

This small script try to reproduce the dynamic icon (calendar) of nova launcher.

It will just set the custom icon of the defined item depending on the month. However it’s extremely easy to modify and perhaps it gives you ideas to another different script.

Instructions:

>Set it in the resume event of the container which has that item.

>Write the package name of the icon pack. This is not obvious and looks like com.pack.icons, you will need another app to know it. ( Pierre Hébert: will it be possible to show it in the new icon picker when long clicking the name of the icon pack? )

>Write the prefix of the 31 items containing all the different months. By default it is ‘ic_calendar_’ but it can change depending on the icon pack. Search items labeled prefix1 prefix2 prefix3 …

>Set the label of the item to identify it.

If you have another script in the resumed event you can copy this at the beginning without problem (or set it in the load event…it will only act once a month after all)

]]>

2 Commentsto This small script try to reproduce the dynamic icon (calendar) of nova launcher.

  1. Anonymous says:

    < ![CDATA[

    //This is the package name of the icon pack. It’s not something easy to know and you will need a third party app to know (or ask)


    var iconPackName = “se.vieuser.apps.bleach”;



    //This is the prefix of the icons in the package to use. the final icons are (prefix)+(month number)


    var prefixName = “ic_calendar_”;



    //This is the label of the item to put the icon to


    var labelName = “calendar”;



    var itemDynamicIcon = LL.getEvent().getContainer().getItemByLabel(labelName);



    var date=new Date(LL.getEvent().getDate());



    itemDynamicIcon.setCustomIcon(LL.createImage(iconPackName,prefixName+date.getMonth()));

    ]]>

  2. Anonymous says:

    < ![CDATA[

    I forgot about the package name but it was in the list. What I wanted is to display it, and copy it to clipboard (if possible).

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *