refactor: extract KeyboardThemeManager from GeneralKeyboardIME (Part 9) - #426 - #682
Open
prince-0408 wants to merge 1 commit into
Open
refactor: extract KeyboardThemeManager from GeneralKeyboardIME (Part 9) - #426#682prince-0408 wants to merge 1 commit into
prince-0408 wants to merge 1 commit into
Conversation
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 9 in modularizing
GeneralKeyboardIMEfor #426.It extracts navigation bar color configuration, window decor insets, light/dark appearance controllers, empty state banner drawables, multi-layer suggestion button styling, and relative luminance calculations out of
GeneralKeyboardIME.ktinto a standalone helper classKeyboardThemeManager.Detailed Changes Table
KeyboardThemeManager.ktapplyNavBarColor), empty-state banner themes (applyBannerTheme), multi-layer suggestion button styling (applyInformativeSuggestionStyle), single suggestion pill formatting (applySingleSuggestionStyle), word suggestion text colors (getSuggestionTextColor), and luminance calculations (isLightColor).GeneralKeyboardIME.ktinto a dedicated helper class.GeneralKeyboardIME.ktthemeManagerand delegated theme styling, banner formatting, navigation bar configuration, and suggestion button rendering (applyNavBarColor,applyBannerTheme,handlePluralIfNeeded,handleSingleType,setSuggestionButton). Removed directContextCompatdrawable/tint boilerplate and unused imports.GeneralKeyboardIME.ktwhile maintaining 100% backward compatibility for all callers.FloatingKeyboardHandler.ktime.applyNavBarColorPublic()call toime.applyNavBarColor()directly, allowing removal of the redundant forwarder method.KeyboardThemeManagerTest.ktisLightColor) forWHITE,BLACK,LTGRAY, andDKGRAY.Key Benefits
GeneralKeyboardIME.kt.Related Issue
Refactors part of #426