Notify of pokes and private messages on Android, with TeamSpeak's sounds
While the app is out of sight, a poke or a private message posts a notification; a message's one gathers the conversation, takes a reply inline and opens its chat. The notifications are silent, as the sound pack already plays TeamSpeak's own sound for either. The build bundles the sound packs of the TeamSpeak 3 client found next to the checkout (or at ts3.client.dir / TS3_CLIENT_DIR), unpacked into the profile once per app version. Sound Settings picks the pack and its volume, and speech packs talk through the phone's text-to-speech. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,47 @@ plugins {
|
||||
alias(libs.plugins.kotlin.compose)
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies the sound packs of an installed TeamSpeak 3 client into the app's assets, as the
|
||||
* desktop client borrows them from the installation. They are TeamSpeak's and not in the
|
||||
* repository; a build without the client ships no packs.
|
||||
*/
|
||||
abstract class BundleSoundPacks : DefaultTask() {
|
||||
@get:InputFiles
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
abstract val packs: DirectoryProperty
|
||||
|
||||
@get:OutputDirectory
|
||||
abstract val assets: DirectoryProperty
|
||||
|
||||
@TaskAction
|
||||
fun copy() {
|
||||
val out = assets.get().asFile
|
||||
out.deleteRecursively()
|
||||
val source = packs.get().asFile
|
||||
if (!source.isDirectory) {
|
||||
logger.warn("No TeamSpeak 3 sound packs at $source; the app ships without sounds")
|
||||
return
|
||||
}
|
||||
source.copyRecursively(File(out, "sound"))
|
||||
}
|
||||
}
|
||||
|
||||
val ts3ClientDir: String = providers.gradleProperty("ts3.client.dir")
|
||||
.orElse(providers.environmentVariable("TS3_CLIENT_DIR"))
|
||||
.getOrElse(rootDir.resolve("../TeamSpeak3-Client-linux_amd64").path)
|
||||
|
||||
val bundleSoundPacks = tasks.register<BundleSoundPacks>("bundleSoundPacks") {
|
||||
packs.set(File(ts3ClientDir, "sound"))
|
||||
assets.set(layout.buildDirectory.dir("generated/soundPacks"))
|
||||
}
|
||||
|
||||
androidComponents {
|
||||
onVariants { variant ->
|
||||
variant.sources.assets?.addGeneratedSourceDirectory(bundleSoundPacks, BundleSoundPacks::assets)
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.ts3client.android"
|
||||
compileSdk = 37
|
||||
|
||||
Reference in New Issue
Block a user