|
27 | 27 | import android.widget.Toast; |
28 | 28 |
|
29 | 29 | import androidx.annotation.NonNull; |
| 30 | +import androidx.annotation.Nullable; |
30 | 31 |
|
31 | 32 | import helium314.keyboard.event.Event; |
32 | 33 | import helium314.keyboard.keyboard.KeyboardLayoutSet.KeyboardLayoutSetException; |
|
47 | 48 | import helium314.keyboard.latin.utils.KtxKt; |
48 | 49 | import helium314.keyboard.latin.utils.LanguageOnSpacebarUtils; |
49 | 50 | import helium314.keyboard.latin.utils.Log; |
50 | | -import helium314.keyboard.latin.utils.RecapitalizeStatus; |
| 51 | +import helium314.keyboard.latin.utils.RecapitalizeMode; |
51 | 52 | import helium314.keyboard.latin.utils.ResourceUtils; |
52 | 53 | import helium314.keyboard.latin.utils.ScriptUtils; |
53 | 54 | import helium314.keyboard.latin.utils.SubtypeUtilsAdditional; |
@@ -139,7 +140,8 @@ private boolean updateKeyboardThemeAndContextThemeWrapper(final Context context, |
139 | 140 | } |
140 | 141 |
|
141 | 142 | public void loadKeyboard(final EditorInfo editorInfo, final SettingsValues settingsValues, |
142 | | - final int currentAutoCapsState, final int currentRecapitalizeState, KeyboardLayoutSet.InternalAction internalAction) { |
| 143 | + final int currentAutoCapsState, @Nullable final RecapitalizeMode currentRecapitalizeState, |
| 144 | + KeyboardLayoutSet.InternalAction internalAction) { |
143 | 145 | final KeyboardLayoutSet.Builder builder = new KeyboardLayoutSet.Builder( |
144 | 146 | mThemeContext, editorInfo); |
145 | 147 | final int keyboardWidth = ResourceUtils.getKeyboardWidth(mThemeContext, settingsValues); |
@@ -223,22 +225,22 @@ public Keyboard getKeyboard() { |
223 | 225 | // TODO: Remove this method. Come up with a more comprehensive way to reset the keyboard layout |
224 | 226 | // when a keyboard layout set doesn't get reloaded in LatinIME.onStartInputViewInternal(). |
225 | 227 | public void resetKeyboardStateToAlphabet(final int currentAutoCapsState, |
226 | | - final int currentRecapitalizeState) { |
| 228 | + @Nullable final RecapitalizeMode currentRecapitalizeState) { |
227 | 229 | mState.onResetKeyboardStateToAlphabet(currentAutoCapsState, currentRecapitalizeState); |
228 | 230 | } |
229 | 231 |
|
230 | 232 | public void onPressKey(final int code, final boolean isSinglePointer, |
231 | | - final int currentAutoCapsState, final int currentRecapitalizeState) { |
| 233 | + final int currentAutoCapsState, @Nullable final RecapitalizeMode currentRecapitalizeState) { |
232 | 234 | mState.onPressKey(code, isSinglePointer, currentAutoCapsState, currentRecapitalizeState); |
233 | 235 | } |
234 | 236 |
|
235 | 237 | public void onReleaseKey(final int code, final boolean withSliding, |
236 | | - final int currentAutoCapsState, final int currentRecapitalizeState) { |
| 238 | + final int currentAutoCapsState, @Nullable final RecapitalizeMode currentRecapitalizeState) { |
237 | 239 | mState.onReleaseKey(code, withSliding, currentAutoCapsState, currentRecapitalizeState); |
238 | 240 | } |
239 | 241 |
|
240 | 242 | public void onFinishSlidingInput(final int currentAutoCapsState, |
241 | | - final int currentRecapitalizeState) { |
| 243 | + @Nullable final RecapitalizeMode currentRecapitalizeState) { |
242 | 244 | mState.onFinishSlidingInput(currentAutoCapsState, currentRecapitalizeState); |
243 | 245 | } |
244 | 246 |
|
@@ -384,8 +386,8 @@ public void setNumpadKeyboard() { |
384 | 386 | } |
385 | 387 |
|
386 | 388 | @Override |
387 | | - public void toggleNumpad(final boolean withSliding, final int autoCapsFlags, final int recapitalizeMode, |
388 | | - final boolean forceReturnToAlpha) { |
| 389 | + public void toggleNumpad(final boolean withSliding, final int autoCapsFlags, |
| 390 | + @Nullable final RecapitalizeMode recapitalizeMode, final boolean forceReturnToAlpha) { |
389 | 391 | if (DEBUG_ACTION) { |
390 | 392 | Log.d(TAG, "toggleNumpad"); |
391 | 393 | } |
@@ -452,11 +454,11 @@ public void onToggleKeyboard(@NonNull final KeyboardSwitchState toggleState) { |
452 | 454 |
|
453 | 455 | // Future method for requesting an updating to the shift state. |
454 | 456 | @Override |
455 | | - public void requestUpdatingShiftState(final int autoCapsFlags, final int recapitalizeMode) { |
| 457 | + public void requestUpdatingShiftState(final int autoCapsFlags, @Nullable final RecapitalizeMode recapitalizeMode) { |
456 | 458 | if (DEBUG_ACTION) { |
457 | 459 | Log.d(TAG, "requestUpdatingShiftState: " |
458 | 460 | + " autoCapsFlags=" + CapsModeUtils.flagsToString(autoCapsFlags) |
459 | | - + " recapitalizeMode=" + RecapitalizeStatus.modeToString(recapitalizeMode)); |
| 461 | + + " recapitalizeMode=" + recapitalizeMode); |
460 | 462 | } |
461 | 463 | mState.onUpdateShiftState(autoCapsFlags, recapitalizeMode); |
462 | 464 | } |
@@ -598,7 +600,7 @@ public boolean isInDoubleTapShiftKeyTimeout() { |
598 | 600 | * Updates state machine to figure out when to automatically switch back to the previous mode. |
599 | 601 | */ |
600 | 602 | public void onEvent(final Event event, final int currentAutoCapsState, |
601 | | - final int currentRecapitalizeState) { |
| 603 | + @Nullable final RecapitalizeMode currentRecapitalizeState) { |
602 | 604 | mState.onEvent(event, currentAutoCapsState, currentRecapitalizeState); |
603 | 605 | } |
604 | 606 |
|
|
0 commit comments