Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
7311a97
chore: prepare version v4.0.0-beta1
LeanBitLab Jul 16, 2026
fc57223
docs: update issue template guidelines URL
LeanBitLab Jul 16, 2026
9a62926
docs: simplify issue templates and remove guideline URL
LeanBitLab Jul 16, 2026
3df34e2
docs: add flavor prompt to issue templates
LeanBitLab Jul 16, 2026
3b9f2c0
docs: replace HeliBoard features with Todo section
LeanBitLab Jul 16, 2026
f937d83
docs: add standardfull flavor and specify handwriting support
LeanBitLab Jul 16, 2026
b201d62
Updated README
LeanBitLab Jul 16, 2026
a779286
chore: update README badges [skip ci]
github-actions[bot] Jul 17, 2026
aab4391
fix(input): preserve Thai segmentation with text expansion
Scott-Nx Jul 17, 2026
b27722a
pref: turn off quick pin toolbar by default
LeanBitLab Jul 17, 2026
004241c
Merge pull request #290 from Scott-Nx/fix/thai-composing-word-boundaries
LeanBitLab Jul 17, 2026
4c4e210
feat: add toggle for first-word suggestions
LeanBitLab Jul 17, 2026
60a7e21
fix: correct selection deletion priority on backspace
LeanBitLab Jul 17, 2026
94e80e2
fix: use key event for selection deletion in floating mode
LeanBitLab Jul 17, 2026
e95d5ae
fix: retrieve selection via getSelectedText when IME window is hidden…
LeanBitLab Jul 17, 2026
81ccd24
fix: prevent gesture index build thread storm
LeanBitLab Jul 17, 2026
0984ea1
docs: update v4.0.0-beta1 release notes and changelog
LeanBitLab Jul 17, 2026
7a61314
fix: support variant fallback for language-only locales in dictionaries
LeanBitLab Jul 17, 2026
daed61d
docs: update v4.0.0-beta1 release notes and changelog
LeanBitLab Jul 17, 2026
5cd2876
fix: check mFirstWordPredictionEnabled toggle in setNeutralSuggestion…
LeanBitLab Jul 17, 2026
959e5dc
refactor: replace fire-and-forget threads/executors with shared insta…
LeanBitLab Jul 17, 2026
0c9d38e
chore: update README badges [skip ci]
github-actions[bot] Jul 18, 2026
620e7f7
fix(clipboard): unregister MediaStore observer when keyboard hidden
LeanBitLab Jul 18, 2026
6efa271
feat(settings): add option to show only toolbar with physical keyboard
LeanBitLab Jul 18, 2026
b91535a
perf(optimizations): optimize model preloading and guard contacts obs…
LeanBitLab Jul 18, 2026
623080f
perf(clipboard): migrate raw thread calls to ExecutorUtils thread poo…
LeanBitLab Jul 18, 2026
87a3bee
fix(dictionary): guarantee CountDownLatch countdown and catch excepti…
LeanBitLab Jul 18, 2026
c9f6425
feat(toolbar, ai): distribute expanded toolbar keys when unscrollable…
LeanBitLab Jul 18, 2026
36458c5
fix(ai): hide Groq reasoning tokens for translation and support dual …
LeanBitLab Jul 18, 2026
cc14f85
revert(ai): remove Groq reasoning_format hidden parameter while retai…
LeanBitLab Jul 18, 2026
de0b3ea
revert(ai): restore ProofreadService.kt files to pre-feature state wh…
LeanBitLab Jul 18, 2026
b3dc2a9
feat(ai): clean translation output by stripping section headers and t…
LeanBitLab Jul 18, 2026
86d29fe
fix(ai): prevent proofreading prompts from expanding into multi-parag…
LeanBitLab Jul 18, 2026
ce3dfe3
fix(memory): prevent OutOfMemoryError in ViewRootRectTracker by enabl…
LeanBitLab Jul 18, 2026
d3e4269
docs: add release notes for v4.0.0-beta2
LeanBitLab Jul 18, 2026
f394058
chore: bump version to 4.0.0-beta2
LeanBitLab Jul 18, 2026
fc7f5ff
perf: replace active MediaStore observer with on-demand screenshot check
LeanBitLab Jul 18, 2026
38674ab
fix: resolve PointerTracker NPE crash and emoji dictionary detection/…
LeanBitLab Jul 18, 2026
5936c86
fix: aggregate regional locale fallback dictionaries in DictionaryScr…
LeanBitLab Jul 18, 2026
c2473c6
docs: add release notes for v4.0.0-beta3
LeanBitLab Jul 18, 2026
dd000b8
fix: make Settings.getValues() null-safe during layout inflation
LeanBitLab Jul 18, 2026
2234599
docs: update v4.0.0-beta3 release notes with Settings inflation safet…
LeanBitLab Jul 18, 2026
5917944
fix: replace forced assertions with null-safe fallbacks in Suggestion…
LeanBitLab Jul 18, 2026
b00b866
fix(stability): apply safe null guards, JNI protections, ANR timeouts…
LeanBitLab Jul 18, 2026
565db45
chore: bump version to 4.0.0
LeanBitLab Jul 18, 2026
14951f0
docs: update v4.0.0 release notes and fastlane changelog
LeanBitLab Jul 18, 2026
ea186ec
chore: update README badges [skip ci]
github-actions[bot] Jul 19, 2026
94d9d5c
fix(keyboard): prevent NPE by defaulting sTimerProxy to TimerProxy.NULL
LeanBitLab Jul 19, 2026
e651337
release: v4.0.1
LeanBitLab Jul 19, 2026
d3e8e1b
fix(input): dynamically update InputConnection to fix launcher & long…
LeanBitLab Jul 19, 2026
f5b1856
fix(input): fallback to direct commitText when suggestions are disabl…
LeanBitLab Jul 19, 2026
98e7aa8
fix(input): restore thread-safe isConnected and clean up logs in Rich…
LeanBitLab Jul 19, 2026
cc39321
fix(input): preserve sTimerProxy and sListener across trimMemory and …
LeanBitLab Jul 19, 2026
7c71d7f
docs: add fastlane changelog 4001.txt for v4.0.1
LeanBitLab Jul 19, 2026
2d749c6
fix: paginate github releases api to count all downloads
LeanBitLab Jul 19, 2026
80e19ee
chore: update README badges [skip ci]
github-actions[bot] Jul 19, 2026
14e869c
chore: update README badges [skip ci]
github-actions[bot] Jul 20, 2026
49abc9b
feat(settings): add background services screen and memory controls
LeanBitLab Jul 20, 2026
4e8ecc3
fix(subtype): persist valid fallback to prevent repetitive log lookup…
LeanBitLab Jul 20, 2026
fcc1bc6
chore: bump version to 4.0.2 (versionCode 4002)
LeanBitLab Jul 20, 2026
6667434
feat(settings): add next-word suggestion controls and default priorit…
LeanBitLab Jul 20, 2026
7e68074
fix(dict): disable unigram fallback for history dict and fix observer…
LeanBitLab Jul 20, 2026
c1f31c8
fix(dict): gate personal dictionary unigram fallback behind mPrioriti…
LeanBitLab Jul 20, 2026
08fb2cb
fix(observers): safely track and unregister ContactsContentObserver a…
LeanBitLab Jul 20, 2026
588d6a7
fix(settings): sync background services card toggles with contacts an…
LeanBitLab Jul 20, 2026
0e4d046
fix(settings): set PREF_ENABLE_SMS_OTP_RECEIVER default to false
LeanBitLab Jul 20, 2026
387dfe8
fix(settings): unify background service status cards to use primary p…
LeanBitLab Jul 20, 2026
6129f58
fix(settings): unify SMS OTP Auto-Reader card to use PREF_AUTO_READ_O…
LeanBitLab Jul 20, 2026
e9e7bdf
fix(settings): hide Stop & Free Memory button when service card is di…
LeanBitLab Jul 20, 2026
f97f21b
style(settings): compact BackgroundServicesScreen cards and descriptions
LeanBitLab Jul 20, 2026
dba8a01
feat(settings): add immediate auto-space toggle to eliminate phantom …
LeanBitLab Jul 20, 2026
017b324
fix(input): commit suggestion and trailing space in single atomic ope…
LeanBitLab Jul 20, 2026
148f268
fix(input): call finishComposingText before committing space for imme…
LeanBitLab Jul 20, 2026
4052d53
fix(input): reset composing state and commit space after manual sugge…
LeanBitLab Jul 20, 2026
61ba113
fix(input): end batch edit and force setSelection after committing space
LeanBitLab Jul 20, 2026
98cb4a0
fix(input): clear active composing span before committing space for i…
LeanBitLab Jul 20, 2026
c407ae8
fix(perf): prevent OOM in gesture indexing and eliminate lock content…
LeanBitLab Jul 20, 2026
cf99448
fix(lifecycle): cancel gesture indexing and make dictionary closing n…
LeanBitLab Jul 20, 2026
d3da000
fix(sys): enableOnBackInvokedCallback and reset mNestLevel in RichInp…
LeanBitLab Jul 20, 2026
370c953
fix(gesture): skip buildGestureIndexAsync when gesture input is disab…
LeanBitLab Jul 20, 2026
879bcdf
refactor(gesture): temporarily disable Java gesture engine entry poin…
LeanBitLab Jul 20, 2026
8c0bee3
refactor!: completely remove Java gesture engine and its settings scr…
LeanBitLab Jul 20, 2026
c6d182b
refactor: remove Java SwipeGestureEngine while preserving native C++ …
LeanBitLab Jul 20, 2026
333d02e
refactor: completely remove Java gesture engine while preserving nati…
LeanBitLab Jul 20, 2026
1356e73
fix(settings): restore Gesture Typing screen and toggle for native C+…
LeanBitLab Jul 20, 2026
b4ca478
fix(gesture): fix native gesture library detection in JniUtils and ad…
LeanBitLab Jul 20, 2026
58c9b63
fix(sys): export ringer mode change broadcast receiver for Android 14+
LeanBitLab Jul 20, 2026
a10a62c
test: add test_keyboard_flow.py automation script for logcat audit
LeanBitLab Jul 20, 2026
624e1cf
test: update test_keyboard_flow.py coordinates for SearchScreen keybo…
LeanBitLab Jul 20, 2026
76d080d
clean: remove test python script and test debug logging
LeanBitLab Jul 20, 2026
33d61a1
docs: remove Java gesture engine mentions in README and FEATURES.md
LeanBitLab Jul 20, 2026
0f05d2e
fix(gesture): only set sHaveNativeGestureLib true for gesture-compati…
LeanBitLab Jul 20, 2026
11d26bc
fix(gesture): require native gesture lib for gesture input enablement
LeanBitLab Jul 20, 2026
9622b1f
feat(gesture): show toast prompt when swiping without native gesture …
LeanBitLab Jul 20, 2026
9370b0c
docs: add v4.0.2 changelog and release notes
LeanBitLab Jul 20, 2026
07a1c09
docs: remove auto-space toggle and gesture toast from v4.0.2 notes
LeanBitLab Jul 20, 2026
74c5446
fix(pointer): add null guards for sDrawingProxy to prevent NPE in res…
LeanBitLab Jul 20, 2026
0767e66
fix(emoji): apply customEmojiTypeface to emoji search suggestions in …
LeanBitLab Jul 20, 2026
622a881
fix(emoji): honor useSystemEmoji setting in getCustomEmojiTypeface
LeanBitLab Jul 20, 2026
7fe7b00
fix(i18n): clarify gesture typing in Turkish autospace settings
LeanBitLab Jul 20, 2026
9d74736
fix(input): remove premature finishComposingText before commitChosenW…
LeanBitLab Jul 20, 2026
e11f53c
fix(settings): remove duplicate gesture typing toggle from TextCorrec…
LeanBitLab Jul 20, 2026
91d8fda
fix(settings): remove redundant emoji library status item from Librar…
LeanBitLab Jul 20, 2026
ce0c97d
fix(settings): remove obsolete gesture engine selection option from W…
LeanBitLab Jul 20, 2026
dee0db7
fix(input/ui): resolve 5 reported bugs for suggestions, translation h…
LeanBitLab Jul 20, 2026
f19795b
fix(ui): use showDialogForIme with windowToken to prevent BadTokenExc…
LeanBitLab Jul 20, 2026
dba539f
refactor(ui): remove custom button from translation strip and fix lan…
LeanBitLab Jul 20, 2026
8e22d06
fix(ui): correct isSameLanguage logic in SuggestionStripView
LeanBitLab Jul 20, 2026
5cbb3d5
feat(translation): accumulate custom languages in history without ove…
LeanBitLab Jul 20, 2026
a2926f5
feat(translation): enable long press deletion for all translation lan…
LeanBitLab Jul 20, 2026
7b071d7
docs: sync release notes v4.0.2 and fastlane 4002 changelog
LeanBitLab Jul 20, 2026
3150eb0
docs: add special thanks to @AZADAYAZ in release notes v4.0.2
LeanBitLab Jul 20, 2026
883b010
fix(settings): move gesture autospace toggles to gesture typing section
LeanBitLab Jul 20, 2026
42b10ef
feat(expander): add preference toggle for backspace undo behavior
LeanBitLab Jul 20, 2026
8e5b1ab
fix(settings): remove duplicate setting key definitions from TextCorr…
LeanBitLab Jul 20, 2026
9d80bb0
fix(expander): reset mLastComposedWord when text expansion is reverte…
LeanBitLab Jul 21, 2026
8042a71
fix(expander): prevent immediate re-expansion of shortcut reverted by…
LeanBitLab Jul 21, 2026
85a85be
fix(expander): set backspace undoes expansion toggle off by default
LeanBitLab Jul 21, 2026
faef417
merge: stack LeanBitLab v4.0.2
AsafMah Jul 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 10 additions & 22 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,24 @@
---
name: Bug report
about: Create a report to help us improve
about: Report a bug to help us improve
labels: bug
---

Please see the appropriate readme section for issue reporting guidelines: https://github.com/LeanBitLab/HeliboardL?tab=readme-ov-file#reporting-issues
tl;dr:
* search for duplicates, also in closed issues
* a single issue per topic
* reduce screenshot size

<!--
issue template below, please remove above text before submitting (and the template too if you think it's a good idea)
Please choose a meaningful title for your issue, and consider that if you want help you should provide enough information that people can actually help
-->

**Describe the bug**
A clear and concise description of the bug.

**To Reproduce**
If possible, provide all the necessary steps to reproduce your problem, including the involved apps or settings if relevant.
In case you cannot reproduce the bug, say so and provide information about when the bug may occur for you. Settings and the app you're writing in are usually important, please don't omit them.
Steps to reproduce the behavior (e.g. apps involved, settings).

**Expected behavior**
If it's not obvious (e.g. not crash), describe how you think the app should behave.
A clear and concise description of what you expected to happen.

**Screenshots**
ONLY add screenshots when they add real value.
If you add screenshots, reduce the size or use thumbnails to keep the issue nicely readable.
Add screenshots only if they help explain the problem (keep file size small).

**App version**
Please provide the explicit version (not just "latest"), or if you build the app yourself specify the latest commit.
**App version & Flavor**
Specify the version (e.g. v3.9.9) or build commit, and the flavor (e.g. standardfull, standard, offline, offlinelite).

**Device:**
- Model: [e.g. Samsung Galaxy S9]
- OS: [e.g. Android 10] (please also mention whether you are using the manufacturer's OS or a custom ROM)
**Device Info**
- Model:
- OS version:
28 changes: 8 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,17 @@ about: Suggest an idea for this project
labels: enhancement
---

Please see the appropriate readme section for issue reporting guidelines: https://github.com/Helium314/HeliBoard?tab=readme-ov-file#reporting-issues
tl;dr:
* search for duplicates, also in closed issues
* check FAQ / hidden features
* a single issue per topic
* ONLY add screenshots when necessary, and reduce their size

<!--
issue template below, please remove above text before submitting (and the template too if you think it's a good idea)
Please choose a meaningful title for your issue
-->

<!-- Please check FAQ and hidden features whether what you want is already implemented -->

**Is your feature request related to a problem? Please describe.**
**Is your feature request related to a problem?**
Describe the problem you are trying to solve.

**Describe the solution you'd like**
Please provide a description of what you would like to have. The clearer it is described, the better it can be implemented the way you want it.
A clear description of the feature or behavior you want.

**Use case**
Provide a clear and concise description of *your use case* and what you thus think is missing, and why.
Explain how you would use this feature and why it is useful.

**Describe alternatives you've considered (if any)**
**Alternatives considered**
Any alternative solutions or workarounds you've considered.

**App version**
Please provide the explicit version, you're using.
**App version & Flavor**
Specify the version and the flavor you are using (e.g. standardfull, standard, offline, offlinelite).
11 changes: 3 additions & 8 deletions .github/ISSUE_TEMPLATE/other.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
---
name: Other
about: Anything that does not fit into the other categories. Please don't use this for questions, discussions, or anything that fits into one of the other issue categories.
about: Anything that does not fit into the other categories
---

Please see the appropriate readme section for issue reporting guidelines: https://github.com/Helium314/HeliBoard?tab=readme-ov-file#reporting-issues
tl;dr:
* search for duplicates, also in closed issues
* a single issue per topic
* ONLY add screenshots when necessary, and reduce their size

<!-- please remove above text before submitting, and choose a meaningful title for your issue -->
**Describe your query or suggestion**
A clear and concise description of your topic.
1 change: 1 addition & 0 deletions .github/workflows/build-release-apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
prerelease: ${{ contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha') || contains(github.ref_name, 'rc') }}
body_path: docs/releasenote/release_notes_temp.md
files: |
app/build/outputs/apk/standard/release/*.apk
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ and this project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
- **Fallback gesture suggestions no longer leak dictionary capitalization** when Shift is off; the Java gesture engine now emits canonical lowercase candidates before the existing suggestion presentation-casing layer. (#118)

### Upstream
- Merged **LeanBitLab/LeanType v3.9.9** (pinned at `adb7c3755`, including v3.9.6–v3.9.8) — adds system-emoji and app-language settings, multi-row number rows, toolbar swipe-to-dismiss, translation and spellcheck improvements, asynchronous fallback-gesture indexing, dictionary upgrade preservation, and native dictionary crash/ANR fixes. Fork identity (`LeanTypeDual`, distinct `applicationId`, privacy tiers, and fork-specific features) is preserved. (#121)
- Merged **LeanBitLab/LeanType v4.0.2** (pinned at `0477ef83`, including v4.0.0/v4.0.1) — adds JNI and lifecycle hardening, first-word and next-word controls, background-service controls, immediate autospace, translation-history improvements, and pointer/input-connection stability fixes. LeanTypeDual retains its Java fallback gesture engine, distinct `applicationId`, privacy tiers, two-thumb behavior, and fork-owned release metadata. (#123)

## [3.10.0] - 2026-06-20

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ SPDX-License-Identifier: Apache-2.0 AND GPL-3.0-only
<application android:label="@string/english_ime_name"
android:name="helium314.keyboard.latin.App"
android:icon="@mipmap/ic_launcher"
android:largeHeap="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:allowBackup="false"
android:defaultToDeviceProtectedStorage="true"
android:directBootAware="true"
android:enableOnBackInvokedCallback="true"
android:networkSecurityConfig="@xml/network_security_config"
android:usesCleartextTraffic="true"
tools:remove="android:appComponentFactory"
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/assets/dictionaries_in_dict_repo.csv
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ emoji,as,cldr
main,as,
emoji,ast,cldr
emoji,az,cldr
main,bn_BD,exp
emoji,bn,cldr
main,bn,
main,bn,exp
emoji,eu,cldr
main,eu,
emoji,be,cldr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,13 @@ public boolean isValidDictionary() {
}

public int getFormatVersion() {
return getFormatVersionNative(mNativeDict);
if (!isValidDictionary()) return 0;
try {
return getFormatVersionNative(mNativeDict);
} catch (final Throwable e) {
Log.e(TAG, "getFormatVersion failed", e);
return 0;
}
}

@Override
Expand All @@ -342,67 +348,87 @@ public boolean isInDictionary(final String word) {

@Override
public int getFrequency(final String word) {
if (TextUtils.isEmpty(word)) {
if (TextUtils.isEmpty(word) || !isValidDictionary()) {
return NOT_A_PROBABILITY;
}
try {
final int[] codePoints = StringUtils.toCodePointArray(word);
return getProbabilityNative(mNativeDict, codePoints);
} catch (final Throwable e) {
Log.e(TAG, "getFrequency failed", e);
return NOT_A_PROBABILITY;
}
final int[] codePoints = StringUtils.toCodePointArray(word);
return getProbabilityNative(mNativeDict, codePoints);
}

@Override
public int getMaxFrequencyOfExactMatches(final String word) {
if (TextUtils.isEmpty(word)) {
if (TextUtils.isEmpty(word) || !isValidDictionary()) {
return NOT_A_PROBABILITY;
}
try {
final int[] codePoints = StringUtils.toCodePointArray(word);
return getMaxProbabilityOfExactMatchesNative(mNativeDict, codePoints);
} catch (final Throwable e) {
Log.e(TAG, "getMaxFrequencyOfExactMatches failed", e);
return NOT_A_PROBABILITY;
}
final int[] codePoints = StringUtils.toCodePointArray(word);
return getMaxProbabilityOfExactMatchesNative(mNativeDict, codePoints);
}

public boolean isValidNgram(final NgramContext ngramContext, final String word) {
return getNgramProbability(ngramContext, word) != NOT_A_PROBABILITY;
}

public int getNgramProbability(final NgramContext ngramContext, final String word) {
if (!ngramContext.isValid() || TextUtils.isEmpty(word)) {
if (!ngramContext.isValid() || TextUtils.isEmpty(word) || !isValidDictionary()) {
return NOT_A_PROBABILITY;
}
try {
final int[][] prevWordCodePointArrays = new int[ngramContext.getPrevWordCount()][];
final boolean[] isBeginningOfSentenceArray = new boolean[ngramContext.getPrevWordCount()];
ngramContext.outputToArray(prevWordCodePointArrays, isBeginningOfSentenceArray);
final int[] wordCodePoints = StringUtils.toCodePointArray(word);
return getNgramProbabilityNative(mNativeDict, prevWordCodePointArrays,
isBeginningOfSentenceArray, wordCodePoints);
} catch (final Throwable e) {
Log.e(TAG, "getNgramProbability failed", e);
return NOT_A_PROBABILITY;
}
final int[][] prevWordCodePointArrays = new int[ngramContext.getPrevWordCount()][];
final boolean[] isBeginningOfSentenceArray = new boolean[ngramContext.getPrevWordCount()];
ngramContext.outputToArray(prevWordCodePointArrays, isBeginningOfSentenceArray);
final int[] wordCodePoints = StringUtils.toCodePointArray(word);
return getNgramProbabilityNative(mNativeDict, prevWordCodePointArrays,
isBeginningOfSentenceArray, wordCodePoints);
}

public WordProperty getWordProperty(final String word, final boolean isBeginningOfSentence) {
if (word == null) {
if (word == null || !isValidDictionary()) {
return null;
}
final int[] codePoints = StringUtils.toCodePointArray(word);
final int[] outCodePoints = new int[DICTIONARY_MAX_WORD_LENGTH];
final boolean[] outFlags = new boolean[FORMAT_WORD_PROPERTY_OUTPUT_FLAG_COUNT];
final int[] outProbabilityInfo =
new int[FORMAT_WORD_PROPERTY_OUTPUT_PROBABILITY_INFO_COUNT];
final ArrayList<int[][]> outNgramPrevWordsArray = new ArrayList<>();
final ArrayList<boolean[]> outNgramPrevWordIsBeginningOfSentenceArray =
new ArrayList<>();
final ArrayList<int[]> outNgramTargets = new ArrayList<>();
final ArrayList<int[]> outNgramProbabilityInfo = new ArrayList<>();
final ArrayList<int[]> outShortcutTargets = new ArrayList<>();
final ArrayList<Integer> outShortcutProbabilities = new ArrayList<>();
getWordPropertyNative(mNativeDict, codePoints, isBeginningOfSentence, outCodePoints,
outFlags, outProbabilityInfo, outNgramPrevWordsArray,
outNgramPrevWordIsBeginningOfSentenceArray, outNgramTargets,
outNgramProbabilityInfo, outShortcutTargets, outShortcutProbabilities);
return new WordProperty(codePoints,
outFlags[FORMAT_WORD_PROPERTY_IS_NOT_A_WORD_INDEX],
outFlags[FORMAT_WORD_PROPERTY_IS_POSSIBLY_OFFENSIVE_INDEX],
outFlags[FORMAT_WORD_PROPERTY_HAS_NGRAMS_INDEX],
try {
final int[] codePoints = StringUtils.toCodePointArray(word);
final int[] outCodePoints = new int[DICTIONARY_MAX_WORD_LENGTH];
final boolean[] outFlags = new boolean[FORMAT_WORD_PROPERTY_OUTPUT_FLAG_COUNT];
final int[] outProbabilityInfo =
new int[FORMAT_WORD_PROPERTY_OUTPUT_PROBABILITY_INFO_COUNT];
final ArrayList<int[][]> outNgramPrevWordsArray = new ArrayList<>();
final ArrayList<boolean[]> outNgramPrevWordIsBeginningOfSentenceArray =
new ArrayList<>();
final ArrayList<int[]> outNgramTargets = new ArrayList<>();
final ArrayList<int[]> outNgramProbabilityInfo = new ArrayList<>();
final ArrayList<int[]> outShortcutTargets = new ArrayList<>();
final ArrayList<Integer> outShortcutProbabilities = new ArrayList<>();
getWordPropertyNative(mNativeDict, codePoints, isBeginningOfSentence, outCodePoints,
outFlags, outProbabilityInfo, outNgramPrevWordsArray,
outNgramPrevWordIsBeginningOfSentenceArray, outNgramTargets,
outNgramProbabilityInfo, outShortcutTargets, outShortcutProbabilities);
return new WordProperty(codePoints,
outFlags[FORMAT_WORD_PROPERTY_IS_NOT_A_WORD_INDEX],
outFlags[FORMAT_WORD_PROPERTY_IS_POSSIBLY_OFFENSIVE_INDEX],
outFlags[FORMAT_WORD_PROPERTY_HAS_NGRAMS_INDEX],
outFlags[FORMAT_WORD_PROPERTY_HAS_SHORTCUTS_INDEX],
outFlags[FORMAT_WORD_PROPERTY_IS_BEGINNING_OF_SENTENCE_INDEX], outProbabilityInfo,
outNgramPrevWordsArray, outNgramPrevWordIsBeginningOfSentenceArray,
outNgramTargets, outNgramProbabilityInfo, outShortcutTargets,
outShortcutProbabilities);
} catch (final Throwable e) {
Log.e(TAG, "getWordProperty failed", e);
return null;
}
}

public static class GetNextWordPropertyResult {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class AccessibilityUtils private constructor() {
* @return `true` if accessibility is enabled.
*/
val isAccessibilityEnabled: Boolean
get() = ENABLE_ACCESSIBILITY && mAccessibilityManager.isEnabled
get() = ENABLE_ACCESSIBILITY && this::mAccessibilityManager.isInitialized && mAccessibilityManager.isEnabled

/**
* Returns `true` if touch exploration is enabled. Currently, this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ private void setMainKeyboardFrame(
// @see
// LatinIME#onComputeInset(android.inputmethodservice.InputMethodService.Insets)
mMainKeyboardFrame.setVisibility(visibility);
mKeyboardViewWrapper.setVisibility(Settings.getInstance().readShowToolbarOnly() ? View.GONE : View.VISIBLE);
mEmojiPalettesView.setVisibility(View.GONE);
mEmojiPalettesView.stopEmojiPalettes();
mEmojiTabStripView.setVisibility(View.GONE);
Expand Down Expand Up @@ -917,10 +918,18 @@ public void trimMemory() {
if (mEmojiPalettesView != null) {
mEmojiPalettesView.clearKeyboardCache();
}
if (mClipboardHistoryView != null) {
mClipboardHistoryView.stopClipboardHistory();
}
PointerTracker.clearOldViewData();
KeyboardLayoutSet.onSystemLocaleChanged();
}

@SuppressLint("InflateParams")
public View onCreateInputView(@NonNull Context displayContext, final boolean isHardwareAcceleratedDrawingEnabled) {
if (mCurrentInputView != null) {
mCurrentInputView.removeAllViews();
}
if (mKeyboardView != null) {
mKeyboardView.closing();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ private constructor(val themeId: Int, @JvmField val mStyleId: Int) {
prefs.getString(Settings.PREF_THEME_COLORS, Defaults.PREF_THEME_COLORS)
val themeStyle = prefs.getString(Settings.PREF_THEME_STYLE, Defaults.PREF_THEME_STYLE)

return getThemeColors(themeName!!, themeStyle!!, context, prefs, isNight)
val safeThemeName = themeName ?: Defaults.PREF_THEME_COLORS
val safeThemeStyle = themeStyle ?: Defaults.PREF_THEME_STYLE
return getThemeColors(safeThemeName, safeThemeStyle, context, prefs, isNight)
}

private fun getThemeColors(themeName: String, themeStyle: String, context: Context, prefs: SharedPreferences, isNight: Boolean): Colors {
Expand Down
Loading