Page 1 of 2

Text instead of image for notification on status bar

Posted: 11 Mar 2019 17:31
by jmckeejr
Is it possible to use text instead of images for notification on status bar image?

Re: Text instead of image for notification on status bar

Posted: 11 Mar 2019 21:32
by ariloc
I think you can't, as it's not a feature in Android as long as I'm aware. If you want something like a letter or two as an icon of a certain notification, you can make or search for an image of it and use a custom image in the Automagic action, as long as it has a trasnparent background, because otherwise it will bw shown as a white square. I've seen apps like Ampere show battery percentage as a number in the statusbar and I'm pretty sure they work by including an image for each number from 1 to 100 inside the app, and when it changes, the app changes the notification icon.

Re: Text instead of image for notification on status bar

Posted: 11 Mar 2019 23:54
by anuraag
jmckeejr wrote:Is it possible to use text instead of images for notification on status bar image?
What is length of text? Give an example.
ariloc wrote:I've seen apps like Ampere show battery percentage as a number in the statusbar and I'm pretty sure they work by including an image for each number from 1 to 100 inside the app, and when it changes, the app changes the notification icon.
Some apps generate images before updating notification by using android apis.

Re: Text instead of image for notification on status bar

Posted: 13 Mar 2019 08:08
by jmckeejr
anuraag wrote:
jmckeejr wrote:Is it possible to use text instead of images for notification on status bar image?
What is length of text? Give an example.
ariloc wrote:I've seen apps like Ampere show battery percentage as a number in the statusbar and I'm pretty sure they work by including an image for each number from 1 to 100 inside the app, and when it changes, the app changes the notification icon.
Some apps generate images before updating notification by using android apis.
I would like to show current temp which would be a total of up to 4 characters (though usually only 3). I had read its possible to convert text to bitmap on android via "canvas", but is not currently an option on automagic I think.

Re: Text instead of image for notification on status bar

Posted: 13 Mar 2019 08:12
by anuraag
jmckeejr wrote:I had read its possible to convert text to bitmap on android via "canvas", but is not currently an option on automagic I think.
Its possible in Automagic using java functions.

I have a flow which creates images using text provided. You can use that flow to create image. Later use Automagic action to show that in notification.

Re: Text instead of image for notification on status bar

Posted: 13 Mar 2019 08:38
by Desmanto
You can design a widget you want as the icon, design the text. Then in each changes, set the widget text to the temperature and use action Save Widget to Image File. Then use that image as the notification icon. This essentially create the icon on the fly. However if your flow trigger a lot, there will be more write cycle to the eMMC, leading to a faster breakdown, end of life of the internal storage.

If the text choice is limited, I prefer to prepare the set of the icon, let say 100 icons correspond to each temperature, using map object. Then You only need to change the notification icon based on the temperature. No need to write image file again, only read operation. This will reduce unnecessary write to the eMMC. Although using Save Widget to Image file with small icon only takes up small write cycle, I prefer to make it the best practice to avoid excessive write when not needed.

Re: Text instead of image for notification on status bar

Posted: 13 Mar 2019 14:42
by jmckeejr
anuraag wrote:
jmckeejr wrote:I had read its possible to convert text to bitmap on android via "canvas", but is not currently an option on automagic I think.
Its possible in Automagic using java functions.

I have a flow which creates images using text provided. You can use that flow to create image. Later use Automagic action to show that in notification.
Would like to see that. I have made found 130 images that work but I would like test other ideas

Re: Text instead of image for notification on status bar

Posted: 13 Mar 2019 14:56
by anuraag
Here you go. I have set value here 114° for example and set image to save in Automagic folder with name weatherIcon.png.

I use slightly different code in my flow where i don't save the image. Instead use java code to directly create a notification.

https://drive.google.com/file/d/15tRcFI ... p=drivesdk

Re: Text instead of image for notification on status bar

Posted: 13 Mar 2019 19:11
by jmckeejr
Thanks very interesting, will keep for future. I went with the widget to image method so I can use custom fonts (well I actually made single choice input with 3 option of ways to do it).

Re: Text instead of image for notification on status bar

Posted: 13 Mar 2019 22:57
by anuraag
Custom fonts also possible with little changes in script.

Fonts you have created looks very small here. You should have made it in 96px.