Hi guys

Hi guys,

There is a way to set styles to containers (through scripting obviously)?

]]>

15 Commentsto Hi guys

  1. Anonymous says:

    < ![CDATA[

    Does anyone have any ideas?


    Please, i need an answer as soon as possible.

    ]]>

  2. Anonymous says:

    < ![CDATA[

    It is the same as editing items properties (container.getProperties().edit().something().commit() )


    http://www.pierrox.net/android/applications/lightning_launcher/script/reference/net/pierrox/lightning_launcher/script/api/PropertySet.html

    ]]>

  3. Anonymous says:

    < ![CDATA[

    TrianguloY It was not what I meant xD


    For “style” i mean the entire configuration of the container (Panel Settings –> Load a style).


    Sincerely, I was so bored that I started to find a solution by myself…


    I noticed that the styles files are nothing more than a config file, and when a style is loaded LL take the content of that file and put it in the conf file of the container folder.


    So what i have to do is to read the content of the file “LL.getContext().getFilesDir()+”/themes/styleName” and write it in “LL.getContext().getFilesDir()+”/pages/”+container.id+”/conf”.


    Am I right?

    ]]>

  4. Anonymous says:

    < ![CDATA[

    That sounds as a tricky hack…I don’t know. Test it and tell us! (Remember to make a backup!!!)

    ]]>

  5. Anonymous says:

    < ![CDATA[

    God yes! It works perfectly and I succeeded on the first try!!


    Instead of read and write the content of each file I preferred to replace them with a copy of the source file.



    Just another problem is left:


    after the files have been replaced is necessary to restart LL to see the changes.


    So, how can I update the container without restart?

    ]]>

  6. Anonymous says:

    < ![CDATA[

    No idea.



    I’ll call Lukas Morawietz​, not only because he can provide an answer but also because I think he will like this ‘hack’

    ]]>

  7. Anonymous says:

    < ![CDATA[

    You can’t reload files without restarting lightning. There is no hook for that. You can restart by script with http://www.pierrox.net/android/applications/lightning_launcher/script/reference/net/pierrox/lightning_launcher/script/api/EventHandler.html#RESTART

    ]]>

  8. Anonymous says:

    < ![CDATA[

    Lukas Morawietz if it were so, then the property will not be updated in real time ever.


    There must to be a way.


    Maybe the properties are temporarily saved in memory?

    ]]>

  9. Anonymous says:

    < ![CDATA[

    Simone Boccuzzi


    of course they are. Working directly on files would be way too inefficient.

    ]]>

  10. Anonymous says:

    < ![CDATA[

    Lukas Morawietz so what i could do to apply the entire style in real time?

    ]]>

  11. Anonymous says:

    < ![CDATA[

    Simone Boccuzzi


    parse the file and set the properties via the PropertyEditor

    ]]>

  12. Anonymous says:

    < ![CDATA[

    Loooool, it’s right xD


    How could I do it exactly?

    ]]>

  13. Anonymous says:

    < ![CDATA[

    var d = JSON.parse(string-from-file);


    if(d.bgColor != null) //set background color


    etc. etc. etc.

    ]]>

  14. Anonymous says:

    < ![CDATA[

    ooook it works! But now another problem arises D:


    My style includes Normal Selected and Focused background Imgs.


    I can get their Bitmaps in this way:


    var imgNormal= new File(LL.getContext().getFilesDir()+”/themes/”+styleName+”n”).getBitmap;


    ecc…


    But where can I apply them?



    EDIT: Please, don’t  tell me I have to manually apply them to all the items D:

    ]]>

  15. Anonymous says:

    < ![CDATA[

    It should work applying the item property (“i.something”) to the container properties

    ]]>

Leave a Reply

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