“Material Folders” script is done!

“Material Folders” script is done!

Download from here: http://goo.gl/S1Scji

Easiest way to use?

– Download and install APK

– “Load script” to install the scripts

– Run “Create” script on desktop to create, configure and event-wire the folder

– Done!

This way makes it simple to also update scripts when I post updates.

Long-tap on folder icon to change color or open effect settings (choose effect, change speed, smoothness and more).

Icon is font-based, change it by editing the folder item’s label. Will be synced automatically to icon in folder’s header. I quickly put together a simple font “Material Folder Icons” with icomoon to get you started. See cheatsheet for icon’s letters.

Enjoy!

EDIT: When looking at the scripts, be prepared (in Settings and ColorPicker) to see LOTS of Android/Java objects being used. Made me eager to probably try to developing Android apps.

]]>

27 Commentsto “Material Folders” script is done!

  1. Anonymous says:

    < ![CDATA[

    Now that’s the f’n bomb Lutz 😁😁😁👍👍👍

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Wow!

    ]]>

  3. Anonymous says:

    < ![CDATA[

    I agree, Lightning is a great way to get from simple scripting to complex Java applications. Great work BTW.



    Just one thing I would add: You could ‘hack’ into LL’s UI and add your folder to the ‘add’ menu instead of loading by script.

    ]]>

  4. Anonymous says:

    < ![CDATA[

    Wooow awesome!!

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Lukas Morawietz I remember you posted a sample. Will search and try. Great idea!

    ]]>

  6. Anonymous says:

    < ![CDATA[

    Sweet! Thank you.

    ]]>

  7. Anonymous says:

    < ![CDATA[

    Awesome! Can I reduce size of opened folder?

    ]]>

  8. Anonymous says:

    < ![CDATA[

    Sergej Babaitsev Sure you can.


    Option 1: in Create script change the defaults at lines 56 (I chose 0.8 = 80% of desktop and 6×8 grid)


    Option 2: for already created folder, enter edit mode on desktop, highlight folder icon, then tap the 3-lines-icon at the bottom to open folder’s settings and change the values for “Current folder” and maybe layout.



    Be aware that for option 2 you might have to restart LL or open and close the folser 2 or 3 times so all dependent calculated values are adjusted; probably also use Color Picker (long tap) so the background images are properly recreated.



    …so I recommend changing the defaults in the script 😉

    ]]>

  9. Anonymous says:

    < ![CDATA[

    Congratulations Lutz. You are always great with your script!

    ]]>

  10. Anonymous says:

    < ![CDATA[

    Wow. Really impressed!

    ]]>

  11. Anonymous says:

    < ![CDATA[

    Ryan Kezman​, dude, did you read any of the previous comments? Like 2 above yours?

    ]]>

  12. Anonymous says:

    < ![CDATA[

    Joern Rapsky That should work… At least back key works.

    ]]>

  13. Anonymous says:

    < ![CDATA[

    Ryan Kezman What did you change? Defaults in creats script? Then create another folder. If you changed the size (the absolute values like 864×1326 for me based on 80% default) either restart LL (shortcut to that LL action) or open and close 2 or 3 times.

    ]]>

  14. Anonymous says:

    < ![CDATA[

    Joern Rapsky Checked. You are right. Home key just causes folder to pause and resume, so basically restarts the animation. That is a strange behaviour. Setting the “Home key” event to “Close all open folders” works, but seems not appropriate. Folders don’t have an event “Home key”, only Desktop has this.



    Changing behaviour in Desktop setting’s “Extra folder options” (only one folder; close after launch) did not help either.



    As a workaround you can add in the “Effect”-script right before the Java imports (LL.bindClass stuff) the following line:


    if (iFld.isOpen()) { iFld.close(); return; }


    Pause and resume caused by Home key then closes the folder. But it has an annoying side effect: also editing something inside the open folder causes pause and resume when ending edit mode — which means the folder closes.



    Pierre Hébert Is it intended that Home key does not close folders? I would’ve thought so. It does only i.e. scroll back the desktop to home location. I think this is a bug.



    EDIT: Yes, the different behaviour Home vs Back seems to somewhat correspond with how Android handles apps (Back: close app; Home: leave app running, just switch to launcher), but I think it should be handled differently in this case.

    ]]>

  15. Anonymous says:

    < ![CDATA[

    This is because Home really pauses and resumes Lightning. The issue is that the Home key cannot be caught by any apps. A launcher can detect it only when it is set as the default launcher: it is suspended and resumed very quickly. Lightning assumes that if pause/resume events happen in a 500ms timeframe, then this is a Home key.


    At the moment the default action set for the home key doesn’t close folders because back does. This is just a matter of default configuration and I am reluctant to change this because it would affect existing setups.

    ]]>

  16. Anonymous says:

    < ![CDATA[

    Ryan Kezman Haven’t tried long-tapping on folder icon? That brings up the color palette dialog. Or do you mean the white background? That’s (as of now) hard coded in effect script, sorry.

    ]]>

  17. Anonymous says:

    < ![CDATA[

    Ryan Kezman If you want to choose a non-palette color… it’s there… just change in SetColor script “allowCustomCol=false” to true and long-tap again. You’ll be asked wether you want a custom color.

    ]]>

  18. Anonymous says:

    < ![CDATA[

    Lutz Linke​​ sorry for tagging you here, there and everywhere! Is it possible to remove the folder PNG/icon from the folder in this screenshot? https://www.dropbox.com/s/lt2d46owcminlqj/IMG_20150424_220136.jpg?dl=0 and is it possible to close the folder after launching an app? when returning to home screen the folder opens up again. Great work though and thanks..


    Edit. Figured out the first part, it was the folder label being displayed as an icon.. 😊

    ]]>

  19. Anonymous says:

    < ![CDATA[

    Adam Caine Yes, folder icon is font-based. Just editing the label helps.



    Have to think about the second part. Would require to intercept tap on item in folder, close folder and launch shortcut’s intent.

    ]]>

  20. Anonymous says:

    < ![CDATA[

    Joern Rapsky Difficult. What if a user is actively i.e. adding shortcuts? Timeout would’ve need stopping, restarting etc. I need to think about it. Have an idea. Little time this weekend, though. Maybe tonight.

    ]]>

  21. Anonymous says:

    < ![CDATA[

    Hi.


    First, thank you for these scripts- they make folders look amazing.


    I have a zooper widget inside a folder with shortcuts to Media Utilities actions (Play/Pause, Previous, Next). I use it as my music widget. Every time i press a shortcut, the folder is being redrawn. No application is being started, only Play action is fired, and the effect is that the whole folder is redrawn. Is there any possibility to not redraw the folder when action shortcut is pressed?

    ]]>

  22. Anonymous says:

    < ![CDATA[

    Piotr Trzęsicki yes, there is. Just add the following lines after the “Folder not found”-if:



    if (iFld.isOpen() || evtSrc!=”C_RESUMED”) {


    return;


    }



    This prevents redraw when folder is paused and resumed.

    ]]>

  23. Anonymous says:

    < ![CDATA[

    Hello Lutz Linke, thank tou for the awesome script.


    I have a question, how can we change or remove the folder symbol? I guess is somewhere there:



    var setBlankIcon=function(item,w,h){


      var imgIcon=item.getDefaultIcon();


      if(imgIcon==null) {


        var iconSize=Math.min(w,h);


        imgIcon=LL.createImage(iconSize,iconSize);


      }


      var cvsIcon=imgIcon.draw();


      cvsIcon.drawColor(0x00000000,PorterDuff.Mode.SRC);


      item.setCustomIcon(imgIcon);


      // Persist changes


      LL.save();


    }



    I know basic JS and maybe I can figure something out.

    ]]>

  24. Anonymous says:

    < ![CDATA[

    Nilton Formis What the script does: set the folder icon to a black image, use the label (one character) a icon-font-based icon. So there are two ways:


    1) If you want to use an image-based icon, set an empty string as label and choose your icon image.


    2) The preferred way would be to use an icon-font (default is LL’s internal font, in my Box there is another one with image containing all included icons) and simply change the label text/character.



    BTW: change the font and label of the folder shortcut/button, this is automatically copied to the header when opening the folder.

    ]]>

  25. Anonymous says:

    < ![CDATA[

    Got that, thank you Lutz Linke!

    ]]>

  26. Anonymous says:

    < ![CDATA[

    Lutz Linke


    I tried to add those lines to MatFldRipple_Effect script (the only place where I found “Folder not found” string), but it didn’t worked out. Folder is still redrawn after pressing shortcut (both existing and new created folders).


    Maybe I did something wrong? I edited the script in ScriptEditor app, but didn’t find any save option. Maybe this is the point? 



    PT



    [Edit]


    Sorry, I missed one bracket and put the lines into the block you’ve mentioned. I corrected it and now it works.

    ]]>

  27. Anonymous says:

    < ![CDATA[

    I just saw this script, awesome work. Thank you for sharing!

    ]]>

Leave a Reply

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