-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. simplified suggestion scrolling; 2. hopefully fixed the 'spans can…
… not have zero length' warning; 3. fixed repeated words popping over and over again, when scrolling the suggestions in Amazon Kindle app, on the Share Document screen (AppHacks established)
- Loading branch information
Showing
5 changed files
with
86 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package io.github.sspanak.tt9.ime.helpers; | ||
|
||
import android.view.inputmethod.EditorInfo; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import io.github.sspanak.tt9.ime.modes.InputMode; | ||
|
||
public class AppHacks { | ||
private final EditorInfo editorInfo; | ||
private final TextField textField; | ||
|
||
|
||
public AppHacks(EditorInfo inputField, TextField textField) { | ||
this.editorInfo = inputField; | ||
this.textField = textField; | ||
} | ||
|
||
|
||
private boolean isKindleInvertedTextField() { | ||
return editorInfo != null && editorInfo.inputType == 1 && editorInfo.packageName.contains("com.amazon.kindle"); | ||
} | ||
|
||
|
||
public boolean setComposingTextWithHighlightedStem(@NonNull String word) { | ||
if (isKindleInvertedTextField()) { | ||
textField.setComposingText(word); | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
|
||
public boolean onBackspace(InputMode inputMode) { | ||
if (isKindleInvertedTextField()) { | ||
inputMode.clearWordStem(); | ||
} | ||
|
||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters