Page 1 of 1

How to get an image into a widget

Posted: 31 Jan 2021 15:33
by Wibbly
Still using and tweaking my flows :-) Long live AM!
I have an icon that appears in a notification (Spotify album cover) and I want it to display in a widget. It doesn't seem I can pass it into a widget as a global variable as global variables can't contain images, right?

So is my only option to write the image to a file, and refer to the file in the widget? In an ideal world I'd rather keep it all in memory and not keep writing and overwriting the file - is this possible (to avoid file writing by keeping it in memory)?

Re: How to get an image into a widget

Posted: 05 Apr 2021 13:22
by digitalstone
I have a weather widget, in where i'm using an icon.
That icon is one of many inside a folder on my phone.
I simply tell with the setWidgetElementProperty function what the filepath of that icon should be.
refreshWidget if necessary.