Text instead of image for notification on status bar

Post your questions and help other users.

Moderator: Martin

jmckeejr
Posts: 34
Joined: 03 May 2015 12:29

Text instead of image for notification on status bar

Post by jmckeejr » 11 Mar 2019 17:31

Is it possible to use text instead of images for notification on status bar image?

ariloc
Posts: 109
Joined: 05 Jun 2016 21:36

Re: Text instead of image for notification on status bar

Post by ariloc » 11 Mar 2019 21:32

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.

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Re: Text instead of image for notification on status bar

Post by anuraag » 11 Mar 2019 23:54

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.

jmckeejr
Posts: 34
Joined: 03 May 2015 12:29

Re: Text instead of image for notification on status bar

Post by jmckeejr » 13 Mar 2019 08:08

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.

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Re: Text instead of image for notification on status bar

Post by anuraag » 13 Mar 2019 08:12

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.
Last edited by anuraag on 13 Mar 2019 10:18, edited 1 time in total.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Text instead of image for notification on status bar

Post by Desmanto » 13 Mar 2019 08:38

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.
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.

jmckeejr
Posts: 34
Joined: 03 May 2015 12:29

Re: Text instead of image for notification on status bar

Post by jmckeejr » 13 Mar 2019 14:42

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

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Re: Text instead of image for notification on status bar

Post by anuraag » 13 Mar 2019 14:56

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

jmckeejr
Posts: 34
Joined: 03 May 2015 12:29

Re: Text instead of image for notification on status bar

Post by jmckeejr » 13 Mar 2019 19:11

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).

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Re: Text instead of image for notification on status bar

Post by anuraag » 13 Mar 2019 22:57

Custom fonts also possible with little changes in script.

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

Post Reply