refactor: extract ConjugationHandler from GeneralKeyboardIME (Part 12) - #426 - #687
Open
prince-0408 wants to merge 1 commit into
Open
Conversation
9 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR is Part 12 in modularizing GeneralKeyboardIME for #426.
It extracts verb conjugation state management, conjugation table layout calculation (2x1, 1x3, 3x2, 2x2), capitalization formatting, index boundary validation, and sub-view setup out of GeneralKeyboardIME.kt into a standalone helper class ConjugationHandler.
Detailed Changes Table
ConjugationHandler.ktsubsequentAreaRequired,subsequentData,conjugateOutput,conjugateLabels), layout mode saving (saveConjugateModeType), capitalization formatting (applyCapitalizationToConjugations), index validation (getValidatedConjugateIndex), conjugation key press handling (handleConjugateKeys), secondary sub-view setup (setupConjugateSubView), and layout XML selection (getKeyboardLayoutForState).GeneralKeyboardIME.ktinto a dedicated helper class.GeneralKeyboardIME.ktconjugationHandlerand delegated conjugation state properties (subsequentAreaRequired,subsequentData) and helper methods (saveConjugateModeType,applyCapitalizationToConjugations,getValidatedConjugateIndex,returnIsSubsequentRequired,returnSubsequentData,handleConjugateKeys,setupConjugateSubView,getKeyboardLayoutForState). Removed duplicate private helper implementations and unused constants.GeneralKeyboardIME.ktwhile maintaining 100% backward compatibility for all callers.ConjugationHandlerTest.ktapplyCapitalizationToConjugations), index boundary clamping (getValidatedConjugateIndex), layout mode saving (saveConjugateModeType), and XML layout selection (getKeyboardLayoutForState).CHANGELOG.md### ♻️ Code Refactoringdetailing the extraction ofConjugationHandlerfromGeneralKeyboardIME.ci_changelog_checkworkflow requirement for pull requests targetingmain.Key Benefits
2x1,1x3,3x2,2x2), verb tense capitalization rules, and multi-option selection sub-views fromGeneralKeyboardIME.kt.Related Issue
Refactors part of #426