Adds a small `:translate` Gradle module that translates received SMS / MMS bubbles and conversation-list snippets on the fly by binding to the offline-translator app on F-Droid (`dev.davidv.translator`). The actual translation runs there — Mozilla Bergamot/Marian on-device — so this patch ships no model, no inference, and no permissions beyond an Android 11+ <queries> block for package visibility. Behavior: - User-defined source-language allowlist + target language in Settings → Translation (right after Language). Off by default. - Auto-translate fires on RecyclerView bind for received bubbles and conversation snippets. Detection uses ML Kit Language Identification (CLD3, on-device). Once dev.davidv.translator exposes a detectLanguage() AIDL method we'll route through that and drop ML Kit. - AIDL latency is sub-second, so the bubble just quietly swaps from the original to the translation — no loading spinner. - Tap the translate icon next to a bubble to flip it back to the original; tap again to flip to the translation. Cached in process memory. - Long-press → ⋮ → Translate forces a one-off translation regardless of the allowlist (useful for messages in non-allowlisted languages), with a toast surfacing AIDL errors like 'language pack not installed'. - Copy / Share / Select on a translated bubble captures what the user sees, not the underlying source body. - Silently no-ops when offline-translator isn't installed; settings screen shows an F-Droid install banner. - Translation Settings is a regular Fossify sub-screen with MyAppBarLayout + MaterialToolbar + NestedScrollView, matching Manage Blocked Numbers / Keywords / SettingsActivity. No new database, no service, no boot receiver, no foreground service. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
68 lines
2.7 KiB
TOML
68 lines
2.7 KiB
TOML
[versions]
|
|
#jetbrains
|
|
kotlin = "2.3.21"
|
|
kotlinxSerializationJson = "1.11.0"
|
|
#KSP
|
|
ksp = "2.3.7"
|
|
#Detekt
|
|
detekt = "1.23.8"
|
|
detektCompose = "0.4.28"
|
|
#AndroidX
|
|
androidx-constraintlayout = "2.2.1"
|
|
androidx-swiperefreshlayout = "1.2.0"
|
|
androidx-lifecycleprocess = "2.10.0"
|
|
androidx-documentfile = "1.1.0"
|
|
#Eventbus
|
|
eventbus = "3.3.1"
|
|
#Room
|
|
room = "2.8.4"
|
|
#Fossify
|
|
commons = "6.1.6"
|
|
mmslib = "1.0.0"
|
|
indicator-fast-scroll = "4524cd0b61"
|
|
#Gradle
|
|
gradlePlugins-agp = "9.2.0"
|
|
#build
|
|
app-build-compileSDKVersion = "36"
|
|
app-build-targetSDK = "36"
|
|
app-build-minimumSDK = "26"
|
|
app-build-javaVersion = "VERSION_17"
|
|
app-build-kotlinJVMTarget = "17"
|
|
#Helpers
|
|
ez-vcard = "0.12.2"
|
|
#ML Kit (transitional language identification — removed once dev.davidv.translator exposes detectLanguage via AIDL)
|
|
mlkit-language-id = "17.0.6"
|
|
[libraries]
|
|
#AndroidX
|
|
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "androidx-constraintlayout" }
|
|
androidx-lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", version.ref = "androidx-lifecycleprocess" }
|
|
androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "androidx-swiperefreshlayout" }
|
|
androidx-documentfile = { module = "androidx.documentfile:documentfile", version.ref = "androidx-documentfile" }
|
|
#Room
|
|
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" }
|
|
androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "room" }
|
|
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" }
|
|
#Compose
|
|
compose-detekt = { module = "io.nlopez.compose.rules:detekt", version.ref = "detektCompose" }
|
|
#Fossify
|
|
fossify-commons = { module = "org.fossify:commons", version.ref = "commons" }
|
|
indicator-fast-scroll = { module = "org.fossify:IndicatorFastScroll", version.ref = "indicator-fast-scroll" }
|
|
mmslib = { module = "org.fossify:mmslib", version.ref = "mmslib" }
|
|
#EventBus
|
|
eventbus = { module = "org.greenrobot:eventbus", version.ref = "eventbus" }
|
|
#Helpers
|
|
ez-vcard = { module = "com.googlecode.ez-vcard:ez-vcard", version.ref = "ez-vcard" }
|
|
#ML Kit
|
|
mlkit-language-id = { module = "com.google.mlkit:language-id", version.ref = "mlkit-language-id" }
|
|
#Kotlin
|
|
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" }
|
|
[bundles]
|
|
room = [
|
|
"androidx-room-ktx",
|
|
"androidx-room-runtime",
|
|
]
|
|
[plugins]
|
|
android = { id = "com.android.application", version.ref = "gradlePlugins-agp" }
|
|
kotlinSerialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
|
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
|
|
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
|