Open keyboard with focus on name input on opening up name page#3554
Open keyboard with focus on name input on opening up name page#3554shubham1g5 wants to merge 1 commit intomasterfrom
Conversation
📝 WalkthroughWalkthroughThe pull request adds a lifecycle method override to PersonalIdNameFragment. The onResume method calls the parent implementation, then attempts to obtain focus on the name input field and displays the soft keyboard via KeyboardHelper when focus is acquired. The necessary KeyboardHelper import is also added to support this functionality. Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/src/org/commcare/fragments/personalId/PersonalIdNameFragment.java`:
- Line 52: Whitespace around the if condition in PersonalIdNameFragment.java
violates checkstyle: change the expression in the method where you call
binding.nameTextValue.requestFocus() so the if is formatted as "if
(binding.nameTextValue.requestFocus()) {" (add a space after "if" and before
"{"); update the line inside the class/method containing that call and re-run
the project's checkstyle validation to ensure no other spacing issues remain.
| @Override | ||
| public void onResume() { | ||
| super.onResume(); | ||
| if( binding.nameTextValue.requestFocus()){ |
There was a problem hiding this comment.
Checkstyle: fix whitespace around if condition.
if( is missing a space after the keyword, and ){ is missing a space before the opening brace. Both are standard checkstyle violations.
🔧 Proposed fix
- if( binding.nameTextValue.requestFocus()){
+ if (binding.nameTextValue.requestFocus()) {As per coding guidelines, Java code must be verified against checkstyle.xml.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if( binding.nameTextValue.requestFocus()){ | |
| if (binding.nameTextValue.requestFocus()) { |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@app/src/org/commcare/fragments/personalId/PersonalIdNameFragment.java` at
line 52, Whitespace around the if condition in PersonalIdNameFragment.java
violates checkstyle: change the expression in the method where you call
binding.nameTextValue.requestFocus() so the if is formatted as "if
(binding.nameTextValue.requestFocus()) {" (add a space after "if" and before
"{"); update the line inside the class/method containing that call and re-run
the project's checkstyle validation to ensure no other spacing issues remain.
|
@shubham1g5 What is the screen condition shown in the video at 00:18 seconds? And also, it's showing the name screen again from the code screen. Are you pressing the back button? |
Product Description
https://dimagi.atlassian.net/browse/CCCT-2103
name.page.keyboard.mp4
Technical Summary
I tried the similar things listed in #3532 to make the keyboard open without a delay but it didn't do the trick, so I ended up using the current approach to open the keyboard as well here that opens the keyboard after a 250 ms delay.
Safety Assurance
Verified locally
Labels and Review