-
-
Notifications
You must be signed in to change notification settings - Fork 45
Set side nav padding and margin top in percentage #3434
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
📝 WalkthroughWalkthroughThis pull request adds dynamic padding and margin adjustments to the navigation drawer UI. It introduces a new public ID ( Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. 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 (1)
app/src/org/commcare/navdrawer/BaseDrawerController.kt (1)
5-5: Runtime padding/margin adjustments are implemented safelyUsing
nav_drawer_widthfor horizontal padding anddrawerLayout.heightfor the signout top margin is consistent with the layout and avoids timing issues viapost {}; theMarginLayoutParamscast is valid for the current hierarchy, so no crash risk here.If you want to improve readability later, consider extracting the
0.04fand0.05fliterals into named constants (or dimen/fraction resources) to document the design intent and make future tuning easier.Also applies to: 99-116
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
app/res/layout/nav_drawer_base.xml(1 hunks)app/src/org/commcare/navdrawer/BaseDrawerController.kt(2 hunks)app/src/org/commcare/navdrawer/DrawerViewRefs.kt(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Lint Code Base
🔇 Additional comments (2)
app/res/layout/nav_drawer_base.xml (1)
7-7: Root container id addition looks goodExposing the root
LinearLayoutasnav_drawer_main_containeris consistent with usage inDrawerViewRefs/BaseDrawerControllerand doesn’t introduce layout regressions.app/src/org/commcare/navdrawer/DrawerViewRefs.kt (1)
28-28: New view reference is consistent with layout
navDrawerMainContainercorrectly matches the new root layout id and follows the existing pattern of strongly-typed view refs.
|
@jaypanchal-13 can you add before and after screenshots for this change. Also instead of setting padding based on width percentage we can simply be using constant values based on different screen widths and define it in small screen resource classes |
|
I think the percentage approach is less mainteneable (java instead of a simple xml constant value) and can be error prone as we add more views on the drawer. The outcome would be quite similar here in both aproached and it should not matter to product what approach we end up using based on technical maintenance and standard best practices for Android. |
|
conroy-ricketts
left a 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.
+1 on what Shubham said about defining constant values in our dimens.xml files that match the Figma as reasonably close as possible
|
@jaypanchal-13 I am confused here. Looking to your screenshots, only difference is that vertical padding for sign out view from top header. That is the requirement or something else? Also, agree with the point that changes has to be in xml file only and not in code. |
|
Ok got it. So, this can be handled by having |
|
You can use the same % calculation to arrive at a rough estimation per smallest width classifier |
Product Description
Ticket -> https://dimagi.atlassian.net/browse/CCCT-1776
Technical Summary
Set side nav margin and padding
ScreenShot ->

Small Device
left img -> before
right img-> after
Large Device

left img -> before
right img-> after
Feature Flag
Safety Assurance
Safety story
Automated test coverage
QA Plan
Labels and Review