Fix: Added robust keyboard visibility detection using WindowInsetsCompat.#17917
Fix: Added robust keyboard visibility detection using WindowInsetsCompat.#17917Arthur-Milchior merged 1 commit intoankidroid:mainfrom
Conversation
MrTheMech
left a comment
There was a problem hiding this comment.
Hey @Scapesfear ,
I tested the implementation, and it works perfectly! 🚀 The fix effectively prevents the keyboard from popping up when returning to searched cards.
One small improvement: Instead of naming the variable isCardBrowserReloaded, we can replace it with shouldClearSearchFocus for better readability and clarity.
I've attached a video of my test:
https://github.com/user-attachments/assets/5d2f647d-0b79-4b02-a3ae-65e789acff98
Hi @MrTheMech, thanks for suggestion, actually i named the variable so, because when we come back from any activity to the caller, the caller gets reloaded and thus I named it |
ee4e138 to
fa41711
Compare
780458f to
ef2ce86
Compare
mikehardy
left a comment
There was a problem hiding this comment.
Seems like it should work - one curiosity (that may result in no change...) about choice of method to close the soft keyboard
|
Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically |
|
Hi there @Scapesfear! This is the OpenCollective Notice for PRs merged from 2025-05-01 through 2025-05-31 If you are interested in compensation for this work, the process with details is here: https://github.com/ankidroid/Anki-Android/wiki/OpenCollective-Payment-Process#how-to-get-paid We only post one comment per person per month to avoid spamming you, regardless of the number of PRs merged, but this note applies to all PRs merged for this month Please understand that our monthly budget is never guaranteed to cover all claims - the cap on payments-per-person may be lower, but we try to make our process as fair and transparent as possible, we just need your understanding. Thanks! |
Purpose / Description
Ensures that when the keyboard is open, pressing back first closes the keyboard instead of collapsing the search view, using robust keyboard visibility detection with WindowInsetsCompat
Fixes
Approach
Implemented WindowInsetsCompat to accurately detect keyboard visibility. On back press, if the keyboard is open, it is hidden first instead of collapsing the search view..
How Has This Been Tested?
Samsun Galaxy F23 5G
https://github.com/user-attachments/assets/cc33384c-768f-4bf3-b82b-935c2019f68c
Checklist
Please, go through these checks before submitting the PR.