-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Copy link
Labels
help wantedExtra attention is neededExtra attention is neededrefactorRefactor code to improve qualityRefactor code to improve quality
Description
Terms
- I have searched open and closed feature requests
- I agree to follow Scribe-Android's Code of Conduct
Description
The GeneralKeyboardIME class currently violates the Single Responsibility Principle by handling both the InputMethodService lifecycle and the detailed manipulation of the UI view bindings.
Currently, methods like updateUI(), setupIdleView(), setupToolbarView(), updateButtonVisibility(), and updateCommandBarHintAndPrompt() clutter the main service class.
Proposal
Create a new class KeyboardUIManager (or KeyboardLayoutHelper) that:
- Takes the
InputMethodViewBindingin its constructor. - Manages the state transitions (IDLE, SELECT_COMMAND, etc.) and updates the views accordingly.
- Exposes simple methods like
showIdleState()orshowCommandState()thatGeneralKeyboardIMEcan call.
Benefits
- drastically reduces the line count of
GeneralKeyboardIME. - Decouples UI logic from Service lifecycle.
- Makes it easier to change the UI layout in the future without breaking the service logic.
Contribution
I am happy to work on this refactor.
andrewtavis
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is neededrefactorRefactor code to improve qualityRefactor code to improve quality
Type
Projects
Status
In Progress