mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-17 15:32:48 +00:00
make it compile (again, why did it work before?)
This commit is contained in:
parent
04430fdb21
commit
eee94f2924
3 changed files with 8 additions and 8 deletions
|
@ -17,7 +17,7 @@ interface Combiner {
|
|||
* @param event the event to combine with the existing state.
|
||||
* @return the resulting event.
|
||||
*/
|
||||
fun processEvent(previousEvents: ArrayList<Event>?, event: Event?): Event
|
||||
fun processEvent(previousEvents: ArrayList<Event>?, event: Event): Event
|
||||
|
||||
/**
|
||||
* Get the feedback that should be shown to the user for the current state of this combiner.
|
||||
|
|
|
@ -188,18 +188,18 @@ class DeadKeyCombiner : Combiner {
|
|||
// TODO: make this a list of events instead
|
||||
val mDeadSequence = StringBuilder()
|
||||
|
||||
override fun processEvent(previousEvents: ArrayList<Event>?, event: Event?): Event {
|
||||
override fun processEvent(previousEvents: ArrayList<Event>?, event: Event): Event {
|
||||
if (TextUtils.isEmpty(mDeadSequence)) { // No dead char is currently being tracked: this is the most common case.
|
||||
if (event!!.isDead) { // The event was a dead key. Start tracking it.
|
||||
if (event.isDead) { // The event was a dead key. Start tracking it.
|
||||
mDeadSequence.appendCodePoint(event.mCodePoint)
|
||||
return Event.createConsumedEvent(event)
|
||||
}
|
||||
// Regular keystroke when not keeping track of a dead key. Simply said, there are
|
||||
// no dead keys at all in the current input, so this combiner has nothing to do and
|
||||
// simply returns the event as is. The majority of events will go through this path.
|
||||
// no dead keys at all in the current input, so this combiner has nothing to do and
|
||||
// simply returns the event as is. The majority of events will go through this path.
|
||||
return event
|
||||
}
|
||||
if (Character.isWhitespace(event!!.mCodePoint)
|
||||
if (Character.isWhitespace(event.mCodePoint)
|
||||
|| event.mCodePoint == mDeadSequence.codePointBefore(mDeadSequence.length)) { // When whitespace or twice the same dead key, we should output the dead sequence as is.
|
||||
val resultEvent = createEventChainFromSequence(mDeadSequence.toString(), event)
|
||||
mDeadSequence.setLength(0)
|
||||
|
|
|
@ -11,8 +11,8 @@ class HangulCombiner : Combiner {
|
|||
val history: MutableList<HangulSyllable> = mutableListOf()
|
||||
val syllable: HangulSyllable? get() = history.lastOrNull()
|
||||
|
||||
override fun processEvent(previousEvents: ArrayList<Event>?, event: Event?): Event? {
|
||||
if(event == null || event.mKeyCode == Constants.CODE_SHIFT) return event
|
||||
override fun processEvent(previousEvents: ArrayList<Event>?, event: Event): Event {
|
||||
if(event.mKeyCode == Constants.CODE_SHIFT) return event
|
||||
if(Character.isWhitespace(event.mCodePoint)) {
|
||||
val text = combiningStateFeedback
|
||||
reset()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue