Page 1 of 1

Wallpaper changer

Posted: 26 Mar 2015 13:30
by Ankit
Hi
I recently downloaded the wallpaper changer from catalogue..

I have 200 wallpaper on my folder.
I want that if a wallpaper is set then it should not repeat until each and every wallpaper is set.

Re: Wallpaper changer

Posted: 26 Mar 2015 19:57
by Martin
Hi,

You could store the file list in a global variable once, pick a random element from the global list to show the wallpaper and remove this element from the global list.
The list will get shorter every time you display a new image. You could initialize the global list again when the global list becomes empty.

Regards,
Martin

Re: Wallpaper changer

Posted: 27 Mar 2015 03:34
by Ankit
Hi,

But how would global variable determine if we have added new file or deleted a file....

Re: Wallpaper changer

Posted: 27 Mar 2015 11:37
by MURTUMA
It should throw an error when file does not exist. You can handle this by exeption connection, which you should loop back so the flow repeats the wallpaper picking process until it finds a file that exists.

Another way would be by a second flow, which observes the relevant folder and after changes either adds or removes new/deleted files to the list.

The first option can't handle added files and removed files gets deleted, when you next time init the file list. That's why I would recommend the second option.

Re: Wallpaper changer

Posted: 29 Mar 2015 14:34
by Ankit
Hi
I tried to make the flow but I was not successful..

It add the whole list again and again whenever I change the wallpaper...

http://automagic4android.com/flow.php?i ... 9684d1a5a5


Please help !!