Fix checkbox alignment and text positioning for multi-line checklist items#982
Fix checkbox alignment and text positioning for multi-line checklist items#982krahulshharmaa wants to merge 2 commits intoCrustack:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughRemoved parent-driven vertical centering and adjusted alignment/padding in the recycler list item layout: CheckBox now aligns to EditText baseline with a baseline offset, EditText is top-aligned with explicit vertical padding, and DragHandle's vertical-centering attribute was toggled. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
app/src/main/res/layout/recycler_list_item.xml (1)
35-45: DragHandle still useslayout_centerVertical— intentional?With the CheckBox and EditText now pinned to the top of the row,
DragHandleremains vertically centered in the parent. On tall multi-line items the drag handle will float to the middle of the row while the checkbox sits at the top, which may look inconsistent. If the intent is "everything aligned with the first line," consider switching DragHandle tolayout_alignTop="@id/EditText"(with matching top padding) as well; otherwise this can be ignored.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/src/main/res/layout/recycler_list_item.xml` around lines 35 - 45, The DragHandle ImageButton currently uses android:layout_centerVertical which causes it to float while the CheckBox and EditText are top-aligned; replace android:layout_centerVertical="true" with android:layout_alignTop="@id/EditText" (or the actual EditText id) so the drag handle aligns to the first line, and ensure its top padding matches the EditText/CheckBox padding so vertical spacing is consistent; remove the centerVertical attribute to avoid conflicting constraints.
🤖 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/main/res/layout/recycler_list_item.xml`:
- Around line 47-52: Replace the CheckBox's top alignment with baseline
alignment so the checkbox and EditText text line up: in the MaterialCheckBox
with id "CheckBox" remove android:layout_alignTop="@id/EditText" and use
android:layout_alignBaseline="@id/EditText" (or if using ConstraintLayout, use
app:layout_constraintBaseline_toBaselineOf="@id/EditText"); if you observe a 1px
optical offset after testing, add the MaterialCheckBox attribute
app:lastBaselineToBottomHeight="7sp" to fine-tune alignment across font scales
and multi-line cases.
---
Nitpick comments:
In `@app/src/main/res/layout/recycler_list_item.xml`:
- Around line 35-45: The DragHandle ImageButton currently uses
android:layout_centerVertical which causes it to float while the CheckBox and
EditText are top-aligned; replace android:layout_centerVertical="true" with
android:layout_alignTop="@id/EditText" (or the actual EditText id) so the drag
handle aligns to the first line, and ensure its top padding matches the
EditText/CheckBox padding so vertical spacing is consistent; remove the
centerVertical attribute to avoid conflicting constraints.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f12ad39d-8ed8-43c7-bce1-e56a9a2abb54
📒 Files selected for processing (1)
app/src/main/res/layout/recycler_list_item.xml
|
Are we going to merge this? |
Solved the alignment issue, the impacted file is recycler_list_item.xml.
Summary by CodeRabbit