-
-
Notifications
You must be signed in to change notification settings - Fork 45
Notification and work history screen title issue solved #3428
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
Conversation
📝 WalkthroughWalkthroughThe changes add Sequence DiagramsequenceDiagram
participant Android Runtime
participant Activity
Android Runtime->>Activity: onCreate()
Activity->>Activity: super.onCreate()
Android Runtime->>Activity: onPostCreate()
Note over Activity: NEW: Configure action bar<br/>(title, home button)
Activity->>Activity: super.onPostCreate()
Activity->>Activity: setUpUi() / initViews()
Note over Activity: Configure views, adapter,<br/>tab layout (if applicable)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
app/src/org/commcare/activities/PushNotificationActivity.kt (1)
65-72: Consider using safe call operator for null safety.The non-null assertion
supportActionBar!!will throw an NPE if the action bar is null. While unlikely in practice, using a safe call operator would be more defensive.Apply this diff for safer null handling:
- override fun onPostCreate(savedInstanceState: Bundle?) { - super.onPostCreate(savedInstanceState) - supportActionBar!!.apply { + override fun onPostCreate(savedInstanceState: Bundle?) { + super.onPostCreate(savedInstanceState) + supportActionBar?.apply { title = getString(R.string.personalid_notification) setDisplayShowHomeEnabled(true) setDisplayHomeAsUpEnabled(true) } }Note: Using
onPostCreatefor action bar setup is appropriate if this fixes a timing issue where the action bar wasn't properly initialized duringonCreate.app/src/org/commcare/activities/connect/PersonalIdWorkHistoryActivity.kt (1)
51-58: Consider using safe call operator for null safety.The non-null assertion
supportActionBar!!will throw an NPE if the action bar is null. Using a safe call operator would be more defensive.Apply this diff for safer null handling:
- override fun onPostCreate(savedInstanceState: Bundle?) { - super.onPostCreate(savedInstanceState) - supportActionBar!!.apply { + override fun onPostCreate(savedInstanceState: Bundle?) { + super.onPostCreate(savedInstanceState) + supportActionBar?.apply { title = getString(R.string.personalid_work_history_title) setDisplayShowHomeEnabled(true) setDisplayHomeAsUpEnabled(true) } }Note: The action bar configuration pattern is now consistent with
PushNotificationActivity. If needed in the future, this duplicate setup logic could be extracted to a helper method in the baseCommCareActivityclass.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/src/org/commcare/activities/PushNotificationActivity.kt(1 hunks)app/src/org/commcare/activities/connect/PersonalIdWorkHistoryActivity.kt(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: shubham1g5
Repo: dimagi/commcare-android PR: 0
File: :0-0
Timestamp: 2025-05-08T11:08:18.530Z
Learning: PR #3048 "Phase 4 Connect PR" introduces a substantial feature called "Connect" to the CommCare Android app, which includes messaging, job management, delivery tracking, payment processing, authentication flows, and learning modules. It follows a modern architecture using Navigation Components with three navigation graphs, segregated business logic in Manager classes, and proper database persistence.
Learnt from: OrangeAndGreen
Repo: dimagi/commcare-android PR: 3037
File: app/src/org/commcare/connect/ConnectIDManager.java:233-243
Timestamp: 2025-04-22T15:48:29.346Z
Learning: Never instantiate Android Activity classes directly with 'new' as it bypasses the Android component lifecycle. Activities should only be created by the system through Intents. Non-static instance fields don't need manual resetting as they'll be initialized with their default values when a new activity instance is properly created.
Technical Summary
https://dimagi.atlassian.net/browse/QA-8244
QA Plan
Labels and Review