Skip to content

Move keyboard logic inside keyboard flavour#583

Open
rovertrack wants to merge 1 commit intoscribe-org:mainfrom
rovertrack:keyboard
Open

Move keyboard logic inside keyboard flavour#583
rovertrack wants to merge 1 commit intoscribe-org:mainfrom
rovertrack:keyboard

Conversation

@rovertrack
Copy link
Copy Markdown

#546

Contributor checklist

note : i agree i have used "AI" only when i couldn't find the best possible ways to resolve some of the dependency required by both keyboard and conjugate , so its a little bit of ai boilerplate optimized by me.

The main problem - dependency chain

AboutScreen required HintUtils.resetHints()
HintUtils was full of keyboard logic and needed the ScribeState enum.
ScribeState came from GeneralKeyboardIME which was moved to keyboard flavor for isolating

To resolve this
moved ScribeState to its own file (in main).
We moved the resetHints() function from HintUtils to PreferencesHelper .
AboutScreen now calls PreferencesHelper.resetHints() , now no keybaord files are required - complete isolation
The KeyboardView would cast its context to GeneralKeyboardIME to update hint visibility. now GeneralKeyboardIME
implements a listener. It receives the event and then it calls HintUtils (which it can see now as they are in the same flavor).

OnKeyboardActionListener this is the listener , this was implemented because input_method_view.xml was in the main folder and moving this would cause other break other xml layouts so this listener is a no - op in conjugate and used only in keyboard flavor

added AndroidManifest for keyboard to strip compiling of keyboard only services from main to only compile it in keybaord flavor
moved from main/ to keyboard/

helpers only required by keyboard
helpers/

  • AnnotationTextUtils.kt
  • AutocompletionHandler.kt
  • BackspaceHandler.kt
  • Constants.kt
  • EmojiUtils.kt
  • KeyHandler.kt 
  • -KeyboardBase.kt
  • SpaceKeyProcessor.kt
  • SuggestionHandler.kt

ui /

  • KeyboardUIManager.kt (only required by keyboard)

services only required by keyboard

services /

  • FrenchKeyboardIME.kt
  • GeneralKeyboardIME.kt
  • ItalianKeyboardIME.kt
  • PortugueseKeyboardIME.kt
  • RussianKeyboardIME.kt
  • SpanishKeyboardIME.kt
  • SwedishKeyboardIME.kt

views only required by keyboard
views/

  • KeyboardView.kt

AboutUtilTest.kt- I updated this to mock PreferencesHelper instead of HintUtils.

KeyboardUIManagerTest.kt moves to src/testkkeyboards as the keybarod service this test required is available in keybaord flavor

@andrewtavis , @angrezichatterbox my focus was fully into isolating the keyboard flavor , please test the app for proper working.

thanks

@github-actions
Copy link
Copy Markdown

Thank you for the pull request! 💙🩵

The Scribe-Android team will do our best to address your contribution as soon as we can. The following are some important points:

  • Those interested in developing their skills and expanding their role in the community should read the mentorship and growth section of the contribution guide
  • If you're not already a member of our public Matrix community, please consider joining!
    • We'd suggest that you use the Element client as well as Element X for a mobile app
    • Join the General and Android rooms once you're in
  • Also consider attending our bi-weekly Saturday developer syncs!
    • Details are shared in the General room on Matrix each Wednesday before the sync
    • It would be great to meet you 😊

Note

Scribe uses Conventional Comments in reviews to make sure that communication is as clear as possible.

@github-actions
Copy link
Copy Markdown

Maintainer Checklist

The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

  • Tests for changes have been written and the unit test, linting and formatting workflows within the PR checks do not indicate new errors in the files changed

    • Tests may need to be reran as they're at times not deterministic
  • The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant