android_notify
android_notify copied to clipboard
Auto Use a Apps Custom icon instead of default library Logo
Describe issue When user has a custom app icon use that automatically instead of Library's(kivy,flet) fallback icons
Code to Reproduce
- This issue started in v1.61.10 for kivy but it should be in all versions of Flet
Fixes
- This can be easily fixed by using
setSmallIcon, But it would be better to have a auto fix for this by an api to check if user has specified a custom icon as app logo
- checking the alpha channel will consume time
This worked
import os
from android_notify import Notification
from utils.helper import appFolder # /data/user/0/org.wally.waller/files
app_base = os.path.join(appFolder(),"app")
Notification.app_icon=os.path.join(app_base,"assets","icons","icon.png")
Then anywhere Notification class is used in the file will be the Custom Icon
import os
from android_notify import Notification
from android_notify.widgets.images import get_img_absolute_path
img_relative_path = os.path.join("assets","icons","icon.png")
Notification.app_icon = get_img_absolute_path(img_relative_path)