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

Fix keyboard showing after the search box acquiring focus #8227

Merged
merged 3 commits into from
Apr 18, 2022

Conversation

dtcxzyw
Copy link
Contributor

@dtcxzyw dtcxzyw commented Apr 16, 2022

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • The code block on onResume() for showing/hiding the soft keyboard failed in a specific scenario. It is because the current view of InputMethodManager is not searchEditText. This problem is handled just when searchEditText gets the focus.
  • (Update) Fix the underlying problem as described in Keyboard doesn't open - Disabled animations #7647. It just tries again to request focus and show the soft keyboard when it fails.

Before/After Screenshots/Screen Record

  • Before:
before-small-mute.mp4
  • After:
after2-mute.mp4

Fixes the following issue(s)

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.

Due diligence

Copy link
Member

@litetex litetex left a comment

Choose a reason for hiding this comment

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

Thank you for the PR.

However:

  • This PR does not fix the underlying problem Keyboard doesn't open - Disabled animations #7647 (comment) and only applies a questionable workaround.
    • As I can't verify that this workaround works correctly and this is only fixes the SearchFragment and not other places where the keyboard is shown, I would suggest you implement the fix from the above comment instead.
  • If possible don't upload demo videos with background music

@dtcxzyw
Copy link
Contributor Author

dtcxzyw commented Apr 18, 2022

Thank @litetex for the review! I tried a similar fix on KeyboardUtil before this PR and it didn't work. But after I called cleanFocus() before re-requesting focus as you suggested, it worked fine. It does solve the problem without confusion compared to previous solutions. Please let me know if it's ready to be merged into the dev branch.

@dtcxzyw dtcxzyw requested a review from litetex April 18, 2022 06:12
Copy link
Member

@litetex litetex left a comment

Choose a reason for hiding this comment

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

LGTM :)

@litetex
Copy link
Member

litetex commented Apr 18, 2022

To the merger: This should be squash merged.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@litetex litetex merged commit 127a273 into TeamNewPipe:dev Apr 18, 2022
@Stypox Stypox mentioned this pull request Jun 24, 2022
3 tasks
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.

Keyboard doesn't open - Disabled animations
2 participants