Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Do not end up in debug messages when searching in add ons #989

Merged
merged 9 commits into from
Feb 21, 2024

Conversation

wutschel
Copy link
Collaborator

Description

Resolves #986.

Virtual keyboard might have been closed on App, but not on Kodi, which resulted in unexpected debug errors on the App. This is now resolved by canceling the Kodi keyboard by sending "Input.Back" in case of an active keyboard being canceled in the App. In addition, the App does now not show a debug message, when "" was sent to the Addon search. Instead, only the "no items found" message is seen.
On top, this PR does some refactoring and hygiene changes like indentation and white spaces corrections, removes unneeded parameters and refactors the code which send the text.

Summary for release notes

Bugfix: Do not end up in debug message when searching in add ons

Copy link
Collaborator

@kambala-decapitator kambala-decapitator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the usage of shouldChangeCharactersInRange delegate method is quite questionable here, but this can be adjusted in another PR

XBMC Remote/XBMCVirtualKeyboard.m Outdated Show resolved Hide resolved
XBMC Remote/XBMCVirtualKeyboard.m Outdated Show resolved Hide resolved
XBMC Remote/XBMCVirtualKeyboard.m Outdated Show resolved Hide resolved
XBMC Remote/XBMCVirtualKeyboard.m Outdated Show resolved Hide resolved
XBMC Remote/XBMCVirtualKeyboard.m Outdated Show resolved Hide resolved
- Remove magic number
- Introduce variable to allow calling GUIAction only once
To avoid a debug message when sending "" from virtual keyboard to addon search a dedicated check is added to DetailViewController to only show "no results".
The keyboard must be canceled if the view is left (viewWillDisappear). For this, the new notification Input.OnInputCanceled is introduced which is used to send Input.Back to Kodi in case the keyboard is in editing mode (active).
This prevents a potential race condition where the Kodi keyboard is already gone, but the App's keyboard is still up. Sending "Back" in this case will let Kodi leave the current context.
Simplify the layout calculation in textFieldDidBeginEditing, scale the layout for iPad. reduce magic numbers and improve variable naming, This change now also maintains the same bottom padding under the text field, with or without a keyboard title.
@wutschel
Copy link
Collaborator Author

Squashed and rebased to master.

@kambala-decapitator kambala-decapitator merged commit b7f91c6 into xbmc:master Feb 21, 2024
@wutschel wutschel deleted the rework_keyboard branch February 21, 2024 12:24
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.

JSON RPC error breaks Apps' search functionality
2 participants