Skip to content

Commit 77c3d02

Browse files
committed
fix: translate locale, sticker LRU trim, composer CAPS_LOCK case
Translate quick-action now reads the user's preferred target locale from TranslationLanguagePackManager instead of hardcoding "en". Sticker bitmap LRU cache (64 entries, up to ~64 MB) now evicts on system memory pressure via onTrimMemory in FlorisImeService. Composer WithRules case conversion now uses per-character uppercaseChar() instead of String.uppercase(), preserving character count under CAPS_LOCK (e.g. ß → ẞ instead of "SS"). Stream leak items removed from roadmap — both store methods already wrap the input stream in .use {}. HoneycombHexButton palette item removed — production honeycomb uses the themed TextKeyButton path; the standalone widget is test-only.
1 parent a4cee67 commit 77c3d02

8 files changed

Lines changed: 29 additions & 13 deletions

File tree

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SwiftFloris
22

3-
![Version](https://img.shields.io/badge/version-v1.9.42-blue) ![License](https://img.shields.io/badge/license-Apache%202.0-green) ![Platform](https://img.shields.io/badge/platform-Android%208.0+-orange) ![Network](https://img.shields.io/badge/network-none-lightgrey) ![Dictionary imports](https://img.shields.io/badge/dictionary%20imports-local%20files-green)
3+
![Version](https://img.shields.io/badge/version-v1.9.43-blue) ![License](https://img.shields.io/badge/license-Apache%202.0-green) ![Platform](https://img.shields.io/badge/platform-Android%208.0+-orange) ![Network](https://img.shields.io/badge/network-none-lightgrey) ![Dictionary imports](https://img.shields.io/badge/dictionary%20imports-local%20files-green)
44

55
**SwiftFloris** is a privacy-first Android keyboard, forked from FlorisBoard and pushed toward SwiftKey-class multilingual typing without the cloud. It ships under Apache-2.0, holds no `INTERNET` permission, and binds zero accounts.
66

@@ -37,7 +37,7 @@
3737
3838
## Highlights
3939

40-
| Area | What's in v1.9.42 | Privacy posture |
40+
| Area | What's in v1.9.43 | Privacy posture |
4141
|------|-------------------|-----------------|
4242
| **Autocorrect / prediction** | SCOWL 117k English dictionary, heap-bounded SymSpell d1+d2, bigram + trigram next-word, capitalization-aware completions, contraction handling, instant-remember user-dictionary overlay | On-device |
4343
| **Multilingual typing** | Bilingual subtype presets (EN+ES / EN+FR / EN+DE), per-token Latin language identification, top-two straddle guard, sentence-local context scoring, opt-in remembered keyboard language per app, and stale-id-safe manual subtype switching | On-device |
@@ -304,6 +304,7 @@ Current SM-S938B / Android 16 baselines record `am start -W` first-render median
304304

305305
The full public release stream lives on [GitHub Releases](https://github.com/SysAdminDoc/SwiftFloris/releases).
306306

307+
- **v1.9.43** (2026-06-13) — Translate quick-action now reads the user's preferred target locale instead of hardcoding English. Sticker bitmap LRU cache now trims on system memory pressure. Composer WithRules case conversion now preserves character count under CAPS_LOCK.
307308
- **v1.9.42** (2026-06-13) — Deep audit pass 2: sticker bitmap downsampling now keys on longest edge (prevents OOM on wide/tall stickers), space-bar swipe-up NO_ACTION no longer swallows the gesture, clipboard restore no longer crashes on image/video items with null URIs, numeric/phone mode keys no longer consume manual shift state.
308309
- **v1.9.41** (2026-06-12) — Android 17 adaptive IME validation now covers sw600 foldable/tablet sizing, split/floating window clipping, no large-screen manifest opt-out, and phone/tablet/foldable emulator smoke lanes.
309310
- **v1.9.40** (2026-06-12) — Pending F40 Roborazzi settings and keyboard-surface screenshots are now active visual gates, with committed baselines for AI features, voice input, MCP settings, typing stats, honeycomb, and glide trail surfaces.
@@ -508,7 +509,7 @@ limitations under the License.
508509

509510
## Status
510511

511-
🚀 **Active development.** Current release: **v1.9.42** (2026-06-13). The SwiftKey account export window closed on **2026-05-31**; local/on-device migration paths remain documented above.
512+
🚀 **Active development.** Current release: **v1.9.43** (2026-06-13). The SwiftKey account export window closed on **2026-05-31**; local/on-device migration paths remain documented above.
512513

513514
---
514515

app/src/main/kotlin/dev/patrickgold/florisboard/FlorisImeService.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,13 @@ class FlorisImeService : LifecycleInputMethodService() {
501501
themeManager.configurationChangeCounter.update { it + 1 }
502502
}
503503

504+
override fun onTrimMemory(level: Int) {
505+
super.onTrimMemory(level)
506+
if (level >= android.content.ComponentCallbacks2.TRIM_MEMORY_BACKGROUND) {
507+
dev.patrickgold.florisboard.ime.media.sticker.evictStickerBitmapCache()
508+
}
509+
}
510+
504511
override fun onDestroy() {
505512
// Run our cleanup BEFORE super.onDestroy() — the lifecycle scope is
506513
// cancelled by super and any callbacks scheduled on it would be

app/src/main/kotlin/dev/patrickgold/florisboard/ime/media/sticker/StickerPaletteView.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ private const val STICKER_BITMAP_CACHE_SIZE = 64
126126
private val stickerBitmapCache: androidx.collection.LruCache<String, ImageBitmap> =
127127
androidx.collection.LruCache(STICKER_BITMAP_CACHE_SIZE)
128128

129+
fun evictStickerBitmapCache() {
130+
stickerBitmapCache.evictAll()
131+
}
132+
129133
@Composable
130134
fun StickerPaletteView(
131135
modifier: Modifier = Modifier,

app/src/main/kotlin/dev/patrickgold/florisboard/ime/smartbar/quickaction/QuickAction.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,8 @@ sealed class QuickAction {
8282
* When the addon IS installed, the translated text is committed
8383
* back to the editor in place of the selection.
8484
*
85-
* The source/target locale pair is read from
86-
* `prefs.translate.sourceLocale` + `prefs.translate.targetLocale`
87-
* (defaults `auto` + `en`).
85+
* The target locale is read from the user's preferred target in
86+
* [TranslationLanguagePackManager], falling back to `"en"`.
8887
*/
8988
@Serializable
9089
@SerialName("translate_selection")
@@ -96,7 +95,8 @@ sealed class QuickAction {
9695
val translator = dev.patrickgold.florisboard.ime.translate
9796
.InlineTranslatorRegistry.active
9897
val sourceLocale = "auto"
99-
val targetLocale = "en"
98+
val targetLocale = dev.patrickgold.florisboard.ime.translate
99+
.TranslationLanguagePackManager.preferredTargetLocale() ?: "en"
100100
when (val result = translator.translate(raw, sourceLocale, targetLocale)) {
101101
is dev.patrickgold.florisboard.ime.translate.TranslationResult.Translated -> {
102102
editorInstance.commitText(result.translatedText)

app/src/main/kotlin/dev/patrickgold/florisboard/ime/text/composing/Composer.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,12 @@ class WithRules(
7979
if (str.lowercase().endsWith(key)) {
8080
val value = rules.getValue(key)
8181
val firstOfKey = str.takeLast(key.length).take(1)
82-
return (key.length - 1) to (if (firstOfKey.uppercase() == firstOfKey) value.uppercase() else value)
82+
val cased = if (firstOfKey.uppercase() == firstOfKey) {
83+
String(CharArray(value.length) { value[it].uppercaseChar() })
84+
} else {
85+
value
86+
}
87+
return (key.length - 1) to cased
8388
}
8489
}
8590
return 0 to toInsert

app/src/main/kotlin/dev/patrickgold/florisboard/ime/text/keyboard/HoneycombHexButton.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ import dev.patrickgold.florisboard.lib.compose.DynamicFontScale
5757
* @param modifier outer modifier — the caller supplies width/height
5858
* + position; the hex inscribes into whatever box it gets.
5959
* @param backgroundColor backdrop fill when idle.
60-
* @param pressedBackgroundColor backdrop fill while the pointer is
61-
* down. Snygg-themed values flow through this once the
62-
* TextKeyboardLayout integration lands.
60+
* @param pressedBackgroundColor backdrop fill while the pointer is down.
6361
* @param textColor label foreground.
6462
*/
6563
@Composable
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Translate quick-action reads user's preferred target locale instead of hardcoding English. Sticker bitmap LRU cache trims on system memory pressure. Composer case conversion preserves character count under CAPS_LOCK (e.g. ß → ẞ instead of SS).

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ projectMinSdk=26
1515
projectTargetSdk=36
1616
projectCompileSdk=36
1717

18-
projectVersionCode=2091
19-
projectVersionName=1.9.42
18+
projectVersionCode=2092
19+
projectVersionName=1.9.43

0 commit comments

Comments
 (0)