Text instead of image for notification on status bar
Moderator: Martin
Text instead of image for notification on status bar
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
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
What is length of text? Give an example.jmckeejr wrote:Is it possible to use text instead of images for notification on status bar image?
Some apps generate images before updating notification by using android apis.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.
Re: Text instead of image for notification on status bar
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.anuraag wrote:What is length of text? Give an example.jmckeejr wrote:Is it possible to use text instead of images for notification on status bar image?
Some apps generate images before updating notification by using android apis.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.
Re: Text instead of image for notification on status bar
Its possible in Automagic using java functions.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.
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.
Last edited by anuraag on 13 Mar 2019 10:18, edited 1 time in total.
Re: Text instead of image for notification on status bar
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.
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.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: Text instead of image for notification on status bar
Would like to see that. I have made found 130 images that work but I would like test other ideasanuraag wrote:Its possible in Automagic using java functions.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.
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
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
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
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
Custom fonts also possible with little changes in script.
Fonts you have created looks very small here. You should have made it in 96px.
Fonts you have created looks very small here. You should have made it in 96px.