Skip to content

add notify skill#343

Merged
Stypox merged 21 commits into
DicioTeam:masterfrom
billy-thegreat:master
Feb 18, 2026
Merged

add notify skill#343
Stypox merged 21 commits into
DicioTeam:masterfrom
billy-thegreat:master

Conversation

@billy-thegreat
Copy link
Copy Markdown
Contributor

This pull request adds a new notification skill. Still working on exposing metadata like source (e.g., text message, email) to the user. Future PRs will improve UI by creating distinction between notifications and improving spoken strings and input sentences.

@Stypox
Copy link
Copy Markdown
Collaborator

Stypox commented Oct 2, 2025

Thank you! I rebased the changes on master, but now I can't push to your branch because you disallowed it, so for now I pushed them here. Could you close this Pull Request and open another one, and leave the following checkbox ticked when you open it?

image

Comment thread app/src/main/res/values/strings.xml Outdated
Comment thread app/src/main/kotlin/org/stypox/dicio/skills/notify/NotifyHandler.kt Outdated
Comment thread app/src/main/kotlin/org/stypox/dicio/skills/notify/NotifyHandler.kt Outdated
Comment thread app/src/main/sentences/skill_definitions.yml
Comment thread app/build.gradle.kts Outdated
Comment thread fastlane/metadata/android/en-US/full_description.txt Outdated
Comment thread app/src/main/res/drawable/bell_notification_ui.xml Outdated
Comment thread app/src/main/kotlin/org/stypox/dicio/skills/notify/NotifyHandler.kt Outdated
Copy link
Copy Markdown
Collaborator

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following two comments are in response to

Is an empty string in the UI okay with you?

Comment on lines +41 to +50
var appName: String
try {
val pm: PackageManager = packageManager
val ai = pm.getApplicationInfo(statusBarNotification.packageName, 0)
appName = pm.getApplicationLabel(ai).toString()
}
catch(e: Exception) {
e.printStackTrace()
appName = getString(R.string.appName_error)
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var appName: String
try {
val pm: PackageManager = packageManager
val ai = pm.getApplicationInfo(statusBarNotification.packageName, 0)
appName = pm.getApplicationLabel(ai).toString()
}
catch(e: Exception) {
e.printStackTrace()
appName = getString(R.string.appName_error)
}
val appName = try {
val pm: PackageManager = packageManager
val ai = packageManager.getApplicationInfo(statusBarNotification.packageName, 0)
pm.getApplicationLabel(ai).toString()
} catch (e: Exception) {
Log.e(TAG, "Could not get app name", e)
""
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the Try-catch block in the new-skill-notify branch, setting appName to null, and handling it with a new string in getSpeechOutput() and GraphicalOutput()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okok, that's cool thanks!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please push the code here so I can review the latest version (you just need git checkout master, then git merge new-skill-notify and finally git push).

Comment on lines +14 to +27
var response = ""
if (notifications.isNotEmpty()) {
notifications.forEachIndexed { index, notification ->
val speechPart = ctx.getString(R.string.skill_notify_message, notification.appName, notification.message ?: "")
response += speechPart
if (notifications.size > 1 && index < notifications.size - 1) {
response += ". "
}
}
}
else {
response = ctx.getString(R.string.no_notifications)
}
return response.trim()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var response = ""
if (notifications.isNotEmpty()) {
notifications.forEachIndexed { index, notification ->
val speechPart = ctx.getString(R.string.skill_notify_message, notification.appName, notification.message ?: "")
response += speechPart
if (notifications.size > 1 && index < notifications.size - 1) {
response += ". "
}
}
}
else {
response = ctx.getString(R.string.no_notifications)
}
return response.trim()
val notificationsStrings = notifications.mapNotNull { notification ->
if (notification.message.isNullOrEmpty()) {
if (notification.appName.isEmpty()) {
null
} else {
ctx.getString(R.string.skill_notify_message_app, notification.appName)
}
} else {
if (notification.appName.isEmpty()) {
ctx.getString(R.string.skill_notify_message_app, notification.message)
} else {
ctx.getString(R.string.skill_notify_message, notification.appName, notification.message)
}
}
}
if (notificationsStrings.isEmpty()) {
return ctx.getString(R.string.no_notifications)
} else {
return notificationsStrings.joinToString(". ")
}

Copy link
Copy Markdown
Collaborator

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I made the last polishing steps myself, and I think this is now ready. Here is a screenshot:

Image

@Stypox Stypox merged commit 636f57a into DicioTeam:master Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants